All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.dalliance-all.js.map Maven / Gradle / Ivy

{"version":3,"sources":["node_modules/browser-pack/_prelude.js","js/bam.js","dalliance-all.js","js/bedwig.js","js/bigwig.js","js/bin.js","js/browser-ui.js","js/cbrowser.js","js/chainset.js","js/cigar.js","js/color.js","js/das.js","js/default-renderer.es6","js/domui.js","js/dummy-renderer.es6","js/encode.js","js/ensembljson.js","js/export-config.js","js/export-image.js","js/export-ui.js","js/exports.js","js/feature-draw.js","js/feature-popup.js","js/features.js","js/glyphs.js","js/jbjson.js","js/kspace.js","js/lh3utils.js","js/memstore.js","js/molgenisjson.js","js/multi-renderer.es6","js/numformats.js","js/overlay.js","js/probe.js","js/rulers.es6","js/sample.js","js/search.js","js/sequence-draw.js","js/session.js","js/sha1.js","js/sourceadapters.js","js/sourcecompare.js","js/spans.js","js/style.js","js/sub-renderer.es6","js/svg-export.js","js/svg-utils.js","js/tabix-source.js","js/tabix.js","js/test-source.es6","js/thub.js","js/tier-actions.js","js/tier-edit.js","js/tier.js","js/track-adder.js","js/trix.js","js/twoBit.js","js/utils.js","js/vcf.js","js/version.js","js/zoomslider.js","node_modules/babel-polyfill/lib/index.js","node_modules/core-js/fn/regexp/escape.js","node_modules/core-js/modules/_a-function.js","node_modules/core-js/modules/_a-number-value.js","node_modules/core-js/modules/_add-to-unscopables.js","node_modules/core-js/modules/_an-instance.js","node_modules/core-js/modules/_an-object.js","node_modules/core-js/modules/_array-copy-within.js","node_modules/core-js/modules/_array-fill.js","node_modules/core-js/modules/_array-from-iterable.js","node_modules/core-js/modules/_array-includes.js","node_modules/core-js/modules/_array-methods.js","node_modules/core-js/modules/_array-reduce.js","node_modules/core-js/modules/_array-species-constructor.js","node_modules/core-js/modules/_array-species-create.js","node_modules/core-js/modules/_bind.js","node_modules/core-js/modules/_classof.js","node_modules/core-js/modules/_cof.js","node_modules/core-js/modules/_collection-strong.js","node_modules/core-js/modules/_collection-to-json.js","node_modules/core-js/modules/_collection-weak.js","node_modules/core-js/modules/_collection.js","node_modules/core-js/modules/_core.js","node_modules/core-js/modules/_create-property.js","node_modules/core-js/modules/_ctx.js","node_modules/core-js/modules/_date-to-iso-string.js","node_modules/core-js/modules/_date-to-primitive.js","node_modules/core-js/modules/_defined.js","node_modules/core-js/modules/_descriptors.js","node_modules/core-js/modules/_dom-create.js","node_modules/core-js/modules/_enum-bug-keys.js","node_modules/core-js/modules/_enum-keys.js","node_modules/core-js/modules/_export.js","node_modules/core-js/modules/_fails-is-regexp.js","node_modules/core-js/modules/_fails.js","node_modules/core-js/modules/_fix-re-wks.js","node_modules/core-js/modules/_flags.js","node_modules/core-js/modules/_flatten-into-array.js","node_modules/core-js/modules/_for-of.js","node_modules/core-js/modules/_global.js","node_modules/core-js/modules/_has.js","node_modules/core-js/modules/_hide.js","node_modules/core-js/modules/_html.js","node_modules/core-js/modules/_ie8-dom-define.js","node_modules/core-js/modules/_inherit-if-required.js","node_modules/core-js/modules/_invoke.js","node_modules/core-js/modules/_iobject.js","node_modules/core-js/modules/_is-array-iter.js","node_modules/core-js/modules/_is-array.js","node_modules/core-js/modules/_is-integer.js","node_modules/core-js/modules/_is-object.js","node_modules/core-js/modules/_is-regexp.js","node_modules/core-js/modules/_iter-call.js","node_modules/core-js/modules/_iter-create.js","node_modules/core-js/modules/_iter-define.js","node_modules/core-js/modules/_iter-detect.js","node_modules/core-js/modules/_iter-step.js","node_modules/core-js/modules/_iterators.js","node_modules/core-js/modules/_library.js","node_modules/core-js/modules/_math-expm1.js","node_modules/core-js/modules/_math-fround.js","node_modules/core-js/modules/_math-log1p.js","node_modules/core-js/modules/_math-scale.js","node_modules/core-js/modules/_math-sign.js","node_modules/core-js/modules/_meta.js","node_modules/core-js/modules/_metadata.js","node_modules/core-js/modules/_microtask.js","node_modules/core-js/modules/_new-promise-capability.js","node_modules/core-js/modules/_object-assign.js","node_modules/core-js/modules/_object-create.js","node_modules/core-js/modules/_object-dp.js","node_modules/core-js/modules/_object-dps.js","node_modules/core-js/modules/_object-forced-pam.js","node_modules/core-js/modules/_object-gopd.js","node_modules/core-js/modules/_object-gopn-ext.js","node_modules/core-js/modules/_object-gopn.js","node_modules/core-js/modules/_object-gops.js","node_modules/core-js/modules/_object-gpo.js","node_modules/core-js/modules/_object-keys-internal.js","node_modules/core-js/modules/_object-keys.js","node_modules/core-js/modules/_object-pie.js","node_modules/core-js/modules/_object-sap.js","node_modules/core-js/modules/_object-to-array.js","node_modules/core-js/modules/_own-keys.js","node_modules/core-js/modules/_parse-float.js","node_modules/core-js/modules/_parse-int.js","node_modules/core-js/modules/_perform.js","node_modules/core-js/modules/_promise-resolve.js","node_modules/core-js/modules/_property-desc.js","node_modules/core-js/modules/_redefine-all.js","node_modules/core-js/modules/_redefine.js","node_modules/core-js/modules/_replacer.js","node_modules/core-js/modules/_same-value.js","node_modules/core-js/modules/_set-collection-from.js","node_modules/core-js/modules/_set-collection-of.js","node_modules/core-js/modules/_set-proto.js","node_modules/core-js/modules/_set-species.js","node_modules/core-js/modules/_set-to-string-tag.js","node_modules/core-js/modules/_shared-key.js","node_modules/core-js/modules/_shared.js","node_modules/core-js/modules/_species-constructor.js","node_modules/core-js/modules/_strict-method.js","node_modules/core-js/modules/_string-at.js","node_modules/core-js/modules/_string-context.js","node_modules/core-js/modules/_string-html.js","node_modules/core-js/modules/_string-pad.js","node_modules/core-js/modules/_string-repeat.js","node_modules/core-js/modules/_string-trim.js","node_modules/core-js/modules/_string-ws.js","node_modules/core-js/modules/_task.js","node_modules/core-js/modules/_to-absolute-index.js","node_modules/core-js/modules/_to-index.js","node_modules/core-js/modules/_to-integer.js","node_modules/core-js/modules/_to-iobject.js","node_modules/core-js/modules/_to-length.js","node_modules/core-js/modules/_to-object.js","node_modules/core-js/modules/_to-primitive.js","node_modules/core-js/modules/_typed-array.js","node_modules/core-js/modules/_typed-buffer.js","node_modules/core-js/modules/_typed.js","node_modules/core-js/modules/_uid.js","node_modules/core-js/modules/_validate-collection.js","node_modules/core-js/modules/_wks-define.js","node_modules/core-js/modules/_wks-ext.js","node_modules/core-js/modules/_wks.js","node_modules/core-js/modules/core.get-iterator-method.js","node_modules/core-js/modules/core.regexp.escape.js","node_modules/core-js/modules/es6.array.copy-within.js","node_modules/core-js/modules/es6.array.every.js","node_modules/core-js/modules/es6.array.fill.js","node_modules/core-js/modules/es6.array.filter.js","node_modules/core-js/modules/es6.array.find-index.js","node_modules/core-js/modules/es6.array.find.js","node_modules/core-js/modules/es6.array.for-each.js","node_modules/core-js/modules/es6.array.from.js","node_modules/core-js/modules/es6.array.index-of.js","node_modules/core-js/modules/es6.array.is-array.js","node_modules/core-js/modules/es6.array.iterator.js","node_modules/core-js/modules/es6.array.join.js","node_modules/core-js/modules/es6.array.last-index-of.js","node_modules/core-js/modules/es6.array.map.js","node_modules/core-js/modules/es6.array.of.js","node_modules/core-js/modules/es6.array.reduce-right.js","node_modules/core-js/modules/es6.array.reduce.js","node_modules/core-js/modules/es6.array.slice.js","node_modules/core-js/modules/es6.array.some.js","node_modules/core-js/modules/es6.array.sort.js","node_modules/core-js/modules/es6.array.species.js","node_modules/core-js/modules/es6.date.now.js","node_modules/core-js/modules/es6.date.to-iso-string.js","node_modules/core-js/modules/es6.date.to-json.js","node_modules/core-js/modules/es6.date.to-primitive.js","node_modules/core-js/modules/es6.date.to-string.js","node_modules/core-js/modules/es6.function.bind.js","node_modules/core-js/modules/es6.function.has-instance.js","node_modules/core-js/modules/es6.function.name.js","node_modules/core-js/modules/es6.map.js","node_modules/core-js/modules/es6.math.acosh.js","node_modules/core-js/modules/es6.math.asinh.js","node_modules/core-js/modules/es6.math.atanh.js","node_modules/core-js/modules/es6.math.cbrt.js","node_modules/core-js/modules/es6.math.clz32.js","node_modules/core-js/modules/es6.math.cosh.js","node_modules/core-js/modules/es6.math.expm1.js","node_modules/core-js/modules/es6.math.fround.js","node_modules/core-js/modules/es6.math.hypot.js","node_modules/core-js/modules/es6.math.imul.js","node_modules/core-js/modules/es6.math.log10.js","node_modules/core-js/modules/es6.math.log1p.js","node_modules/core-js/modules/es6.math.log2.js","node_modules/core-js/modules/es6.math.sign.js","node_modules/core-js/modules/es6.math.sinh.js","node_modules/core-js/modules/es6.math.tanh.js","node_modules/core-js/modules/es6.math.trunc.js","node_modules/core-js/modules/es6.number.constructor.js","node_modules/core-js/modules/es6.number.epsilon.js","node_modules/core-js/modules/es6.number.is-finite.js","node_modules/core-js/modules/es6.number.is-integer.js","node_modules/core-js/modules/es6.number.is-nan.js","node_modules/core-js/modules/es6.number.is-safe-integer.js","node_modules/core-js/modules/es6.number.max-safe-integer.js","node_modules/core-js/modules/es6.number.min-safe-integer.js","node_modules/core-js/modules/es6.number.parse-float.js","node_modules/core-js/modules/es6.number.parse-int.js","node_modules/core-js/modules/es6.number.to-fixed.js","node_modules/core-js/modules/es6.number.to-precision.js","node_modules/core-js/modules/es6.object.assign.js","node_modules/core-js/modules/es6.object.create.js","node_modules/core-js/modules/es6.object.define-properties.js","node_modules/core-js/modules/es6.object.define-property.js","node_modules/core-js/modules/es6.object.freeze.js","node_modules/core-js/modules/es6.object.get-own-property-descriptor.js","node_modules/core-js/modules/es6.object.get-own-property-names.js","node_modules/core-js/modules/es6.object.get-prototype-of.js","node_modules/core-js/modules/es6.object.is-extensible.js","node_modules/core-js/modules/es6.object.is-frozen.js","node_modules/core-js/modules/es6.object.is-sealed.js","node_modules/core-js/modules/es6.object.is.js","node_modules/core-js/modules/es6.object.keys.js","node_modules/core-js/modules/es6.object.prevent-extensions.js","node_modules/core-js/modules/es6.object.seal.js","node_modules/core-js/modules/es6.object.set-prototype-of.js","node_modules/core-js/modules/es6.object.to-string.js","node_modules/core-js/modules/es6.parse-float.js","node_modules/core-js/modules/es6.parse-int.js","node_modules/core-js/modules/es6.promise.js","node_modules/core-js/modules/es6.reflect.apply.js","node_modules/core-js/modules/es6.reflect.construct.js","node_modules/core-js/modules/es6.reflect.define-property.js","node_modules/core-js/modules/es6.reflect.delete-property.js","node_modules/core-js/modules/es6.reflect.enumerate.js","node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js","node_modules/core-js/modules/es6.reflect.get-prototype-of.js","node_modules/core-js/modules/es6.reflect.get.js","node_modules/core-js/modules/es6.reflect.has.js","node_modules/core-js/modules/es6.reflect.is-extensible.js","node_modules/core-js/modules/es6.reflect.own-keys.js","node_modules/core-js/modules/es6.reflect.prevent-extensions.js","node_modules/core-js/modules/es6.reflect.set-prototype-of.js","node_modules/core-js/modules/es6.reflect.set.js","node_modules/core-js/modules/es6.regexp.constructor.js","node_modules/core-js/modules/es6.regexp.flags.js","node_modules/core-js/modules/es6.regexp.match.js","node_modules/core-js/modules/es6.regexp.replace.js","node_modules/core-js/modules/es6.regexp.search.js","node_modules/core-js/modules/es6.regexp.split.js","node_modules/core-js/modules/es6.regexp.to-string.js","node_modules/core-js/modules/es6.set.js","node_modules/core-js/modules/es6.string.anchor.js","node_modules/core-js/modules/es6.string.big.js","node_modules/core-js/modules/es6.string.blink.js","node_modules/core-js/modules/es6.string.bold.js","node_modules/core-js/modules/es6.string.code-point-at.js","node_modules/core-js/modules/es6.string.ends-with.js","node_modules/core-js/modules/es6.string.fixed.js","node_modules/core-js/modules/es6.string.fontcolor.js","node_modules/core-js/modules/es6.string.fontsize.js","node_modules/core-js/modules/es6.string.from-code-point.js","node_modules/core-js/modules/es6.string.includes.js","node_modules/core-js/modules/es6.string.italics.js","node_modules/core-js/modules/es6.string.iterator.js","node_modules/core-js/modules/es6.string.link.js","node_modules/core-js/modules/es6.string.raw.js","node_modules/core-js/modules/es6.string.repeat.js","node_modules/core-js/modules/es6.string.small.js","node_modules/core-js/modules/es6.string.starts-with.js","node_modules/core-js/modules/es6.string.strike.js","node_modules/core-js/modules/es6.string.sub.js","node_modules/core-js/modules/es6.string.sup.js","node_modules/core-js/modules/es6.string.trim.js","node_modules/core-js/modules/es6.symbol.js","node_modules/core-js/modules/es6.typed.array-buffer.js","node_modules/core-js/modules/es6.typed.data-view.js","node_modules/core-js/modules/es6.typed.float32-array.js","node_modules/core-js/modules/es6.typed.float64-array.js","node_modules/core-js/modules/es6.typed.int16-array.js","node_modules/core-js/modules/es6.typed.int32-array.js","node_modules/core-js/modules/es6.typed.int8-array.js","node_modules/core-js/modules/es6.typed.uint16-array.js","node_modules/core-js/modules/es6.typed.uint32-array.js","node_modules/core-js/modules/es6.typed.uint8-array.js","node_modules/core-js/modules/es6.typed.uint8-clamped-array.js","node_modules/core-js/modules/es6.weak-map.js","node_modules/core-js/modules/es6.weak-set.js","node_modules/core-js/modules/es7.array.flat-map.js","node_modules/core-js/modules/es7.array.flatten.js","node_modules/core-js/modules/es7.array.includes.js","node_modules/core-js/modules/es7.asap.js","node_modules/core-js/modules/es7.error.is-error.js","node_modules/core-js/modules/es7.global.js","node_modules/core-js/modules/es7.map.from.js","node_modules/core-js/modules/es7.map.of.js","node_modules/core-js/modules/es7.map.to-json.js","node_modules/core-js/modules/es7.math.clamp.js","node_modules/core-js/modules/es7.math.deg-per-rad.js","node_modules/core-js/modules/es7.math.degrees.js","node_modules/core-js/modules/es7.math.fscale.js","node_modules/core-js/modules/es7.math.iaddh.js","node_modules/core-js/modules/es7.math.imulh.js","node_modules/core-js/modules/es7.math.isubh.js","node_modules/core-js/modules/es7.math.rad-per-deg.js","node_modules/core-js/modules/es7.math.radians.js","node_modules/core-js/modules/es7.math.scale.js","node_modules/core-js/modules/es7.math.signbit.js","node_modules/core-js/modules/es7.math.umulh.js","node_modules/core-js/modules/es7.object.define-getter.js","node_modules/core-js/modules/es7.object.define-setter.js","node_modules/core-js/modules/es7.object.entries.js","node_modules/core-js/modules/es7.object.get-own-property-descriptors.js","node_modules/core-js/modules/es7.object.lookup-getter.js","node_modules/core-js/modules/es7.object.lookup-setter.js","node_modules/core-js/modules/es7.object.values.js","node_modules/core-js/modules/es7.observable.js","node_modules/core-js/modules/es7.promise.finally.js","node_modules/core-js/modules/es7.promise.try.js","node_modules/core-js/modules/es7.reflect.define-metadata.js","node_modules/core-js/modules/es7.reflect.delete-metadata.js","node_modules/core-js/modules/es7.reflect.get-metadata-keys.js","node_modules/core-js/modules/es7.reflect.get-metadata.js","node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js","node_modules/core-js/modules/es7.reflect.get-own-metadata.js","node_modules/core-js/modules/es7.reflect.has-metadata.js","node_modules/core-js/modules/es7.reflect.has-own-metadata.js","node_modules/core-js/modules/es7.reflect.metadata.js","node_modules/core-js/modules/es7.set.from.js","node_modules/core-js/modules/es7.set.of.js","node_modules/core-js/modules/es7.set.to-json.js","node_modules/core-js/modules/es7.string.at.js","node_modules/core-js/modules/es7.string.match-all.js","node_modules/core-js/modules/es7.string.pad-end.js","node_modules/core-js/modules/es7.string.pad-start.js","node_modules/core-js/modules/es7.string.trim-left.js","node_modules/core-js/modules/es7.string.trim-right.js","node_modules/core-js/modules/es7.symbol.async-iterator.js","node_modules/core-js/modules/es7.symbol.observable.js","node_modules/core-js/modules/es7.system.global.js","node_modules/core-js/modules/es7.weak-map.from.js","node_modules/core-js/modules/es7.weak-map.of.js","node_modules/core-js/modules/es7.weak-set.from.js","node_modules/core-js/modules/es7.weak-set.of.js","node_modules/core-js/modules/web.dom.iterable.js","node_modules/core-js/modules/web.immediate.js","node_modules/core-js/modules/web.timers.js","node_modules/core-js/shim.js","node_modules/es6-promise/dist/es6-promise.js","node_modules/jszlib/js/inflate.js","node_modules/process/browser.js","node_modules/ramda/dist/ramda.js","node_modules/regenerator-runtime/runtime.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","BamFile","_getBaiRefLength","uncba","offset","p","nbin","readInt","b","nchnk","nintv","minBlockIndex","q","v","readVob","bi","block","makeBam","data","bai","indexChunks","callback","attempted","slice","fetch","header","makeBam2","timeout","parseBamHeader","unc","unbgzf","byteLength","Uint8Array","magic","BAM_MAGIC","toString","headLen","String","fromCharCode","nRef","bam","chrToIndex","indexToChr","lName","name","j","indexOf","substring","push","indices","parseBai","baiMagic","BAI_MAGIC","nref","ref","blockStart","Math","min","chunks","result","url","replace","RegExp","BamRecord","spans","bin","Range","union","intersection","readShort","readByte","readFloat","readInt64","lh3utils","reg2bins","Chunk","BamFlags","MULTIPLE_SEGMENTS","ALL_SEGMENTS_ALIGN","SEGMENT_UNMAPPED","NEXT_SEGMENT_UNMAPPED","REVERSE_COMPLEMENT","NEXT_REVERSE_COMPLEMENT","FIRST_SEGMENT","LAST_SEGMENT","SECONDARY_ALIGNMENT","QC_FAIL","DUPLICATE","SUPPLEMENTARY","prototype","blocksForRange","refId","max","index","this","intBinsL","intBins","leafChunks","otherChunks","c","cs","ce","lowest","minLin","maxLin","lb","prunedOtherChunks","chnk","maxv","intChunks","sort","c0","c1","dif","minv","mergedChunks","cur","nc","chr","opts","tramp","records","ba","finished","thisB","readBamRecords","chrId","fetchMin","fetchMax","undefined","start_stop","buffer","bind","SEQRET_DECODER","CIGAR_DECODER","sink","blockSize","blockEnd","record","refID","pos","bmn","mq","nl","flag_nc","flag","lseq","nextRef","nextPos","segment","light","seqLength","includeName","readName","nextSegment","cigar","cigop","seq","seqBytes","sb","qseq","quals","value","tag","type","cc","elen","reader","atype","alen","./bin","./lh3utils","./spans","2","BedWigParser","BedParseSession","parser","WigParseSession","wigState","sa","dalliance_registerParserFactory","registerParserFactory","das","DASStylesheet","DASStyle","DASGroup","DASFeature","utils","shallowCopy","createSession","__KV_REGEXP","__SPACE_REGEXP","BED_COLOR_REGEXP","parse","line","toks","split","start","parseInt","end","label","score","parseFloat","orientation","color","test","itemRgb","thickStart","thickEnd","blockCount","blockSizes","map","x","blockStarts","grp","id","notes","groups","geneId","geneName","gg","bmin","bmax","span","tsList","ranges","ts","bf","codingRegion","tl","tlList","readingFrame","readframe","flush","step","ti","m","exec","getStyleSheet","stylesheet","wigStyle","glyph","BGCOLOR","HEIGHT","pushStyle","FGCOLOR","BUMP","LABEL","ZINDEX","tsStyle","densStyle","COLOR1","COLOR2","./das","./sourceadapters","./utils","3","bwg_readOffset","M1","M2","M3","M4","BigWig","BigWigView","bwg","cirTreeOffset","cirTreeLength","isSummary","makeBwg","salted","Int16Array","la","Int32Array","BIG_WIG_MAGIC","BIG_BED_MAGIC","BIG_WIG_MAGIC_BE","BIG_BED_MAGIC_BE","version","numZoomLevels","chromTreeOffset","unzoomedDataOffset","unzoomedIndexOffset","fieldCount","definedFieldCount","asOffset","totalSummaryOffset","uncompressBufSize","extHeaderOffset","zoomLevels","zl","zlReduction","zlData","zlIndex","reduction","dataOffset","indexOffset","readChromTree","getAutoSQL","as","schema","BBIExtraIndex","bbi","field","jszlib","jszlib_inflate_buffer","inflateBuffer","arrayCopy","BIG_WIG_TYPE_GRAPH","BIG_WIG_TYPE_VSTEP","BIG_WIG_TYPE_FSTEP","chromsToIDs","idsToChroms","maxID","udo","eb","bpt","keySize","rootNodeOffset","bptReadNode","nodeType","cnt","childOffset","key","ki","charCode","chromId","substr","readWigData","chrName","readWigDataById","cirHeader","cirBlockSize","blocksToFetch","outstanding","filter","Date","now","fmin","fmax","cirFobRecur","level","instrument","console","log","cachedCirRoot","cirFobRecur2","fetchFeatures","maxCirBlockSpan","blockSpan","fetchRanges","fr","cirFobStartFetch","attempts","resultBuffer","contains","cirBlockData","isLeaf","lo","startChrom","startBase","endChrom","endBase","blockOffset","size","recurOffsets","b0","b1","features","createFeature","_chromId","k","parseFeatures","splice","fetchStart","fetchSize","fb","tmp","fa","Float32Array","itemCount","validCnt","maxVal","sumData","summaryOpts","maxScore","itemStep","itemSpan","blockType","dfc","rest","ch","bedColumns","featureOpts","isNaN","col","fields","exonFrames","geneName2","spanList","tlOffset","brf","readframeExplicit","getFirstAdjacent","dir","getFirstAdjacentById","blockToFetch","bestBlockChr","bestBlockOffset","chrx","bestFeature","bestChr","bestPos","fi","bestRecur","getUnzoomedView","unzoomedView","cirLen","nzl","getZoomedView","z","zh","view","_tsFetch","zoom","topLevelReductionCache","feats","thresholdSearch","referencePoint","threshold","fbThresholdSearchRecur","candidates","c2","d","chrOrd","candidate","rp","fromRef","initialChr","header_re","field_re","headerMatch","declType","comment","getExtraIndices","extraIndexCount","extraIndexListOffset","eil","ii","eiType","eiFieldCount","eiOffset","eiField","lookup","nodeOffset","valSize","node","Uint16Array","Uint32Array","lastChildOffset","localeCompare","4","BlobFetchable","blob","URLFetchable","_typeof","bstringToBuffer","charCodeAt","buf","readIntBE","Symbol","iterator","obj","constructor","sha1","b64_sha1","Promise","webkitSlice","FileReader","onloadend","ev","readAsBinaryString","FileReaderSync","res","readAsArrayBuffer","ns","ne","seed","isSafari","navigator","userAgent","fetchAsText","getURL","then","req","XMLHttpRequest","salt","open","setRequestHeader","onreadystatechange","readyState","status","responseText","credentials","withCredentials","send","err","resolver","urlOrObj","resolve","attempt","truncatedLength","setTimeout","abort","overrideMimeType","responseType","clearTimeout","response","bl","mozResponseArrayBuffer","convertBuffer","ArrayBuffer","./sha1","es6-promise","5","humanReadableScale","suffix","round","browser","Browser","makeElement","nf","removeChildren","formatLongInt","makeZoomSlider","initUI","holder","genomePanel","noSourceCSS","forEach","path","document","head","appendChild","rel","href","resolveURL","disableDefaultFeaturePopup","addFeatureListener","feature","hit","tier","featurePopup","classList","add","toolbar","className","title","coordSystem","speciesName","nameForCoordSystem","setDocumentTitle","locField","makeTooltip","locStatusField","zoomInBtn","zoomSlider","width","zoomSliderWidth","zoomOutBtn","clearHighlightsButton","addTrackBtn","favBtn","svgBtn","optsButton","helpButton","tierEditButton","leapLeftButton","leapRightButton","modeButtons","noTrackAdder","noTrackEditor","noExport","noOptions","noHelp","setUiMode","uiMode","mb","help","export","remove","noLeapButtons","firstChild","noTitle","margin","noLocationField","noClearHighlightsButton","noZoomSlider","toolbarBelow","lt2","lt5","roundSliderValue","rounded","ltx","zoomExpt","zoomBase","whole","frac","markSlider","addLabel","exp","addViewListener","_oldZoom","isSnapZooming","alternate","value2","current","active","removeLabels","zmin","zmax","zrange","numSliderTicks","sti","storeStatus","storeViewStatus","highlights","style","display","addTierListener","storeTierStatus","addEventListener","keyCode","preventDefault","stopPropagation","setSelectedTier","g","search","textContent","trackAddPopup","displayed","removeAllPopups","showTrackAdder","zoomStep","wantSnap","savedZoom","zoomSliderValue","zoomMin","activeZSV","openExportPanel","toggleOptsPopup","toggleHelpPopup","selectedTiers","openTierPanel","tiers","leap","reverseKeyScrolling","st","getSelectedTier","featureSource","sourceAdapterIsCapable","quantLeapThreshold","config","dasSource","addTierSelectionListener","canLeap","clearHighlights","addTierSelectionWrapListener","focus","sel","hideToolPanel","manipulatingTier","ft","uiKeyHandler","removeEventListener","browserHolder","showToolPanel","panel","nowrap","activeToolPanel","parentElement","removeChild","content","overflowY","divider","svgHolder","resizeViewer","helpFrame","scrolling","seamless","src","optsForm","boxSizing","MozBoxSizing","verticalAlign","optsTable","cellPadding","scrollModeButton","checked","reverseScrolling","align","scrollKeyButton","rulerSelect","rulerLocation","positionRuler","paintQuant","singleBaseHighlightButton","singleBaseHighlight","setAttribute","resetButton","marginLeft","marginRight","reset","./cbrowser","./export-config","./export-image","./export-ui","./numformats","./session","./svg-export","./tier-edit","./zoomslider","6","Region","renderers","default","DefaultRenderer","dummy","DummyRenderer","multi","MultiRenderer","sub","SubRenderer","defaultRenderer","renderer","prefix","sources","tierGroups","searchOnlySources","searchOnlySourceHolders","featureListeners","featureHoverListeners","viewListeners","regionSelectListeners","tierListeners","tierSelectionListeners","tierSelectionWrapListeners","cookieKey","chains","pageName","zoomFactor","maxPixelsPerBase","origin","targetQuantRes","featurePanelWidth","entryPoints","currentSeqMax","maxViewWidth","defaultSubtierMax","highZoomThreshold","mediumZoomThreshold","minExtraWidth","maxExtraWidth","defaultHighlightFill","defaultHighlightAlpha","exportHighlights","exportRuler","exportBanner","exportRegion","tierBackgroundColors","minTierHeight","noDefaultLabels","availableSources","Observed","defaultSources","mappableSources","registry","noRegistryTabs","defaultTrackAdderTab","hubs","hubObjects","sourceCache","SourceCache","retina","useFetchWorkers","maxWorkers","workerPath","resolvers","resolverSeed","assemblyNamePrimary","assemblyNameUcsc","defaultSearchRegionPadding","httpCanaryURL","httpWarningURL","initListeners","baseColors","A","C","G","T","-","I","viewStart","viewEnd","offscreenInitWidth","uiPrefix","location","window","hostname","port","proto","protocol","realInit","loadListener","setSources","msh","maybeMapping","mapping","set","glyphLookup","glyphs","rx","ry","matches","gi","notSelectable","minY","maxY","group","FetchWorker","worker","tagSeed","callbacks","onmessage","cmd","postMessage","cb","error","makeFetchWorker","wurl","wscript","VERSION","wblob","Blob","reject","Worker","URL","createObjectURL","onerror","message","sourcesByURI","Awaited","miniJSONify","textXHR","DasTier","hex_sha1","thub","connectTrackHub","formatQuantLabel","Chainset","sourcecompare","sourcesAreEqual","sourcesAreEqualModuloStyle","sourceDataURI","sourceStyleURI","destroy","resizeListener","fetchWorkers","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","next","done","terminate","self","wasInitialized","ua","disablePinning","defaultChr","defaultStart","defaultEnd","restoreStatus","statusRestored","injectionPoint","Element","browserHolderHolder","getElementById","tabIndex","maxHeight","pinnedTierHolder","tierHolder","makeLoader","locSingleBase","locSingleBaseHolder","minFloor","maxFloor","zoomSliderDict","loc","createTextNode","tierHolderHolder","bhtmlRoot","disablePoweredBy","ruler","ruler2","chainConfigs","promisedWorkers","pw","all","nextWorker","getComputedStyle","getBoundingClientRect","realInit2","pollInterval","setInterval","clearInterval","_this","scale","zoomMax","wheelDeltaX","delta","move","wheelDeltaY","scrollTop","axis","detail","touchStartHandler","touchMoveHandler","touchEndHandler","touchCancelHandler","keyHandler","layoutsChanged","wantedLayoutHeight","layoutHeight","clipTier","arrangeTiers","newZoom","check","scrollArrowKey","shiftKey","tt","forceHeight","subtiers","height","mergeConfig","ctrlKey","metaKey","th","tq","quant","qmin","qmax","qscale","notify","altKey","contiguous","mt","si","ip","withPreservedSelection","_ensureTiersGrouped","markSelectedTiers","notifyTierSelection","reorderTiers","notifyTier","nst","top","row","offsetTop","bottom","offsetHeight","notifyTierSelectionWrap","it","discontig","infoVisible","infoElement","updateHeight","bumpStatus","collapseSuperGroups","bumped","mergeSelectedTiers","addTier","pinned","hPopupHolder","body","source","restoredConfigs","disabled","makeTier","refreshTier","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","_source","_createSources","createSources","onFirstRender","firstRenderPromise","ss","getSequenceSource","getSeqInfo","queryRegistry","hi","hc","hub","tdb","genome","genomes","ucscName","altLabel","fullScreen","setFullScreenHeight","setLocation","touchOriginX","touches","pageX","touchOriginY","pageY","sep","abs","zooming","zoomLastSep","zoomInitialSep","zoomInitialScale","touchX","touchY","cp","scp","getRenderer","drawTier","realMakeTier","stack","background","oorigin","dragOrigin","dragMoveOrigin","hoverTimeout","isDragging","featureLookup","padding","glyphCacheOrigin","dragMoveHandler","clientX","dragUpHandler","viewport","clientY","br","left","cursor","notifyFeatureHover","doubleClickTimeout","featureDoubleClick","notifyFeature","sequenceSource","notifyRegionSelect","removeButton","removeTier","nameButton","hitTier","bumpButton","dragLabel","dragTierHolder","dragTierHolderScrollLimit","tierOrdinal","yAtLastReorder","tiersWereReordered","labelDragHandler","scrollHeight","cloneNode","visibility","holderBCR","pty","ttr","tix","labelReleaseHandler","init","updatedTier","currentlyHeight","updateLabel","_updateFromConfig","hasPinned","pinnedTiers","unpinnedTiers","visible","xi","tierCallback","getTierRenderer","renderCallback","renderTier","knownSpace","invalidate","down","groupedTiers","tierGroup","pusho","newTiers","reverse","nt","nti","arrangedTiers","element","parentNode","setBackground","refresh","retrieveTierData","drawOverlays","notifyLocation","minExtraW","maxExtraW","newOrigin","oh","scaleAtLastRedraw","od","originHaxx","scaledQuantRes","innerDrawnStart","innerDrawnEnd","outerDrawnStart","outerDrawnEnd","cancel","KnownSpace","seg","bestCacheOverlapping","drawnStart","drawnEnd","retrieveFeatures","tryCache","coords","cacheHash","cacheTime","localStorage","JSON","cacheAge","rex","rurl","DASRegistry","scoords","taxon","auth","stringify","soft","wid","nStart","nEnd","oz","nz","factor","viewCenter","len","spaceCheck","dontRefresh","skipRefresh","oldFPW","viewWidth","nve","innerHeight","conf","force","target","targetTier","featureCache","removeAllTiers","_sequenceSource","_getSequenceSource","provides_entrypoints","tier_type","twoBitURI","twoBitBlob","TwoBitSequenceSource","ensemblURI","EnsemblSequenceSource","DASSequenceSource","newChr","newMin","newMax","oldNewMin","_setLocation","findChr","altChr","si2","newChrInfo","chrChanged","newWidth","csm","newScale","oldScale","scaleChanged","newZS","oldZS","viewportHolder","overlay","difToActive","difToSaved","norigin","drawOverlay","instrumentActivity","activityStartTime","setCenterLocation","newCenterLoc","halfWidth","pingActivity","activity","loaderButton","addInitListener","handler","removeFeatureListener","idx","arrayIndexOf","fli","ex","addFeatureHoverListener","removeFeatureHoverListener","removeViewListener","nvs","lli","removeTierListener","tli","addRegionSelectListener","removeRegionSelectListener","rli","highlightRegion","_highlightRegion","h","visStart","visEnd","featuresInRegion","fl","currentFeatures","button","browserMid","removeTierSelectionListener","removeTierSelectionWrapListener","right","borderWidth","borderRightWidth","centreOffset","offsetWidth","quantOverlay","fstart","fwidth","newMid","zoomForScale","ssScale","zoomForCurrentScale","tierTotal","currentHeight","fedge","mid","findNextFeature","nxt","nmin","nmax","newStart","newEnd","alert","primary","ucsc","devicePixelRatio","canFetchPlainHTTP","_plainHTTPPromise","getWorker","postCommand","command","uri","registerResolver","transfer","get","scb","configs","put","./browser-ui","./chainset","./default-renderer","./domui","./dummy-renderer","./feature-popup","./kspace","./multi-renderer","./search","./sourcecompare","./sub-renderer","./thub","./tier","./tier-actions","./track-adder","./version","7","srcTag","destTag","chainsBySrc","chainsByDest","postFetchQueues","fetchedTiles","granularity","chainFetcher","BBIChainFetcher","AliasChainFetcher","DASChainFetcher","DASSource","pi","cleanChr","bbiFeatureToChain","chain","srcChr","srcChrom","srcMin","srcStart","srcMax","srcEnd","srcOri","destChr","destMin","destMax","destOri","ori","blocks","srcStarts","destStarts","blockLengths","blockLens","forwardAliases","sequenceAliases","ai","al","DASSegment","parseCigar","exportConfig","mapPoint","ci","cpos","bSrc","bDest","bSize","dpos","apos","flipped","mapSegment","mappings","cmin","cmax","partialMax","partialMin","unmapPoint","sourceBlocksForRange","STATE_PENDING","STATE_FETCHED","thisCS","minTile","maxTile","needsNewOrPending","needsNewFetch","tn","fetchChains","cbs","present","oci","oc","cbd","pfq","srcBlocks","amin","amax","_min","_max","alignments","aligns","aln","srcSeg","destSeg","segments","objects","object","dbSource","accession","strand","srcops","destops","srcOffset","destOffset","srci","desti","op","blockLen","resp","./bigwig","./cigar","8","match","cigops","CIGAR_REGEXP","count","9","DColour","red","green","blue","hex2","y","dasColourForName","palette","COLOR_RE","CSS_COLOR_RE","black","makeColourSteps","steps","stops","colours","dcolours","grad","STEP_LOOP","rs","ca","fill","toSvgString","makeGradient","color1","color2","color3","toHexString","yellow","white","gray","grey","lightskyblue","lightsalmon","hotpink","10","description","a1","a2","options","props","dasBaseURI","DASCoords","coordsMatch","DASSequence","alpha","alphabet","DASLink","desc","DASAlignment","styles","parseGradient","getAttribute","colors","se","getElementsByTagName","stop","nodeValue","elementValue","children","childNodes","ni","childElementOf","hasChildNodes","child","Node","ELEMENT_NODE","nextSibling","dasLinksOf","links","Array","maybeLinkChilden","linkXML","dasNotesOf","maybeNotes","doCrossDomainRequest","custAuth","XDomainRequest","onload","dom","ActiveXObject","async","loadXML","ontimeout","responseXML","isDasBooleanTrue","toLowerCase","isDasBooleanNotFalse","copyStylesheet","nss","sh","_methodRE","_labelRE","_typeRE","_gradient","isBounded","toDASQuery","getURI","dasURI","segs","segMin","segMax","segId","segSize","segDesc","sequence","seqs","segAlpha","segSeq","rawSeq","space","toUpperCase","features_uri","filters","adjacent","adj","maxbins","join","msg","segmentMap","segmentXML","segmentID","featureXMLs","dasFeature","spos","epos","tec","te","typeId","typeCv","method","groupXML","dasGroup","pec","parts","parents","aliXMLs","aliXML","ali","objXMLs","oi","objXML","dbVersion","blockXMLs","blockXML","order","segXMLs","segXML","styleHolder","successCB","failureCB","creds","stylesheet_uri","typeXMLs","typeStyle","glyphXMLs","glyphXML","localName","failure","quri","sourceXMLs","sourceXML","versionXMLs","versionXML","coordXMLs","coordXML","coord","caps","capXMLs","capXML","fep","propXMLs","source_uri","capabilities","errHandler","xUser","btoa","xPass","./color","11","_interopRequireWildcard","__esModule","newObj","Object","hasOwnProperty","updateStatus","canvas","getContext","currentSequence","_sequenceDraw","drawSeqTier","prepareSubtiers","vOffset","R","defaultTo","prepareViewport","paint","restore","drawCallback","glyphsForGroup","groupElement","gstyle","styleForFeature","labelWanted","_das","glyphForFeature","connector","labelText","LABELS","g1","g2","zindex","groupGlyph","Glyphs","GroupGlyph","LabelledGlyph","bump","noLabel","glyphType","hideSubpixelGlyphs","minPos","rawMaxPos","maxPos","glyphHolder","featureToCrossLikeGlyph","_glyphHolder","_slicedToArray","_featureToGradientLik","featureToGradientLikeGlyph","_featureToGradientLik2","PaddedGlyph","parallel","PARALLEL","sw","SOUTHWEST","NORTHEAST","ArrowGlyph","stroke","AArrowGlyph","_stroke","SpanGlyph","_stroke2","lineStyle","STYLE","LineGlyph","_stroke3","_fill","PrimersGlyph","string","STRING","_fill2","TextGlyph","_stroke4","_fill3","TooManyGlyph","_featureToPointGlyph","featureToPointGlyph","_featureToPointGlyph2","sequenceGlyph","insertionLabels","__INSERTIONS","TriangleGlyph","insertion","altAlleles","_stroke5","_fill4","bg","BoxGlyph","_stroke6","_fill5","BGITEM","_scale","tags","refSeq","getRefSeq","AminoAcidGlyph","forceLabel","groupFeatures","gbsFeatures","gbsStyles","stackedFeatures","_utils","ungroupedFeatures","concat","makeStackedBars","gbs","gf","lineGraphGlyphs","makeLinePlot","glyphifyGroups","groupIds","keys","groupedFeatures","groupGlyphs","gId","bumpSubtiers","grid","gridOffset","gridSpacing","subtierMax","subtiersExceeded","unbumpedST","_featureDraw","SubTier","bumpedSTs","glyphTier","find","hasSpaceFor","subtier","unshift","GridGlyph","arguments","MIN_PADDING","scaleVertical","_loop","sgId","sgGroup","superGroups","isSuperGroup","featuresByType","sgMin","sgMax","sgSeg","groupedFeature","template","_spans","mergedRanges","range","posCoverage","actCoverage","newFeature","visualWeight","superGroup","sgGlyphs","gGlyphs","_bumpSubtiers","_bumpSubtiers2","drawUnmapped","drawStart","drawEnd","unmappedBlocks","knownCoverage","knownRanges","fillStyle","fillRect","clearViewport","clearRect","clear","desiredWidth","fpw","lh","canvasHeight","save","overlayLabelCanvas","OverlayLabelCanvas","translate","paintToContext","getScoreMinMax","smin","quantMin","smax","quantMax","relScoreOrigin","relScore","relOrigin","csStart","csEnd","sfMin","sfMax","requiredHeight","outline","STROKECOLOR","COLOR_BY_SCORE2","BGGRAD","_color","COLOR3","score2","smin2","MIN2","smax2","MAX2","relScore2","clamp","SIZE","RSIZE","STROKETHRESHOLD","ExGlyph","DIRECTION","LINEWIDTH","DotGlyph","PlimsollGlyph","points","POINTS","StarGlyph","CrossGlyph","boxGlyph","SCATTER","_getScoreMinMax","_getScoreMinMax2","_relScoreOrigin","_relScoreOrigin2","originShift","heightFudge","featureLabel","textHeight","TranslatedGlyph","centerOnAxis","_getScoreMinMax3","_getScoreMinMax4","AUTOMIN","currentFeaturesMinScore","AUTOMAX","currentFeaturesMaxScore","tmin","tmax","_relScoreOrigin3","_relScoreOrigin4","ALPHA","_grad","tempGlyph","_getScoreMinMax5","_getScoreMinMax6","yscale","sc","PointGlyph","rawseq","rawquals","indels","ops","_cigar","co","repeat","inseq","ig","__SEQCOLOR","mismatchSeq","strandColor","_minusColor","_plusColor","__disableQuals","SequenceGlyph","__CLEARBG","yshift","prevSign","curSign","curGlyphPoints","glyphSequences","prevPoint","px","ADDITIVE","POSCOLOR","NEGCOLOR","py","lggs","gs","lgg","LineGraphGlyph","posStacks","negStacks","stackOrigin","relScoreEnd","relScoreStart","relScoreMax","relScoreMin","createQuantOverlay","tics","w","ticSpacing","ticInterval","globalAlpha","strokeStyle","lineWidth","beginPath","moveTo","lineTo","ty","_t","_ty","textAlign","fillText","_numformats","_t2","_ty2","_t3","_ty3","defineProperty","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","isArray","TypeError","_glyphs","_ramda","./cigar.js","./color.js","./das.js","./feature-draw.js","./glyphs.js","./sequence-draw.js","./spans.js","./utils.js","ramda","12","makeTreeTableSection","update","ttButton","heading","popupHolder","ele","text","_outlistener","isin","timer","setup","mx","scrollX","my","scrollY","ttt","popup","_moveHandler","offsetParent","popit","documentElement","scrollLeft","winWidth","innerWidth","position","maxWidth","closeButton","innerHTML","dragOX","dragOY","moveHandler","_upHandler","tbar","paddingLeft","paddingRight","popupHandle","13","_defaultRenderer","14","lookupEncodeURI","json","accept","EncodeURLHolder","rawurl","EncodeFetchable","getURLPromise","urlPromise","urlPromiseValidity","15","EnsemblFeatureSource","FeatureSourceBase","base","species","dalliance_registerSourceAdapterFactory","registerSourceAdapterFactory","create","cdsStyle","varStyle","getScales","types","pool","busy","notifyActivity","jr","jf","feature_type","ID","Parent","consequence_type","alt_alleles","query","seq_region_name","16","exportFullConfig","exportSourceConfig","exportChains","sourceConfig","noPersist","forceMin","forceMinDynamic","forceMax","forceMaxDynamic","exportPageTemplate","17","fillTextRightJustified","measureText","drawSeqTierGC","exportImage","ypos","banner","region","backupFPW","backupScale","totHeight","backupSubtiers","backupOriginHaxx","backupLayoutHeight","mult","resolutionMultiplier","cw","font","closePath","clip","draw","hasQuant","numTics","strokeWidth","labelName","labelWidth","rulerPos","toDataURL","./glyphs","./sequence-draw","18","exportForm","exportSelect","exportContent","setupEOT","exportHighlightsToggle","exportRulerToggle","exportRegionToggle","exportBannerToggle","exportScale","exportWidth","exportButton","blobURL","note","makeSVG","page","downloadLink","download","previewLink","eotHighlights","eotGuideline","eotScale","eotWidth","eotRegion","eotBanner","exportOptsTable","es","insertBefore","19","chainset","dalliance_makeParser","makeParser","Ruler","rulerDrawCallback","./rulers","babel-polyfill","20","indexFor","gmin","ub","mg","ind","gc","zeroLine","ctx","maybe","labelRE","methodRE","typeRE","softMin","SOFTMIN","Number","MAX_VALUE","MIN","softMax","SOFTMAX","MIN_VALUE","MAX","21","FeatureInfo","pick","fid","molgenis","sections","maybeConcat","pushnew","TAGVAL_NOTE_RE","addFeatureInfoPlugin","featureInfoPlugins","setTitle","info","__ignored_feature","featureInfo","fips","fipi","table","suppressMethod","minWidth","suppressScore","fisi","section","actions","action","actionItem","eval","run","22","sortFeatures","minScore","fbid","dmin","dmax","drawnGroupedFeatures","groupMins","groupMaxes","groupsToSupers","nonPositional","init_fbid","superParentsOf","spids","pid","drawn","fGroups","fSuperGroup","gid","ogm","pushnewo","sgs","sp","23","PathGlyphBase","radius","_width","_height","_alpha","_radius","covList","coverage","GLOBAL_GC","unmeasured","anchor","metrics","textLen","measured","_x","_dir","minp","maxp","_ori","_style","_strand","_parallel","_sw","_ne","_string","_textLen","aminoTileColor","aa","tileColors","ALTERNATE_COLOR","purple","reverseComplement","seq_dict","rev_seq","rev_compl_seq","_seq","_orientation","_readframe","scheme","fillbg","_strandColor","_ref","_scheme","_quals","_fillbg","_scaleVertical","_y","yOffset","spacing","_r","_points","overhang","_overhang","_hh","ox","oy","makeElementNS","AMINO_ACID_TRANSLATION","svgu","NS_SVG","SVGPath","NS_XLINK","drawPath","toSVG","toPathData","arcTo","strokeRect","drawConnectors","gl","last","pathData","transform","fontSize","registerGlyph","minVisible","maxVisible","hh","hw","arc","cx","cy","lInset","rInset","minLength","instep","setLineDash","drawStemPath","drawTrigsPath","prevOverhang","nextOverhang","leftOverhang","codon","isRetina","__dalliance_SequenceGlyphCache","altPattern","isCloseUp","alphaForQual","qual","mismatch","qc","oldAlpha","refBase","alt","img","createElement","imgGc","dy","drawImage","fillOpacity","textAnchor","midX","midY","theta","sin","cos","x1","y1","x2","y2","./svg-utils","24","JBrowseStore","jbori","subfeatures","uniqueID","cds","sj","sf","txGroup","exon","tlGroup","cdsExon","25","FetchPool","reqs","awaitedFeatures","requestsIssued","notifyRequestsIssued","KSCacheBaton","tierMap","seqSource","DummySequenceSource","viewCount","latestViews","filterFeatures","ff","featuresByGroup","gmax","MappedFeatureSource","CachingFeatureSource","BWGFeatureSource","RemoteBWGFeatureSource","BAMFeatureSource","RemoteBAMFeatureSource","DummyFeatureSource","OverlayFeatureSource","sample","downsample","getBaseCoverage","addRequest","xhr","abortAll","cancelled","baton","awaitedSeq","seqWasFetched","startFetchesForTiers","gex","needSeq","tierRenderer","startFetchesFor","wasRendered","cachedSeq","provide","wantedTypes","viewID","getSource","needsSeq","needsSequence","styleFilters","getActiveStyleFilters","typeList","cachedFeatures","provision","availableScales","latestViewID","actualScale","setFeatures","mayDownsample","needBaseComposition","isPrototypeOf","forceReduction","noDownsample","await","./overlay","./sample","26","Vob","allowZero","bint","lim","oBlockList","ptr","totalSize","xlen","out","reg2bin","beg","list","27","MemStore","featuresByChr","maxLength","chrRing","MemStoreFeatureSource","storeHolder","payload","_load","store","lines","session","li","addFeatures","dirty","f1","f2","_indexFor","mini","maxi","chrInd","readAsText","getDefaultFIPs","28","MolgenisFeatureSource","entity","random","setStyleProperties","track_type","altAttr","genome_attrs","refAttr","labelAttr","label_attr","exon_key","attrs","attributes","attr","attrArray","encodeURIComponent","items","identifier","score_attr","29","multiTier","multiConfig","getSubConfig","multi_id","minOffset","pipe","reduce","acc","flatten","Infinity","t1","t2","grid_offset","grid_spacing","quantCanvas","30","dot","dotThreshold","31","activityListeners","readinessListeners","changeListeners","business","readiness","initN","merge","OverlayFeatureSource_merge_concat","filterDispatchOnMethod","OverlayFeatureSource_merge_byKey","OverlayBaton","returnCount","statusCount","returns","statuses","featureSets","omaps","fsi","om","of","keyForFeature","mf","fs","_sourceAdapterIsCapable","cap","addActivityListener","addChangeListener","notifyChange","addReadinessListener","notifyReadiness","notifyReadinessListener","removeReadinessListener","removeActivityListener","listener","removeChangeListener","s0","sfl","fetchN","completed","quantFindNextFeature","32","probeResource","retry","fetchable","BED_REGEXP","KV_REGEXP","VCFHEAD_RE","transport","nameExtractPattern","TABIX_MAGIC","apply","maybeType","finishProbeBedWig","tbi","./bam","./encode","./tabix","33","rulers","rulerY","oldLineWidth","34","ds_scale","__DS_SCALES","pow","DSBin","tot","hasScore","_featureOrder","targetRez","sn","binTots","maxBin","minBin","minLap","maxLap","bm","sampledFeatures","BaseBin","_pos","_bases","_totalCount","alignSeqUsingCigar","processedSeq","currentRefSeq","allBins","minForFeature","maxForFeature","charAt","recordBase","baseFeatures","infoList","refString","baseScoreList","fBase","maxSeen","cov","lap","lMin","lMax","baseComposition","totalQual","strandCnt","strandComposition","+","totalCount","totalCountStr","baseCnt","basePercentage","plusStrandCnt","minusStrandCnt","meanQual","baseInfoString","toFixed","minCount","baseCount","baseScorePair","35","_toConsumableArray","arr2","from","parseLocCardinal","connectTrix","REGION_PATTERN","statusCallback","srPadding","searchCount","foundLatch","searchCallback","found","nchr","doTrixSearch","trix","searchEndpoint","doDasSearch","searchSources","trixURI","ix","ixx","trixxURI","provides_search","found2","./trix","36","tileSizeForScale","MIN_TILE","knownStart","knownEnd","seqTierMax","tile","svgSeqTier","37","nukeStatus","noPersistView","currentSourceList","coveredHubURLs","currentHubList","CONFIG","storedConfigVersion","storedConfigHash","pageConfigHash","defaultSourcesByURI","ul","qChr","qMin","qMax","sz","rks","sbh","rl","sourceStr","storedSources","osi","oldSource","hubStr","38","rstr2hex","rstr_sha1","str2rstr_utf8","rstr2b64","binb2rstr","binb_sha1","rstr2binb","input","hex_tab","hexcase","output","tab","triplet","b64pad","olda","oldb","oldc","oldd","olde","bit_rol","safe_add","sha1_ft","sha1_kt","lsw","msw","num","39","factory","__dalliance_sourceAdapterFactories","__dalliance_parserFactories","cfsid","__cfs_id_seed","DASFeatureSource","awaitedEntryPoints","ep","twoBit","makeTwoBit","tb","bwgSource","bwgHolder","preflight","pfs","bwg_preflights","keyHolder","resolverKey","bamRecordToFeature","bamRecord","bamSource","bamGroup","bamHolder","JBrowseFeatureSource","jbURI","jbQuery","resolveUrlToPage","StyleFilterSet","initSources","thisTier","saf","bwgURI","bwgBlob","bamURI","bamBlob","fetchStylesheet","ssSource","cacheKey","started","doesNotContain","addAll","af","defStyle","dasStaticFeatures","cachedStaticFeatures","cachedStaticScale","tryMaxBins","fops","retScale","dasAdjLock","getDesiredTypes","epi","getSeq","arg","ei","extraIndices","quantLeap","eii","wantDensity","clientBin","scaleFactor","is","link","scales","noExtraFeatureInfo","fip","geneHint","connection","meta","under","bamF","baiF","baiBlob","baiURI","bamRecords","ri","indexUri","indexBlob","simplifySegments","minGap","s1","s2","ssegs","currentSeg","fetchLength","mseg","finalStatus","mappedFeatures","mappedLoc","fscale","mi","m1","m2","segDestCoverage","./bedwig","./ensembljson","./jbjson","./memstore","./molgenisjson","./style","./tabix-source","./test-source","./twoBit","./vcf","40","41","_Compound","sorted","_rangeOrder","merged","shift","_ranges","insertRange","r0","r1","l0","l1","i0","i1","or","lapMin","lapMax","rangeOrder","isContiguous","_pushRanges","lower_bound","floor","rangeOver","42","StyleFilter","_filters","equals","_list","filterSet","43","44","saveDoc","implementation","createDocument","saveRoot","fontFamily","dallianceAnchor","clipRect","tierSVG","clipPath","clipRule","tierLabels","tierTopPos","tierBackground","seqTrack","glyphElements","svg","XMLSerializer","serializeToString","root","outerHTML","45","46","TabixFeatureSource","tabixHolder","indexURI","connectTabix","tabix","fetchHeader","47","TabixFile","unchead","format","colSeq","colStart","colEnd","skip","headerMax","readRecords","canonicalChr","LINE_LOOP","48","_classCallCheck","instance","Constructor","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","enumerable","writable","configurable","setPrototypeOf","__proto__","_createClass","defineProperties","descriptor","protoProps","staticProps","_sourceadapters","TestSource","_FeatureSourceBase","getPrototypeOf","genFeature","./sourceadapters.js","49","TrackHub","TrackHubTrack","TrackHubDB","hubURL","hubFile","THUB_PARSE_REGEXP","genomesFile","genURL","relativeURL","genFile","stanzas","THUB_STANZA_REGEXP","gprops","twoBitPath","trackDb","absURL","THUB_COMPARE","priority","shortLabel","THUB_SUBGROUP_REGEXP","THUB_PENNANT_PREFIX","_parent","getTracks","_tracks","trackFile","tracks","tracksById","track","_db","subgroups","sgtoks","sgtag","sgrecord","titles","sgti","sgm","container","bigDataUrl","toplevels","composites","parent","ptoks","compositeTrack","comp","parentOfViews","toDallianceSource","longLabel","pennantIcon","pennant","searchTrix","aggregate","typeToks","bedTokens","bedPlus","bigbedStyles","bigwigStyles","yLineOnOff","yLineMark","maxHeightPixels","mhpToks","gtype","graphTypeDefault","altColor","cbsToks","plus","minus","tlStyle","50","nsh","51","getSeqStyle","__dalliance_smallGlyphs","DOT","EX","STAR","SQUARE","CROSS","TRIANGLE","PLIMSOLL","setStyleColors","numColors","tierColorField","tierColorField2","tierColorField3","tierPlusColorField","tierMinusColorField","mutateStylesheet","visitor","changeColor","mergeStylesheet","tierForm","aboutBanner","Name","paddingBottom","marginBottom","about","aboutNotes","sduri","semanticBanner","editBanner","tierNameField","tierPinnedToggle","glyphField","tierColorFields","colorListPlus","colorListMinus","colorListElement","setNumColors","tierMinField","tierMaxField","tierMinToggle","tierMaxToggle","quantLeapToggle","quantLeapThreshField","tierHeightField","bumpToggle","bumpLimit","labelToggle","mainStyle","isQuantitative","isSimpleQuantitative","activeStyleCount","minRow","maxRow","bumpRow","labelRow","styleRow","colorRow","setMinValue","setMaxValue","seqStyle","seqMismatchRow","seqMismatchToggle","seqInsertRow","seqInsertToggle","seqIgnoreQualsRow","seqIgnoreQualsToggle","plusStrandColorRow","minusStrandColorRow","quantLeapRow","tierTable","setConfig","updateQuant","currentScale","52","__tier_idSeed","border","minHeight","notifier","notifierHolder","paddingTop","borderRadius","nameElement","classes","styleIdSeed","layoutWasDone","featureInfoPlugin","noSourceFeatureInfo","readinessListener","ready","activityListener","listeners","featuresLoadedListeners","_resolveFirstRenderPromise","setStylesheet","baseStylesheet","baseStylesheetValidity","sfs","sourceConfigNeedsSeq","some","knownChr","notifyFeaturesLoaded","mmin","trySourceFNF","clientHeight","_notifierToStatus","checkedHTTP","can","warnHTTP","notifierFadeTimeout","_notifierOn","opacity","_notifierOff","notifyTierListeners","newStyle","stylesheetValidity","newConfig","needsRefresh","needsReorder","wantedHeight","wantedPinned","wantedSubtierMax","wantedBumped","scheduleRedraw","redrawTimeout","clearTierListeners","change","clearFeaturesLoadedListeners","addFeaturesLoadedListener","removeFeaturesLoadedListener","./feature-draw","./features","53","activateButton","addModeButtons","which","domui","currentlyActive","makeButton","tooltip","regButton","makeHubStab","refreshButton","addButton","canButton","customMode","stabHolder","buttonIdSeed","ttab","trim","tops","buttons","dg","dimensions","dprops","dtoks","dti","dimX","dimY","sgX","sgY","trks","vX","vY","matrix","tableLayout","transformOrigin","webkitTransform","webkitTransformOrigin","mbody","yi","cell","ds","bd","dalliance_source","__mapping","dalliance_mapping","stabBody","stab","buttonId","ld","htmlFor","setChecks","switchToBinMode","binButton","pageHolder","custURL","custFile","multiple","switchToHubConnectMode","addHubButton","switchToCustomMode","custButton","customForm","doAdd","curi","nds","tryAddDAS","fileList","files","tryAddMultiple","lcuri","tryAddBin","dataToFinalize","completeBAM","promptForBAI","completeTabixVCF","promptForTabix","custName","custCS","custQuant","custUser","custPass","tryAddHub","multipleSet","hidden","makeSourceConfig","bestHub","bestHubButton","okay","hubButton","makeHubButton","modeButtonHolder","tryAddDASxSources","sqfail","addDasCompletionPage","coordsDetermined","quantDetermined","indexF","hasBAI","magic2","binFormatErrorPage","hasTabix","makeStab","makeStabObserver","mm","mapButton","groupedDefaults","hubMenuButton","hbContent","loader","marginTop","removeHubItem","allOnItem","allOffItem","hubMenu","clickCatcher","firstDefButton","firstDefSources","defButton","asform","overflow","__sourceHolder","msources","removeListener","addListenerAndFire","cors","tsm","testSegment","tabError","quantIrrelevant","csk","newSources","probeMultiple","updateMultipleStatus","usedIndices","bams","tabixes","baiPattern","tbiPattern","needsIndex","multTable","typeContent","ccs","state","indexFile","buttonHolder","./probe","54","ixxData","offsets","TrixIndex","ixslice","qtag","ist","55","TwoBitFile","headerBlockSize","HEADER_BLOCK_SIZE","headerBlocksFetched","TWOBIT_MAGIC","TWOBIT_MAGIC_BE","seqCount","seqDict","parseSeqInfo","TwoBitSeq","tbf","seqOffset","_length","nBlockCnt","r2","nbs","nbMin","nbLen","nb","nBlocks","mBlockCnt","TWOBIT_TABLE","fillSeq","fsm","bb","bv","seqData","seqstr","nSpans","intr","56","arrayRemove","attribs","namespace","createElementNS","setAttrs","setAttr","attr_name_cache","_attr","lcc","exc","queue","saltURL","__dalliance_saltSeed","lastIndexOf","addListener","TTT","TTC","TTA","TTG","CTT","CTC","CTA","CTG","ATT","ATC","ATA","ATG","GTT","GTC","GTA","GTG","TCT","TCC","TCA","TCG","CCT","CCC","CCA","CCG","ACT","ACC","ACA","ACG","GCT","GCC","GCA","GCG","TAT","TAC","TAA","TAG","CAT","CAC","CAA","CAG","AAT","AAC","AAA","AAG","GAT","GAC","GAA","GAG","TGT","TGC","TGA","TGG","CGT","CGC","CGA","CGG","AGT","AGC","AGA","AGG","GGT","GGC","GGA","GGG","57","VCFParser","VCFParseSession","VCF_INFO_RE","VCF_INFO_HEADER","VCF_INFO_HEADER_TOK","refAllele","infoToks","val","58","MAJOR","MINOR","MICRO","BRANCH","vs","PATCH","59","setPos","np","thumb","setPos2","pos2","thumb2","labels","slider","txt","onChange","createEvent","initEvent","thumbMouseDown","dispatchEvent","thumbDragHandler","thumbDragEndHandler","60","global","define","O","DEFINE_PROPERTY","_babelPolyfill","padStart","padEnd","Function","core-js/fn/regexp/escape","core-js/shim","regenerator-runtime/runtime","61","escape","../../modules/_core","../../modules/core.regexp.escape","62","63","cof","./_cof","64","UNSCOPABLES","ArrayProto","./_hide","./_wks","65","forbiddenField","66","isObject","./_is-object","67","toObject","toAbsoluteIndex","toLength","copyWithin","to","inc","./_to-absolute-index","./_to-length","./_to-object","68","aLen","endPos","69","forOf","iter","ITERATOR","./_for-of","70","toIObject","IS_INCLUDES","$this","el","fromIndex","./_to-iobject","71","IObject","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","callbackfn","that","./_array-species-create","./_ctx","./_iobject","72","aFunction","memo","isRight","./_a-function","73","SPECIES","original","./_is-array","74","speciesConstructor","./_array-species-constructor","75","invoke","arraySlice","factories","construct","F","args","fn","partArgs","bound","./_invoke","76","ARG","tryGet","B","callee","77","78","dP","redefineAll","anInstance","$iterDefine","setSpecies","DESCRIPTORS","fastKey","validate","getEntry","entry","_f","getConstructor","wrapper","NAME","ADDER","iterable","_l","delete","prev","has","def","setStrong","iterated","kind","_k","./_an-instance","./_descriptors","./_iter-define","./_iter-step","./_meta","./_object-create","./_object-dp","./_redefine-all","./_set-species","./_validate-collection","79","classof","./_array-from-iterable","./_classof","80","getWeak","anObject","createArrayMethod","$has","arrayFind","arrayFindIndex","uncaughtFrozenStore","UncaughtFrozenStore","findUncaughtFrozen","ufstore","./_an-object","./_array-methods","./_has","81","$export","redefine","fails","$iterDetect","setToStringTag","inheritIfRequired","methods","common","IS_WEAK","Base","fixMethod","KEY","entries","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","NEED","W","./_export","./_fails","./_global","./_inherit-if-required","./_iter-detect","./_redefine","./_set-to-string-tag","82","core","__e","83","$defineProperty","createDesc","./_property-desc","84","85","getTime","$toISOString","toISOString","lz","NaN","isFinite","RangeError","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","86","toPrimitive","NUMBER","hint","./_to-primitive","87","88","89","90","91","getKeys","gOPS","pIE","getSymbols","symbols","isEnum","./_object-gops","./_object-keys","./_object-pie","92","hide","PROTOTYPE","own","IS_FORCED","IS_GLOBAL","IS_STATIC","S","IS_PROTO","P","IS_BIND","expProto","U","./_core","93","MATCH","re","94","95","defined","wks","SYMBOL","fns","strfn","rxfn","./_defined","96","ignoreCase","multiline","unicode","sticky","97","flattenIntoArray","sourceLen","depth","mapper","thisArg","spreadable","targetIndex","sourceIndex","mapFn","IS_CONCAT_SPREADABLE","98","isArrayIter","getIterFn","BREAK","RETURN","iterFn","./_is-array-iter","./_iter-call","./core.get-iterator-method","99","__g","100","101","102","103","./_dom-create","104","./_set-proto","105","un","106","propertyIsEnumerable","107","Iterators","./_iterators","108","109","110","111","isRegExp","112","ret","113","IteratorPrototype","114","LIBRARY","$iterCreate","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","DEFAULT","IS_SET","FORCED","getMethod","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","values","./_iter-create","./_library","./_object-gpo","115","SAFE_CLOSING","riter","skipClosing","safe","116","117","118","119","$expm1","expm1","120","sign","EPSILON","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","./_math-sign","121","log1p","122","inLow","inHigh","outLow","outHigh","123","124","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","onFreeze","./_uid","125","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","keyMetadata","ordinaryHasOwnMetadata","MetadataKey","metadataMap","ordinaryGetOwnMetadata","ordinaryDefineOwnMetadata","MetadataValue","ordinaryOwnMetadataKeys","_","toMetaKey","./_shared","./es6.map","./es6.weak-map","126","macrotask","Observer","MutationObserver","WebKitMutationObserver","process","isNode","domain","exit","enter","nextTick","toggle","observe","characterData","promise","task","./_task","127","PromiseCapability","$$resolve","$$reject","128","$assign","assign","K","129","dPs","enumBugKeys","IE_PROTO","Empty","createDict","iframeDocument","iframe","lt","gt","contentWindow","write","close","Properties","./_enum-bug-keys","./_html","./_object-dps","./_shared-key","130","IE8_DOM_DEFINE","Attributes","./_ie8-dom-define","131","132","__defineSetter__","133","gOPD","getOwnPropertyDescriptor","134","gOPN","windowNames","getOwnPropertyNames","getWindowNames","./_object-gopn","135","$keys","hiddenKeys","./_object-keys-internal","136","getOwnPropertySymbols","137","ObjectProto","138","names","./_array-includes","139","140","141","142","isEntries","143","Reflect","ownKeys","144","$parseFloat","$trim","str","./_string-trim","./_string-ws","145","$parseInt","ws","hex","radix","146","147","newPromiseCapability","promiseCapability","./_new-promise-capability","148","bitmap","149","150","SRC","TO_STRING","$toString","TPL","inspectSource","isFunction","151","regExp","replacer","part","152","153","COLLECTION","nextItem","154","155","buggy","./_object-gopd","156","157","stat","158","uid","159","SHARED","160","D","161","162","toInteger","./_to-integer","163","searchString","./_is-regexp","164","quot","createHTML","attribute","p1","165","fillString","stringLength","fillStr","intMaxLength","fillLen","stringFiller","ceil","./_string-repeat","166","167","spaces","non","ltrim","rtrim","exporter","ALIAS","FORCE","168","169","defer","channel","html","cel","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","ONREADYSTATECHANGE","event","port2","port1","importScripts","170","171","number","172","173","174","175","176","valueOf","177","$typed","$buffer","propertyDesc","toIndex","createArrayIncludes","ArrayIterators","arrayFill","arrayCopyWithin","$DP","$GOPD","ARRAY_BUFFER","SHARED_BUFFER","BYTES_PER_ELEMENT","$ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayIncludes","arrayValues","arrayKeys","arrayEntries","arrayLastIndexOf","arrayReduce","arrayReduceRight","reduceRight","arrayJoin","arraySort","arrayToString","arrayToLocaleString","toLocaleString","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","WRONG_LENGTH","$map","allocate","LITTLE_ENDIAN","FORCED_SET","toOffset","BYTES","speciesFromList","fromList","addGetter","internal","$from","mapfn","$of","TO_LOCALE_BUG","$toLocaleString","every","predicate","findIndex","searchElement","includes","separator","middle","comparefn","subarray","begin","$begin","byteOffset","$slice","$set","arrayLike","$iterators","isTAIndex","$getDesc","$setDesc","$TypedArrayPrototype$","CLAMPED","GETTER","SETTER","TypedArray","ABV","TypedArrayPrototype","getter","setter","addElement","$offset","$length","klass","$len","$nativeIterator","CORRECT_ITER_NAME","$iterator","./_array-copy-within","./_array-fill","./_species-constructor","./_to-index","./_typed","./_typed-buffer","./es6.array.iterator","178","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","LN2","unpackIEEE754","nBits","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","isLittleEndian","numIndex","intIndex","$LENGTH","WRONG_INDEX","$BUFFER","_b","$OFFSET","pack","conversion","DATA_VIEW","BaseBuffer","BUFFER","BYTE_LENGTH","BYTE_OFFSET","ArrayBufferProto","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","179","Typed","TypedArrayConstructors","180","181","182","wksExt","$Symbol","./_wks-ext","183","184","USE_SYMBOL","$exports","185","getIteratorMethod","186","$re","./_replacer","187","./_add-to-unscopables","188","$every","./_strict-method","189","190","$filter","191","$find","forced","192","193","$forEach","STRICT","194","createProperty","./_create-property","195","$indexOf","NEGATIVE_ZERO","196","197","addToUnscopables","Arguments","198","199","200","201","202","$reduce","./_array-reduce","203","204","upTo","cloned","205","$some","206","$sort","207","208","209","./_date-to-iso-string","210","toJSON","pv","211","TO_PRIMITIVE","./_date-to-primitive","212","DateProto","INVALID_DATE","213","./_bind","214","HAS_INSTANCE","FunctionProto","215","FProto","nameRE","216","strong","MAP","./_collection","./_collection-strong","217","sqrt","$acosh","acosh","./_math-log1p","218","asinh","$asinh","219","$atanh","atanh","220","cbrt","221","clz32","LOG2E","222","cosh","223","./_math-expm1","224","./_math-fround","225","hypot","value1","div","sum","larg","226","$imul","imul","UINT16","xn","yn","xl","yl","227","log10","LOG10E","228","229","log2","230","231","sinh","E","232","tanh","233","trunc","234","$Number","BROKEN_COF","TRIM","toNumber","argument","third","maxCode","first","digits","235","236","_isFinite","237","isInteger","./_is-integer","238","239","isSafeInteger","240","MAX_SAFE_INTEGER","241","MIN_SAFE_INTEGER","242","./_parse-float","243","./_parse-int","244","aNumberValue","$toFixed","ERROR","ZERO","multiply","divide","numToString","fractionDigits","./_a-number-value","245","$fails","$toPrecision","toPrecision","precision","246","./_object-assign","247","248","249","250","$freeze","./_object-sap","251","$getOwnPropertyDescriptor","252","./_object-gopn-ext","253","$getPrototypeOf","254","$isExtensible","255","$isFrozen","256","$isSealed","257","./_same-value","258","259","$preventExtensions","260","$seal","261","262","263","264","265","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","PROMISE","$Promise","empty","USE_NATIVE","FakePromise","PromiseRejectionEvent","isThenable","isReject","_c","_v","ok","reaction","fail","_h","onHandleUnhandled","onUnhandled","unhandled","isUnhandled","emit","onunhandledrejection","reason","_a","onrejectionhandled","$reject","_w","$resolve","executor","onFulfilled","onRejected","catch","capability","remaining","$index","alreadyCalled","race","./_microtask","./_perform","./_promise-resolve","266","rApply","fApply","thisArgument","argumentsList","L","267","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","268","propertyKey","269","deleteProperty","270","Enumerate","enumerate","271","272","getProto","273","receiver","274","275","276","./_own-keys","277","278","setProto","279","V","existingDescriptor","ownDesc","280","$flags","$RegExp","re1","re2","CORRECT_NEW","tiRE","piRE","fiU","proxy","./_flags","281","flags","282","$match","regexp","./_fix-re-wks","283","REPLACE","$replace","searchValue","replaceValue","284","SEARCH","$search","285","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","limit","separator2","lastIndex","lastLength","lastLastIndex","splitLimit","separatorCopy","286","./es6.regexp.flags","287","SET","288","./_string-html","289","290","291","292","$at","codePointAt","./_string-at","293","context","ENDS_WITH","$endsWith","endsWith","endPosition","./_fails-is-regexp","./_string-context","294","295","296","297","$fromCodePoint","fromCodePoint","298","INCLUDES","299","300","point","301","302","raw","callSite","tpl","303","304","305","STARTS_WITH","$startsWith","startsWith","306","307","308","309","310","wksDefine","enumKeys","_create","gOPNExt","$JSON","_stringify","HIDDEN","SymbolRegistry","AllSymbols","OPSymbols","QObject","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","for","keyFor","useSetter","useSimple","$replacer","./_enum-keys","./_wks-define","311","$isView","isView","final","viewS","viewT","312","313","./_typed-array","314","315","316","317","318","319","320","321","322","InternalMap","each","weak","WEAK_MAP","$WeakMap","freeze","./_collection-weak","323","WEAK_SET","324","arraySpeciesCreate","flatMap","./_flatten-into-array","325","depthArg","326","$includes","327","asap","328","isError","329","330","./_set-collection-from","331","./_set-collection-of","332","./_collection-to-json","333","lower","upper","334","DEG_PER_RAD","PI","335","RAD_PER_DEG","degrees","radians","336","./_math-scale","337","iaddh","x0","y0","$x0","$x1","$y0","338","imulh","$u","$v","u0","v0","u1","v1","339","isubh","340","341","342","343","signbit","344","umulh","345","__defineGetter__","./_object-forced-pam","346","347","./_object-to-array","348","getOwnPropertyDescriptors","getDesc","349","__lookupGetter__","350","__lookupSetter__","351","$values","352","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","subscribe","observable","Observable","353","finally","onFinally","354","try","355","metadata","defineMetadata","metadataKey","metadataValue","./_metadata","356","deleteMetadata","357","Set","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","./es6.set","358","ordinaryGetMetadata","hasOwn","getMetadata","359","getOwnMetadataKeys","360","getOwnMetadata","361","ordinaryHasMetadata","hasMetadata","362","hasOwnMetadata","363","$metadata","364","365","366","367","at","368","getFlags","RegExpProto","$RegExpStringIterator","matchAll","369","$pad","./_string-pad","370","371","372","373","374","375","376","377","378","379","380","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","381","$task","382","MSIE","time","boundArgs","383","./modules/_core","./modules/es6.array.copy-within","./modules/es6.array.every","./modules/es6.array.fill","./modules/es6.array.filter","./modules/es6.array.find","./modules/es6.array.find-index","./modules/es6.array.for-each","./modules/es6.array.from","./modules/es6.array.index-of","./modules/es6.array.is-array","./modules/es6.array.iterator","./modules/es6.array.join","./modules/es6.array.last-index-of","./modules/es6.array.map","./modules/es6.array.of","./modules/es6.array.reduce","./modules/es6.array.reduce-right","./modules/es6.array.slice","./modules/es6.array.some","./modules/es6.array.sort","./modules/es6.array.species","./modules/es6.date.now","./modules/es6.date.to-iso-string","./modules/es6.date.to-json","./modules/es6.date.to-primitive","./modules/es6.date.to-string","./modules/es6.function.bind","./modules/es6.function.has-instance","./modules/es6.function.name","./modules/es6.map","./modules/es6.math.acosh","./modules/es6.math.asinh","./modules/es6.math.atanh","./modules/es6.math.cbrt","./modules/es6.math.clz32","./modules/es6.math.cosh","./modules/es6.math.expm1","./modules/es6.math.fround","./modules/es6.math.hypot","./modules/es6.math.imul","./modules/es6.math.log10","./modules/es6.math.log1p","./modules/es6.math.log2","./modules/es6.math.sign","./modules/es6.math.sinh","./modules/es6.math.tanh","./modules/es6.math.trunc","./modules/es6.number.constructor","./modules/es6.number.epsilon","./modules/es6.number.is-finite","./modules/es6.number.is-integer","./modules/es6.number.is-nan","./modules/es6.number.is-safe-integer","./modules/es6.number.max-safe-integer","./modules/es6.number.min-safe-integer","./modules/es6.number.parse-float","./modules/es6.number.parse-int","./modules/es6.number.to-fixed","./modules/es6.number.to-precision","./modules/es6.object.assign","./modules/es6.object.create","./modules/es6.object.define-properties","./modules/es6.object.define-property","./modules/es6.object.freeze","./modules/es6.object.get-own-property-descriptor","./modules/es6.object.get-own-property-names","./modules/es6.object.get-prototype-of","./modules/es6.object.is","./modules/es6.object.is-extensible","./modules/es6.object.is-frozen","./modules/es6.object.is-sealed","./modules/es6.object.keys","./modules/es6.object.prevent-extensions","./modules/es6.object.seal","./modules/es6.object.set-prototype-of","./modules/es6.object.to-string","./modules/es6.parse-float","./modules/es6.parse-int","./modules/es6.promise","./modules/es6.reflect.apply","./modules/es6.reflect.construct","./modules/es6.reflect.define-property","./modules/es6.reflect.delete-property","./modules/es6.reflect.enumerate","./modules/es6.reflect.get","./modules/es6.reflect.get-own-property-descriptor","./modules/es6.reflect.get-prototype-of","./modules/es6.reflect.has","./modules/es6.reflect.is-extensible","./modules/es6.reflect.own-keys","./modules/es6.reflect.prevent-extensions","./modules/es6.reflect.set","./modules/es6.reflect.set-prototype-of","./modules/es6.regexp.constructor","./modules/es6.regexp.flags","./modules/es6.regexp.match","./modules/es6.regexp.replace","./modules/es6.regexp.search","./modules/es6.regexp.split","./modules/es6.regexp.to-string","./modules/es6.set","./modules/es6.string.anchor","./modules/es6.string.big","./modules/es6.string.blink","./modules/es6.string.bold","./modules/es6.string.code-point-at","./modules/es6.string.ends-with","./modules/es6.string.fixed","./modules/es6.string.fontcolor","./modules/es6.string.fontsize","./modules/es6.string.from-code-point","./modules/es6.string.includes","./modules/es6.string.italics","./modules/es6.string.iterator","./modules/es6.string.link","./modules/es6.string.raw","./modules/es6.string.repeat","./modules/es6.string.small","./modules/es6.string.starts-with","./modules/es6.string.strike","./modules/es6.string.sub","./modules/es6.string.sup","./modules/es6.string.trim","./modules/es6.symbol","./modules/es6.typed.array-buffer","./modules/es6.typed.data-view","./modules/es6.typed.float32-array","./modules/es6.typed.float64-array","./modules/es6.typed.int16-array","./modules/es6.typed.int32-array","./modules/es6.typed.int8-array","./modules/es6.typed.uint16-array","./modules/es6.typed.uint32-array","./modules/es6.typed.uint8-array","./modules/es6.typed.uint8-clamped-array","./modules/es6.weak-map","./modules/es6.weak-set","./modules/es7.array.flat-map","./modules/es7.array.flatten","./modules/es7.array.includes","./modules/es7.asap","./modules/es7.error.is-error","./modules/es7.global","./modules/es7.map.from","./modules/es7.map.of","./modules/es7.map.to-json","./modules/es7.math.clamp","./modules/es7.math.deg-per-rad","./modules/es7.math.degrees","./modules/es7.math.fscale","./modules/es7.math.iaddh","./modules/es7.math.imulh","./modules/es7.math.isubh","./modules/es7.math.rad-per-deg","./modules/es7.math.radians","./modules/es7.math.scale","./modules/es7.math.signbit","./modules/es7.math.umulh","./modules/es7.object.define-getter","./modules/es7.object.define-setter","./modules/es7.object.entries","./modules/es7.object.get-own-property-descriptors","./modules/es7.object.lookup-getter","./modules/es7.object.lookup-setter","./modules/es7.object.values","./modules/es7.observable","./modules/es7.promise.finally","./modules/es7.promise.try","./modules/es7.reflect.define-metadata","./modules/es7.reflect.delete-metadata","./modules/es7.reflect.get-metadata","./modules/es7.reflect.get-metadata-keys","./modules/es7.reflect.get-own-metadata","./modules/es7.reflect.get-own-metadata-keys","./modules/es7.reflect.has-metadata","./modules/es7.reflect.has-own-metadata","./modules/es7.reflect.metadata","./modules/es7.set.from","./modules/es7.set.of","./modules/es7.set.to-json","./modules/es7.string.at","./modules/es7.string.match-all","./modules/es7.string.pad-end","./modules/es7.string.pad-start","./modules/es7.string.trim-left","./modules/es7.string.trim-right","./modules/es7.symbol.async-iterator","./modules/es7.symbol.observable","./modules/es7.system.global","./modules/es7.weak-map.from","./modules/es7.weak-map.of","./modules/es7.weak-set.from","./modules/es7.weak-set.of","./modules/web.dom.iterable","./modules/web.immediate","./modules/web.timers","384","lib$es6$promise$utils$$objectOrFunction","lib$es6$promise$utils$$isFunction","lib$es6$promise$utils$$isMaybeThenable","lib$es6$promise$asap$$setScheduler","scheduleFn","lib$es6$promise$asap$$customSchedulerFn","lib$es6$promise$asap$$setAsap","asapFn","lib$es6$promise$asap$$asap","lib$es6$promise$asap$$useNextTick","lib$es6$promise$asap$$flush","lib$es6$promise$asap$$useVertxTimer","lib$es6$promise$asap$$vertxNext","lib$es6$promise$asap$$useMutationObserver","iterations","lib$es6$promise$asap$$BrowserMutationObserver","lib$es6$promise$asap$$useMessageChannel","lib$es6$promise$asap$$useSetTimeout","lib$es6$promise$asap$$len","lib$es6$promise$asap$$queue","lib$es6$promise$asap$$attemptVertx","vertx","runOnLoop","runOnContext","lib$es6$promise$$internal$$noop","lib$es6$promise$$internal$$selfFulfillment","lib$es6$promise$$internal$$cannotReturnOwn","lib$es6$promise$$internal$$getThen","lib$es6$promise$$internal$$GET_THEN_ERROR","lib$es6$promise$$internal$$tryThen","fulfillmentHandler","rejectionHandler","lib$es6$promise$$internal$$handleForeignThenable","thenable","sealed","lib$es6$promise$$internal$$resolve","lib$es6$promise$$internal$$fulfill","lib$es6$promise$$internal$$reject","_label","lib$es6$promise$$internal$$handleOwnThenable","_state","lib$es6$promise$$internal$$FULFILLED","_result","lib$es6$promise$$internal$$REJECTED","lib$es6$promise$$internal$$subscribe","lib$es6$promise$$internal$$handleMaybeThenable","maybeThenable","lib$es6$promise$$internal$$publishRejection","_onerror","lib$es6$promise$$internal$$publish","lib$es6$promise$$internal$$PENDING","_subscribers","onFulfillment","onRejection","subscribers","settled","lib$es6$promise$$internal$$invokeCallback","lib$es6$promise$$internal$$ErrorObject","lib$es6$promise$$internal$$tryCatch","lib$es6$promise$$internal$$TRY_CATCH_ERROR","succeeded","failed","hasCallback","lib$es6$promise$$internal$$initializePromise","lib$es6$promise$enumerator$$Enumerator","enumerator","_instanceConstructor","_validateInput","_input","_remaining","_init","_enumerate","_validationError","lib$es6$promise$promise$all$$all","lib$es6$promise$enumerator$$default","lib$es6$promise$promise$race$$race","lib$es6$promise$utils$$isArray","lib$es6$promise$promise$resolve$$resolve","lib$es6$promise$promise$reject$$reject","lib$es6$promise$promise$$needsResolver","lib$es6$promise$promise$$needsNew","lib$es6$promise$promise$$Promise","_id","lib$es6$promise$promise$$counter","lib$es6$promise$polyfill$$polyfill","local","cast","lib$es6$promise$promise$$default","lib$es6$promise$utils$$_isArray","lib$es6$promise$asap$$scheduleFlush","lib$es6$promise$asap$$browserWindow","lib$es6$promise$asap$$browserGlobal","lib$es6$promise$asap$$isNode","lib$es6$promise$asap$$isWorker","Uint8ClampedArray","_eachEntry","_settledAt","_willSettleAt","lib$es6$promise$promise$all$$default","lib$es6$promise$promise$race$$default","lib$es6$promise$promise$resolve$$default","lib$es6$promise$promise$reject$$default","_setScheduler","_setAsap","_asap","lib$es6$promise$polyfill$$default","lib$es6$promise$umd$$ES6Promise","polyfill","_process","385","ZStream","Inflate","was","InfBlocks","checkfn","hufts","MANY","mode","IB_TYPE","blens","codes","InfCodes","bitk","bitb","read","inftree","InfTree","inflate_trees_fixed","td","fixed_bl","fixed_bd","fixed_tl","fixed_td","Z_OK","dest","arrayCopy_fast","hasSubarray","arrayCopy_slow","afterUncOffset","inflateInit","DEF_WBITS","next_in","next_in_index","avail_in","obuf","next_out","next_out_index","avail_out","inflate","Z_NO_FLUSH","Z_STREAM_END","Z_BUF_ERROR","newob","MAX_WBITS","BMAX","PRESET_DICT","Z_FINISH","Z_DEFLATED","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","METHOD","FLAG","DICT4","DICT3","DICT2","DICT1","DICT0","BLOCKS","CHECK4","CHECK3","CHECK2","CHECK1","DONE","BAD","inflate_mask","IB_LENS","IB_STORED","IB_TABLE","IB_BTREE","IB_DTREE","IB_CODES","IB_DRY","IB_DONE","IB_BAD","cplens","cplext","cpdist","cpdext","istate","inflateEnd","inflateSync","inflateSetDictionary","dictionary","dictLength","inflateReset","total_in","total_out","free","wbits","marker","need","adler","proc","_adler","adler32","set_dictionary","mark","inflateSyncPoint","sync_point","INFBLOCKS_BORDER","inflate_flush","inflate_trees_bits","inflate_trees_dynamic","IC_START","IC_LEN","IC_LENEXT","IC_DIST","IC_DISTEXT","IC_COPY","IC_LIT","IC_WASH","IC_END","IC_BADCODE","tl_index","td_index","lbits","dbits","ltree","ltree_index","dtree","dtree_index","tree","tindex","inflate_fast","tree_index","lit","dist","tp","tp_index","ml","md","tp_index_t_3","huft_build","bindex","hp","hn","mask","xp","initWorkArea","nd","vsize","testArray","386","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","cachedClearTimeout","cleanUpNextTick","draining","currentQueue","queueIndex","drainQueue","Item","array","noop","env","argv","versions","on","once","off","removeAllListeners","prependListener","prependOnceListener","binding","cwd","chdir","umask","387","__","@@functional/placeholder","_arity","a0","a3","a4","a5","a6","a7","a8","a9","_arrayFromIterator","_arrayOf","_cloneRegExp","pattern","_complement","_concat","set1","set2","len1","len2","_containsWith","pred","_filter","_forceReduced","@@transducer/value","@@transducer/reduced","_functionName","_has","prop","_identity","_isArguments","_isArray","_isFunction","_isInteger","_isNumber","_isObject","_isPlaceholder","_isRegExp","_isString","_isTransformer","_map","functor","_objectAssign","nextKey","_of","_pipe","_pipeP","_quote","escaped","_reduced","_slice","_toISOString","pad","_xfBase","xf","_xwrap","XWrap","_aperture","_assign","_checkForMethod","methodname","_curry1","_curry2","_curry3","f3","_curryN","received","combined","argsIdx","combinedIdx","_dispatchable","transducer","_dropLastWhile","_xall","XAll","_xany","XAny","any","_xaperture","XAperture","full","getCopy","_xdrop","XDrop","_xdropLast","XDropLast","_xdropRepeatsWith","XDropRepeatsWith","lastValue","seenFirstValue","sameAsLast","_xdropWhile","XDropWhile","_xfilter","XFilter","_xfind","XFind","_xfindIndex","XFindIndex","_xfindLast","XFindLast","_xfindLastIndex","XFindLastIndex","lastIdx","_xmap","XMap","_xtake","XTake","_xtakeWhile","XTakeWhile","adjust","_idx","always","and","aperture","append","assoc","assocPath","thisObj","comparator","curryN","dec","differenceWith","second","firstLen","dissoc","dissocPath","tail","dropWhile","evolve","transformations","transformation","findLast","findLastIndex","fromPairs","pairs","groupWith","nextidx","gte","hasIn","identical","identity","ifElse","condition","onTrue","onFalse","insert","elt","insertAll","elts","intersperse","Ctor","isArrayLike","isNil","hasEnumBug","nonEnumerableProps","hasArgsEnumBug","item","nIdx","ks","checkArgsLength","keysIn","lte","mapAccum","tuple","mapAccumRight","mathMod","maxBy","mergeAll","mergeWithKey","minBy","modulo","nAry","negate","none","not","nth","nthArg","objOf","called","over","Identity","lens","pair","fst","snd","paths","pathOr","pathSatisfies","propPath","pickAll","pickBy","prepend","propOr","propSatisfies","ps","reduced","regex","replacement","scan","sortBy","splitAt","splitEvery","splitWhen","subtract","take","xs","takeLastWhile","takeWhile","tap","times","toPairs","toPairsIn","transpose","outerlist","innerlist","zeroWidth","hasProtoTrim","beginRx","endRx","tryCatch","tryer","catcher","unapply","unary","uncurryN","endIdx","currentDepth","unfold","uniqWith","unless","whenFalseFn","until","useWith","transformers","vals","valuesIn","Const","when","whenTrueFn","where","spec","testObj","xprod","ilen","jlen","zip","rv","zipObj","zipWith","_clone","refFrom","refTo","deep","copy","copiedValue","_createPartialApplicator","_dropLast","_equals","stackA","stackB","keysA","pop","_makeFlat","recursive","flatt","_reduce","_arrayReduce","_iterableReduce","_methodReduce","symIterator","_stepCat","_stepCatArray","@@transducer/init","@@transducer/step","@@transducer/result","_stepCatString","_stepCatObject","_xdropLastWhile","XDropLastWhile","retained","retain","_xgroupBy","XGroupBy","inputs","addIndex","origFn","binary","clone","curry","drop","dropLast","dropLastWhile","filterable","flip","intersectionWith","list1","list2","lookupList","filteredList","results","into","invert","invertObj","isEmpty","mapObjIndexed","mergeWith","partial","partialRight","pathEq","_path","pluck","project","propEq","propIs","reduceBy","valueFn","valueAcc","keyFn","takeLast","transduce","unionWith","whereEq","_flatCat","preservingReduced","rxf","_indexOf","inf","_xchain","allPass","preds","allUniq","anyPass","ap","applicative","applySpec","monad","cond","arity","constructN","Fn","$0","$1","$2","$3","$4","$5","$6","$7","$8","$9","converge","after","countBy","elem","dropRepeatsWith","eqBy","eqProps","obj1","obj2","groupBy","indexBy","juxt","toFunctorFn","lensIndex","lensPath","lensProp","liftN","lifted","mean","median","partition","pipeP","product","traversable","traverse","unnest","_contains","_toString","seen","recur","mapPairs","repr","compose","composeK","composeP","difference","dropRepeats","lift","omit","pipeK","without","_Set","_nativeSet","_items","hasOrAdd","shouldAdd","prevSize","newSize","bIdx","both","complement","either","invoker","memoize","cache","toLower","toUpper","uniqBy","appliedItem","symmetricDifference","symmetricDifferenceWith","uniq","amd","388","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","Context","_invoke","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","defineIteratorMethods","AsyncIterator","__await","unwrapped","enqueue","callInvokeWithMethodAndArg","previousPromise","GenStateSuspendedStart","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","GenStateSuspendedYield","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iteratorMethod","iteratorSymbol","Op","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","inModule","runtime","regeneratorRuntime","NativeIteratorPrototype","Gp","displayName","isGeneratorFunction","genFun","ctor","awrap","skipTempReset","rootEntry","rootRecord","rval","exception","handle","caught","hasCatch","hasFinally","finallyEntry","finish","thrown","delegateYield"],"mappings":"CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA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KAOA,gBAAAxtE,GAAAA,EACA,gBAAA/7E,QAAAA,OACA,gBAAAqE,MAAAA,KAAA7wB,QnY+nwCGjG,KAAKiG,KAAuB,mBAAXuoG,QAAyBA,OAAyB,mBAAT13E,MAAuBA,KAAyB,mBAAXrE,QAAyBA,qBAEhH","file":"dalliance-all.js","sourcesContent":["(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 0)\n                bi += 65536;\n\n            if (bi < minBlockIndex)\n                minBlockIndex = bi;\n            break;\n        }\n    }\n    p += (nintv * 8);\n\n    return {\n        minBlockIndex: minBlockIndex,\n        nbin: nbin,\n        length: p - offset\n    };\n}\n\n\nfunction makeBam(data, bai, indexChunks, callback, attempted) {\n    // Do an initial probe on the BAM file to catch any mixed-content errors.\n    data.slice(0, 10).fetch(function(header) {\n        if (header) {\n            return makeBam2(data, bai, indexChunks, callback, attempted);\n        } else {\n            return callback(null, \"Couldn't access BAM.\");\n        }\n    }, {timeout: 5000});\n}\n\nfunction makeBam2(data, bai, indexChunks, callback, attempted) {\n    var bam = new BamFile();\n    bam.data = data;\n    bam.bai = bai;\n    bam.indexChunks = indexChunks;\n\n    var minBlockIndex = bam.indexChunks ? bam.indexChunks.minBlockIndex : 1000000000;\n\n    // Fills out bam.chrToIndex and bam.indexToChr based on the first few bytes of the BAM.\n    function parseBamHeader(r) {\n        if (!r) {\n            return callback(null, \"Couldn't access BAM\");\n        }\n\n        var unc = unbgzf(r, r.byteLength);\n        var uncba = new Uint8Array(unc);\n\n        var magic = readInt(uncba, 0);\n        if (magic != BAM_MAGIC) {\n            return callback(null, \"Not a BAM file, magic=0x\" + magic.toString(16));\n        }\n        var headLen = readInt(uncba, 4);\n        var header = '';\n        for (var i = 0; i < headLen; ++i) {\n            header += String.fromCharCode(uncba[i + 8]);\n        }\n\n        var nRef = readInt(uncba, headLen + 8);\n        var p = headLen + 12;\n\n        bam.chrToIndex = {};\n        bam.indexToChr = [];\n        for (var i = 0; i < nRef; ++i) {\n            var lName = readInt(uncba, p);\n            var name = '';\n            for (var j = 0; j < lName-1; ++j) {\n                name += String.fromCharCode(uncba[p + 4 + j]);\n            }\n            var lRef = readInt(uncba, p + lName + 4);\n            bam.chrToIndex[name] = i;\n            if (name.indexOf('chr') == 0) {\n                bam.chrToIndex[name.substring(3)] = i;\n            } else {\n                bam.chrToIndex['chr' + name] = i;\n            }\n            bam.indexToChr.push(name);\n\n            p = p + 8 + lName;\n        }\n\n        if (bam.indices) {\n            return callback(bam);\n        }\n    }\n\n    function parseBai(header) {\n        if (!header) {\n            return \"Couldn't access BAI\";\n        }\n\n        var uncba = new Uint8Array(header);\n        var baiMagic = readInt(uncba, 0);\n        if (baiMagic != BAI_MAGIC) {\n            return callback(null, 'Not a BAI file, magic=0x' + baiMagic.toString(16));\n        }\n\n        var nref = readInt(uncba, 4);\n\n        bam.indices = [];\n\n        var p = 8;\n        for (var ref = 0; ref < nref; ++ref) {\n            var blockStart = p;\n            var o = _getBaiRefLength(uncba, blockStart);\n            p += o.length;\n\n            minBlockIndex = Math.min(o.minBlockIndex, minBlockIndex);\n\n            var nbin = o.nbin;\n\n            if (nbin > 0) {\n                bam.indices[ref] = new Uint8Array(header, blockStart, p - blockStart);\n            }\n        }\n\n        return true;\n    }\n\n    if (!bam.indexChunks) {\n        bam.bai.fetch(function(header) {   // Do we really need to fetch the whole thing? :-(\n            var result = parseBai(header);\n            if (result !== true) {\n                if (bam.bai.url && typeof(attempted) === \"undefined\") {\n                    // Already attempted x.bam.bai not there so now trying x.bai\n                    bam.bai.url = bam.data.url.replace(new RegExp('.bam$'), '.bai');\n                    \n                     // True lets us know we are making a second attempt\n                    makeBam2(data, bam.bai, indexChunks, callback, true);\n                }\n                else {\n                    // We've attempted x.bam.bai & x.bai and nothing worked\n                    callback(null, result);\n                }\n            } else {\n              bam.data.slice(0, minBlockIndex).fetch(parseBamHeader);\n            }\n        });   // Timeout on first request to catch Chrome mixed-content error.\n    } else {\n        var chunks = bam.indexChunks.chunks;\n        bam.indices = []\n        for (var i = 0; i < chunks.length; i++) {\n           bam.indices[i] = null;  // To be filled out lazily as needed\n        }\n        bam.data.slice(0, minBlockIndex).fetch(parseBamHeader);\n    }\n}\n\n\n\nBamFile.prototype.blocksForRange = function(refId, min, max) {\n    var index = this.indices[refId];\n    if (!index) {\n        return [];\n    }\n\n    var intBinsL = reg2bins(min, max);\n    var intBins = [];\n    for (var i = 0; i < intBinsL.length; ++i) {\n        intBins[intBinsL[i]] = true;\n    }\n    var leafChunks = [], otherChunks = [];\n\n    var nbin = readInt(index, 0);\n    var p = 4;\n    for (var b = 0; b < nbin; ++b) {\n        var bin = readInt(index, p);\n        var nchnk = readInt(index, p+4);\n//        dlog('bin=' + bin + '; nchnk=' + nchnk);\n        p += 8;\n        if (intBins[bin]) {\n            for (var c = 0; c < nchnk; ++c) {\n                var cs = readVob(index, p);\n                var ce = readVob(index, p + 8);\n                (bin < 4681 ? otherChunks : leafChunks).push(new Chunk(cs, ce));\n                p += 16;\n            }\n        } else {\n            p +=  (nchnk * 16);\n        }\n    }\n    // console.log('leafChunks = ' + JSON.stringify(leafChunks));\n    // console.log('otherChunks = ' + JSON.stringify(otherChunks));\n\n    var nintv = readInt(index, p);\n    // console.log('nintv=' + nintv);\n    var lowest = null;\n    var minLin = Math.min(min>>14, nintv - 1), maxLin = Math.min(max>>14, nintv - 1);\n    for (var i = minLin; i <= maxLin; ++i) {\n        var lb =  readVob(index, p + 4 + (i * 8));\n        if (!lb) {\n            continue;\n        }\n        if (!lowest || lb.block < lowest.block || (lb.block == lowest.block && lb.offset < lowest.offset)) {\n            lowest = lb;\n        }\n    }\n    // console.log('Lowest LB = ' + lowest);\n\n    var prunedOtherChunks = [];\n    if (lowest != null) {\n        for (var i = 0; i < otherChunks.length; ++i) {\n            var chnk = otherChunks[i];\n            if (chnk.maxv.block > lowest.block || (chnk.maxv.block == lowest.block && chnk.maxv.offset >= lowest.offset)) {\n                prunedOtherChunks.push(chnk);\n            }\n        }\n    }\n    // console.log('prunedOtherChunks = ' + JSON.stringify(prunedOtherChunks));\n    otherChunks = prunedOtherChunks;\n\n    var intChunks = [];\n    for (var i = 0; i < otherChunks.length; ++i) {\n        intChunks.push(otherChunks[i]);\n    }\n    for (var i = 0; i < leafChunks.length; ++i) {\n        intChunks.push(leafChunks[i]);\n    }\n\n    intChunks.sort(function(c0, c1) {\n        var dif = c0.minv.block - c1.minv.block;\n        if (dif != 0) {\n            return dif;\n        } else {\n            return c0.minv.offset - c1.minv.offset;\n        }\n    });\n    var mergedChunks = [];\n    if (intChunks.length > 0) {\n        var cur = intChunks[0];\n        for (var i = 1; i < intChunks.length; ++i) {\n            var nc = intChunks[i];\n            if (nc.minv.block == cur.maxv.block /* && nc.minv.offset == cur.maxv.offset */) { // no point splitting mid-block\n                cur = new Chunk(cur.minv, nc.maxv);\n            } else {\n                mergedChunks.push(cur);\n                cur = nc;\n            }\n        }\n        mergedChunks.push(cur);\n    }\n    // console.log('mergedChunks = ' + JSON.stringify(mergedChunks));\n\n    return mergedChunks;\n}\n\nBamFile.prototype.fetch = function(chr, min, max, callback, opts) {\n    var thisB = this;\n    opts = opts || {};\n\n    var chrId = this.chrToIndex[chr];\n    var chunks;\n    if (chrId === undefined) {\n        chunks = [];\n    } else {\n        // Fetch this portion of the BAI if it hasn't been loaded yet.\n        if (this.indices[chrId] === null && this.indexChunks.chunks[chrId]) {\n            var start_stop = this.indexChunks.chunks[chrId];\n            return this.bai.slice(start_stop[0], start_stop[1]).fetch(function(data) {\n                var buffer = new Uint8Array(data);\n                this.indices[chrId] = buffer;\n                return this.fetch(chr, min, max, callback, opts);\n            }.bind(this));\n        }\n\n        chunks = this.blocksForRange(chrId, min, max);\n        if (!chunks) {\n            callback(null, 'Error in index fetch');\n        }\n    }\n    \n    var records = [];\n    var index = 0;\n    var data;\n\n    function tramp() {\n        if (index >= chunks.length) {\n            return callback(records);\n        } else if (!data) {\n            var c = chunks[index];\n            var fetchMin = c.minv.block;\n            var fetchMax = c.maxv.block + (1<<16); // *sigh*\n            // console.log('fetching ' + fetchMin + ':' + fetchMax);\n            thisB.data.slice(fetchMin, fetchMax - fetchMin).fetch(function(r) {\n                data = unbgzf(r, c.maxv.block - c.minv.block + 1);\n                return tramp();\n            });\n        } else {\n            var ba = new Uint8Array(data);\n            var finished = thisB.readBamRecords(ba, chunks[index].minv.offset, records, min, max, chrId, opts);\n            data = null;\n            ++index;\n            if (finished)\n                return callback(records);\n            else\n                return tramp();\n        }\n    }\n    tramp();\n}\n\nvar SEQRET_DECODER = ['=', 'A', 'C', 'x', 'G', 'x', 'x', 'x', 'T', 'x', 'x', 'x', 'x', 'x', 'x', 'N'];\nvar CIGAR_DECODER = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X', '?', '?', '?', '?', '?', '?', '?'];\n\nfunction BamRecord() {\n}\n\nBamFile.prototype.readBamRecords = function(ba, offset, sink, min, max, chrId, opts) {\n    while (true) {\n        var blockSize = readInt(ba, offset);\n        var blockEnd = offset + blockSize + 4;\n        if (blockEnd > ba.length) {\n            return false;\n        }\n\n        var record = new BamRecord();\n\n        var refID = readInt(ba, offset + 4);\n        var pos = readInt(ba, offset + 8);\n        \n        var bmn = readInt(ba, offset + 12);\n        var bin = (bmn & 0xffff0000) >> 16;\n        var mq = (bmn & 0xff00) >> 8;\n        var nl = bmn & 0xff;\n\n        var flag_nc = readInt(ba, offset + 16);\n        var flag = (flag_nc & 0xffff0000) >> 16;\n        var nc = flag_nc & 0xffff;\n    \n        var lseq = readInt(ba, offset + 20);\n        \n        var nextRef  = readInt(ba, offset + 24);\n        var nextPos = readInt(ba, offset + 28);\n        \n        var tlen = readInt(ba, offset + 32);\n    \n        record.segment = this.indexToChr[refID];\n        record.flag = flag;\n        record.pos = pos;\n        record.mq = mq;\n        if (opts.light)\n            record.seqLength = lseq;\n\n        if (!opts.light || opts.includeName) {\n            var readName = '';\n            for (var j = 0; j < nl-1; ++j) {\n                readName += String.fromCharCode(ba[offset + 36 + j]);\n            }\n            record.readName = readName;\n        }\n        \n        if (!opts.light) {\n            if (nextRef >= 0) {\n                record.nextSegment = this.indexToChr[nextRef];\n                record.nextPos = nextPos;\n            }\n        \n            var p = offset + 36 + nl;\n\n            var cigar = '';\n            for (var c = 0; c < nc; ++c) {\n                var cigop = readInt(ba, p);\n                cigar = cigar + (cigop>>4) + CIGAR_DECODER[cigop & 0xf];\n                p += 4;\n            }\n            record.cigar = cigar;\n        \n            var seq = '';\n            var seqBytes = (lseq + 1) >> 1;\n            for (var j = 0; j < seqBytes; ++j) {\n                var sb = ba[p + j];\n                seq += SEQRET_DECODER[(sb & 0xf0) >> 4];\n                if (seq.length < lseq)\n                    seq += SEQRET_DECODER[(sb & 0x0f)];\n            }\n            p += seqBytes;\n            record.seq = seq;\n\n            var qseq = '';\n            for (var j = 0; j < lseq; ++j) {\n                qseq += String.fromCharCode(ba[p + j] + 33);\n            }\n            p += lseq;\n            record.quals = qseq;\n\n            while (p < blockEnd) {\n                var tag = String.fromCharCode(ba[p], ba[p + 1]);\n                var type = String.fromCharCode(ba[p + 2]);\n                var value;\n\n                if (type == 'A') {\n                    value = String.fromCharCode(ba[p + 3]);\n                    p += 4;\n                } else if (type == 'i' || type == 'I') {\n                    value = readInt(ba, p + 3);\n                    p += 7;\n                } else if (type == 'c' || type == 'C') {\n                    value = ba[p + 3];\n                    p += 4;\n                } else if (type == 's' || type == 'S') {\n                    value = readShort(ba, p + 3);\n                    p += 5;\n                } else if (type == 'f') {\n                    value = readFloat(ba, p + 3);\n                    p += 7;\n                } else if (type == 'Z' || type == 'H') {\n                    p += 3;\n                    value = '';\n                    for (;;) {\n                        var cc = ba[p++];\n                        if (cc == 0) {\n                            break;\n                        } else {\n                            value += String.fromCharCode(cc);\n                        }\n                    }\n                } else if (type == 'B') {\n                    var atype = String.fromCharCode(ba[p + 3]);\n                    var alen = readInt(ba, p + 4);\n                    var elen;\n                    var reader;\n                    if (atype == 'i' || atype == 'I' || atype == 'f') {\n                        elen = 4;\n                        if (atype == 'f')\n                            reader = readFloat;\n                        else\n                            reader = readInt;\n                    } else if (atype == 's' || atype == 'S') {\n                        elen = 2;\n                        reader = readShort;\n                    } else if (atype == 'c' || atype == 'C') {\n                        elen = 1;\n                        reader = readByte;\n                    } else {\n                        throw 'Unknown array type ' + atype;\n                    }\n\n                    p += 8;\n                    value = [];\n                    for (var i = 0; i < alen; ++i) {\n                        value.push(reader(ba, p));\n                        p += elen;\n                    }\n                } else {\n                    throw 'Unknown type '+ type;\n                }\n                record[tag] = value;\n            }\n        }\n\n        if (!min || record.pos <= max && record.pos + lseq >= min) {\n            if (chrId === undefined || refID == chrId) {\n                sink.push(record);\n            }\n        }\n        if (record.pos > max) {\n            return true;\n        }\n        offset = blockEnd;\n    }\n\n    // Exits via top of loop.\n};\n\nif (typeof(module) !== 'undefined') {\n    module.exports = {\n        makeBam: makeBam,\n        BAM_MAGIC: BAM_MAGIC,\n        BAI_MAGIC: BAI_MAGIC,\n        BamFlags: BamFlags\n    };\n}\n","(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 0) bi += 65536;\n\n            if (bi < minBlockIndex) minBlockIndex = bi;\n            break;\n        }\n    }\n    p += nintv * 8;\n\n    return {\n        minBlockIndex: minBlockIndex,\n        nbin: nbin,\n        length: p - offset\n    };\n}\n\nfunction makeBam(data, bai, indexChunks, callback, attempted) {\n    // Do an initial probe on the BAM file to catch any mixed-content errors.\n    data.slice(0, 10).fetch(function (header) {\n        if (header) {\n            return makeBam2(data, bai, indexChunks, callback, attempted);\n        } else {\n            return callback(null, \"Couldn't access BAM.\");\n        }\n    }, { timeout: 5000 });\n}\n\nfunction makeBam2(data, bai, indexChunks, callback, attempted) {\n    var bam = new BamFile();\n    bam.data = data;\n    bam.bai = bai;\n    bam.indexChunks = indexChunks;\n\n    var minBlockIndex = bam.indexChunks ? bam.indexChunks.minBlockIndex : 1000000000;\n\n    // Fills out bam.chrToIndex and bam.indexToChr based on the first few bytes of the BAM.\n    function parseBamHeader(r) {\n        if (!r) {\n            return callback(null, \"Couldn't access BAM\");\n        }\n\n        var unc = unbgzf(r, r.byteLength);\n        var uncba = new Uint8Array(unc);\n\n        var magic = readInt(uncba, 0);\n        if (magic != BAM_MAGIC) {\n            return callback(null, \"Not a BAM file, magic=0x\" + magic.toString(16));\n        }\n        var headLen = readInt(uncba, 4);\n        var header = '';\n        for (var i = 0; i < headLen; ++i) {\n            header += String.fromCharCode(uncba[i + 8]);\n        }\n\n        var nRef = readInt(uncba, headLen + 8);\n        var p = headLen + 12;\n\n        bam.chrToIndex = {};\n        bam.indexToChr = [];\n        for (var i = 0; i < nRef; ++i) {\n            var lName = readInt(uncba, p);\n            var name = '';\n            for (var j = 0; j < lName - 1; ++j) {\n                name += String.fromCharCode(uncba[p + 4 + j]);\n            }\n            var lRef = readInt(uncba, p + lName + 4);\n            bam.chrToIndex[name] = i;\n            if (name.indexOf('chr') == 0) {\n                bam.chrToIndex[name.substring(3)] = i;\n            } else {\n                bam.chrToIndex['chr' + name] = i;\n            }\n            bam.indexToChr.push(name);\n\n            p = p + 8 + lName;\n        }\n\n        if (bam.indices) {\n            return callback(bam);\n        }\n    }\n\n    function parseBai(header) {\n        if (!header) {\n            return \"Couldn't access BAI\";\n        }\n\n        var uncba = new Uint8Array(header);\n        var baiMagic = readInt(uncba, 0);\n        if (baiMagic != BAI_MAGIC) {\n            return callback(null, 'Not a BAI file, magic=0x' + baiMagic.toString(16));\n        }\n\n        var nref = readInt(uncba, 4);\n\n        bam.indices = [];\n\n        var p = 8;\n        for (var ref = 0; ref < nref; ++ref) {\n            var blockStart = p;\n            var o = _getBaiRefLength(uncba, blockStart);\n            p += o.length;\n\n            minBlockIndex = Math.min(o.minBlockIndex, minBlockIndex);\n\n            var nbin = o.nbin;\n\n            if (nbin > 0) {\n                bam.indices[ref] = new Uint8Array(header, blockStart, p - blockStart);\n            }\n        }\n\n        return true;\n    }\n\n    if (!bam.indexChunks) {\n        bam.bai.fetch(function (header) {\n            // Do we really need to fetch the whole thing? :-(\n            var result = parseBai(header);\n            if (result !== true) {\n                if (bam.bai.url && typeof attempted === \"undefined\") {\n                    // Already attempted x.bam.bai not there so now trying x.bai\n                    bam.bai.url = bam.data.url.replace(new RegExp('.bam$'), '.bai');\n\n                    // True lets us know we are making a second attempt\n                    makeBam2(data, bam.bai, indexChunks, callback, true);\n                } else {\n                    // We've attempted x.bam.bai & x.bai and nothing worked\n                    callback(null, result);\n                }\n            } else {\n                bam.data.slice(0, minBlockIndex).fetch(parseBamHeader);\n            }\n        }); // Timeout on first request to catch Chrome mixed-content error.\n    } else {\n        var chunks = bam.indexChunks.chunks;\n        bam.indices = [];\n        for (var i = 0; i < chunks.length; i++) {\n            bam.indices[i] = null; // To be filled out lazily as needed\n        }\n        bam.data.slice(0, minBlockIndex).fetch(parseBamHeader);\n    }\n}\n\nBamFile.prototype.blocksForRange = function (refId, min, max) {\n    var index = this.indices[refId];\n    if (!index) {\n        return [];\n    }\n\n    var intBinsL = reg2bins(min, max);\n    var intBins = [];\n    for (var i = 0; i < intBinsL.length; ++i) {\n        intBins[intBinsL[i]] = true;\n    }\n    var leafChunks = [],\n        otherChunks = [];\n\n    var nbin = readInt(index, 0);\n    var p = 4;\n    for (var b = 0; b < nbin; ++b) {\n        var bin = readInt(index, p);\n        var nchnk = readInt(index, p + 4);\n        //        dlog('bin=' + bin + '; nchnk=' + nchnk);\n        p += 8;\n        if (intBins[bin]) {\n            for (var c = 0; c < nchnk; ++c) {\n                var cs = readVob(index, p);\n                var ce = readVob(index, p + 8);\n                (bin < 4681 ? otherChunks : leafChunks).push(new Chunk(cs, ce));\n                p += 16;\n            }\n        } else {\n            p += nchnk * 16;\n        }\n    }\n    // console.log('leafChunks = ' + JSON.stringify(leafChunks));\n    // console.log('otherChunks = ' + JSON.stringify(otherChunks));\n\n    var nintv = readInt(index, p);\n    // console.log('nintv=' + nintv);\n    var lowest = null;\n    var minLin = Math.min(min >> 14, nintv - 1),\n        maxLin = Math.min(max >> 14, nintv - 1);\n    for (var i = minLin; i <= maxLin; ++i) {\n        var lb = readVob(index, p + 4 + i * 8);\n        if (!lb) {\n            continue;\n        }\n        if (!lowest || lb.block < lowest.block || lb.block == lowest.block && lb.offset < lowest.offset) {\n            lowest = lb;\n        }\n    }\n    // console.log('Lowest LB = ' + lowest);\n\n    var prunedOtherChunks = [];\n    if (lowest != null) {\n        for (var i = 0; i < otherChunks.length; ++i) {\n            var chnk = otherChunks[i];\n            if (chnk.maxv.block > lowest.block || chnk.maxv.block == lowest.block && chnk.maxv.offset >= lowest.offset) {\n                prunedOtherChunks.push(chnk);\n            }\n        }\n    }\n    // console.log('prunedOtherChunks = ' + JSON.stringify(prunedOtherChunks));\n    otherChunks = prunedOtherChunks;\n\n    var intChunks = [];\n    for (var i = 0; i < otherChunks.length; ++i) {\n        intChunks.push(otherChunks[i]);\n    }\n    for (var i = 0; i < leafChunks.length; ++i) {\n        intChunks.push(leafChunks[i]);\n    }\n\n    intChunks.sort(function (c0, c1) {\n        var dif = c0.minv.block - c1.minv.block;\n        if (dif != 0) {\n            return dif;\n        } else {\n            return c0.minv.offset - c1.minv.offset;\n        }\n    });\n    var mergedChunks = [];\n    if (intChunks.length > 0) {\n        var cur = intChunks[0];\n        for (var i = 1; i < intChunks.length; ++i) {\n            var nc = intChunks[i];\n            if (nc.minv.block == cur.maxv.block /* && nc.minv.offset == cur.maxv.offset */) {\n                    // no point splitting mid-block\n                    cur = new Chunk(cur.minv, nc.maxv);\n                } else {\n                mergedChunks.push(cur);\n                cur = nc;\n            }\n        }\n        mergedChunks.push(cur);\n    }\n    // console.log('mergedChunks = ' + JSON.stringify(mergedChunks));\n\n    return mergedChunks;\n};\n\nBamFile.prototype.fetch = function (chr, min, max, callback, opts) {\n    var thisB = this;\n    opts = opts || {};\n\n    var chrId = this.chrToIndex[chr];\n    var chunks;\n    if (chrId === undefined) {\n        chunks = [];\n    } else {\n        // Fetch this portion of the BAI if it hasn't been loaded yet.\n        if (this.indices[chrId] === null && this.indexChunks.chunks[chrId]) {\n            var start_stop = this.indexChunks.chunks[chrId];\n            return this.bai.slice(start_stop[0], start_stop[1]).fetch(function (data) {\n                var buffer = new Uint8Array(data);\n                this.indices[chrId] = buffer;\n                return this.fetch(chr, min, max, callback, opts);\n            }.bind(this));\n        }\n\n        chunks = this.blocksForRange(chrId, min, max);\n        if (!chunks) {\n            callback(null, 'Error in index fetch');\n        }\n    }\n\n    var records = [];\n    var index = 0;\n    var data;\n\n    function tramp() {\n        if (index >= chunks.length) {\n            return callback(records);\n        } else if (!data) {\n            var c = chunks[index];\n            var fetchMin = c.minv.block;\n            var fetchMax = c.maxv.block + (1 << 16); // *sigh*\n            // console.log('fetching ' + fetchMin + ':' + fetchMax);\n            thisB.data.slice(fetchMin, fetchMax - fetchMin).fetch(function (r) {\n                data = unbgzf(r, c.maxv.block - c.minv.block + 1);\n                return tramp();\n            });\n        } else {\n            var ba = new Uint8Array(data);\n            var finished = thisB.readBamRecords(ba, chunks[index].minv.offset, records, min, max, chrId, opts);\n            data = null;\n            ++index;\n            if (finished) return callback(records);else return tramp();\n        }\n    }\n    tramp();\n};\n\nvar SEQRET_DECODER = ['=', 'A', 'C', 'x', 'G', 'x', 'x', 'x', 'T', 'x', 'x', 'x', 'x', 'x', 'x', 'N'];\nvar CIGAR_DECODER = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X', '?', '?', '?', '?', '?', '?', '?'];\n\nfunction BamRecord() {}\n\nBamFile.prototype.readBamRecords = function (ba, offset, sink, min, max, chrId, opts) {\n    while (true) {\n        var blockSize = readInt(ba, offset);\n        var blockEnd = offset + blockSize + 4;\n        if (blockEnd > ba.length) {\n            return false;\n        }\n\n        var record = new BamRecord();\n\n        var refID = readInt(ba, offset + 4);\n        var pos = readInt(ba, offset + 8);\n\n        var bmn = readInt(ba, offset + 12);\n        var bin = (bmn & 0xffff0000) >> 16;\n        var mq = (bmn & 0xff00) >> 8;\n        var nl = bmn & 0xff;\n\n        var flag_nc = readInt(ba, offset + 16);\n        var flag = (flag_nc & 0xffff0000) >> 16;\n        var nc = flag_nc & 0xffff;\n\n        var lseq = readInt(ba, offset + 20);\n\n        var nextRef = readInt(ba, offset + 24);\n        var nextPos = readInt(ba, offset + 28);\n\n        var tlen = readInt(ba, offset + 32);\n\n        record.segment = this.indexToChr[refID];\n        record.flag = flag;\n        record.pos = pos;\n        record.mq = mq;\n        if (opts.light) record.seqLength = lseq;\n\n        if (!opts.light || opts.includeName) {\n            var readName = '';\n            for (var j = 0; j < nl - 1; ++j) {\n                readName += String.fromCharCode(ba[offset + 36 + j]);\n            }\n            record.readName = readName;\n        }\n\n        if (!opts.light) {\n            if (nextRef >= 0) {\n                record.nextSegment = this.indexToChr[nextRef];\n                record.nextPos = nextPos;\n            }\n\n            var p = offset + 36 + nl;\n\n            var cigar = '';\n            for (var c = 0; c < nc; ++c) {\n                var cigop = readInt(ba, p);\n                cigar = cigar + (cigop >> 4) + CIGAR_DECODER[cigop & 0xf];\n                p += 4;\n            }\n            record.cigar = cigar;\n\n            var seq = '';\n            var seqBytes = lseq + 1 >> 1;\n            for (var j = 0; j < seqBytes; ++j) {\n                var sb = ba[p + j];\n                seq += SEQRET_DECODER[(sb & 0xf0) >> 4];\n                if (seq.length < lseq) seq += SEQRET_DECODER[sb & 0x0f];\n            }\n            p += seqBytes;\n            record.seq = seq;\n\n            var qseq = '';\n            for (var j = 0; j < lseq; ++j) {\n                qseq += String.fromCharCode(ba[p + j] + 33);\n            }\n            p += lseq;\n            record.quals = qseq;\n\n            while (p < blockEnd) {\n                var tag = String.fromCharCode(ba[p], ba[p + 1]);\n                var type = String.fromCharCode(ba[p + 2]);\n                var value;\n\n                if (type == 'A') {\n                    value = String.fromCharCode(ba[p + 3]);\n                    p += 4;\n                } else if (type == 'i' || type == 'I') {\n                    value = readInt(ba, p + 3);\n                    p += 7;\n                } else if (type == 'c' || type == 'C') {\n                    value = ba[p + 3];\n                    p += 4;\n                } else if (type == 's' || type == 'S') {\n                    value = readShort(ba, p + 3);\n                    p += 5;\n                } else if (type == 'f') {\n                    value = readFloat(ba, p + 3);\n                    p += 7;\n                } else if (type == 'Z' || type == 'H') {\n                    p += 3;\n                    value = '';\n                    for (;;) {\n                        var cc = ba[p++];\n                        if (cc == 0) {\n                            break;\n                        } else {\n                            value += String.fromCharCode(cc);\n                        }\n                    }\n                } else if (type == 'B') {\n                    var atype = String.fromCharCode(ba[p + 3]);\n                    var alen = readInt(ba, p + 4);\n                    var elen;\n                    var reader;\n                    if (atype == 'i' || atype == 'I' || atype == 'f') {\n                        elen = 4;\n                        if (atype == 'f') reader = readFloat;else reader = readInt;\n                    } else if (atype == 's' || atype == 'S') {\n                        elen = 2;\n                        reader = readShort;\n                    } else if (atype == 'c' || atype == 'C') {\n                        elen = 1;\n                        reader = readByte;\n                    } else {\n                        throw 'Unknown array type ' + atype;\n                    }\n\n                    p += 8;\n                    value = [];\n                    for (var i = 0; i < alen; ++i) {\n                        value.push(reader(ba, p));\n                        p += elen;\n                    }\n                } else {\n                    throw 'Unknown type ' + type;\n                }\n                record[tag] = value;\n            }\n        }\n\n        if (!min || record.pos <= max && record.pos + lseq >= min) {\n            if (chrId === undefined || refID == chrId) {\n                sink.push(record);\n            }\n        }\n        if (record.pos > max) {\n            return true;\n        }\n        offset = blockEnd;\n    }\n\n    // Exits via top of loop.\n};\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        makeBam: makeBam,\n        BAM_MAGIC: BAM_MAGIC,\n        BAI_MAGIC: BAI_MAGIC,\n        BamFlags: BamFlags\n    };\n}\n\n},{\"./bin\":4,\"./lh3utils\":26,\"./spans\":41}],2:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// bedwig.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var spans = require('./spans');\n    var Range = spans.Range;\n    var union = spans.union;\n    var intersection = spans.intersection;\n\n    var sa = require('./sourceadapters');\n    var dalliance_registerParserFactory = sa.registerParserFactory;\n\n    var das = require('./das');\n    var DASStylesheet = das.DASStylesheet;\n    var DASStyle = das.DASStyle;\n    var DASFeature = das.DASFeature;\n    var DASGroup = das.DASGroup;\n\n    var utils = require('./utils');\n    var shallowCopy = utils.shallowCopy;\n}\n\nfunction BedWigParser(type) {\n    this.type = type;\n}\n\nBedWigParser.prototype.createSession = function (sink) {\n    if (this.type == 'wig') return new WigParseSession(this, sink);else return new BedParseSession(this, sink);\n};\n\nvar __KV_REGEXP = /([^=]+)=(.+)/;\nvar __SPACE_REGEXP = /\\s/;\nvar BED_COLOR_REGEXP = new RegExp(\"^[0-9]+,[0-9]+,[0-9]+\");\n\nfunction BedParseSession(parser, sink) {\n    this.parser = parser;\n    this.sink = sink;\n}\n\nBedParseSession.prototype.parse = function (line) {\n    var toks = line.split(__SPACE_REGEXP);\n    if (toks.length < 3) return;\n\n    var start = parseInt(toks[1]) + 1;\n    var end = parseInt(toks[2]);\n\n    var f = { segment: toks[0],\n        min: start,\n        max: end };\n\n    if (toks.length > 3 && toks[3] !== '.') {\n        f.label = toks[3];\n    }\n\n    if (toks.length > 4) {\n        f.score = parseFloat(toks[4]);\n    }\n\n    if (toks.length > 5) {\n        f.orientation = toks[5];\n    }\n\n    if (toks.length > 8) {\n        var color = toks[8];\n        if (BED_COLOR_REGEXP.test(color)) {\n            f.itemRgb = 'rgb(' + color + ')';\n        }\n    }\n\n    if (toks.length >= 12) {\n        var thickStart = parseInt(toks[6]);\n        var thickEnd = parseInt(toks[7]);\n        var blockCount = parseInt(toks[9]);\n        var blockSizes = toks[10].split(',').map(function (x) {\n            return parseInt(x);\n        });\n        var blockStarts = toks[11].split(',').map(function (x) {\n            return parseInt(x);\n        });\n\n        f.type = 'transcript';\n        var grp = new DASGroup();\n        grp.id = toks[3];\n        grp.type = 'transcript';\n        grp.notes = [];\n        f.groups = [grp];\n\n        if (toks.length > 12) {\n            var geneId = toks[12];\n            var geneName = geneId;\n            if (toks.length > 13) {\n                geneName = toks[13];\n            }\n            var gg = new DASGroup();\n            gg.id = geneId;\n            gg.label = geneName;\n            gg.type = 'gene';\n            f.groups.push(gg);\n        }\n\n        var spans = null;\n        for (var b = 0; b < blockCount; ++b) {\n            var bmin = blockStarts[b] + start;\n            var bmax = bmin + blockSizes[b];\n            var span = new Range(bmin, bmax);\n            if (spans) {\n                spans = union(spans, span);\n            } else {\n                spans = span;\n            }\n        }\n\n        var tsList = spans.ranges();\n        for (var s = 0; s < tsList.length; ++s) {\n            var ts = tsList[s];\n            var bf = shallowCopy(f);\n            bf.min = ts.min();\n            bf.max = ts.max();\n            this.sink(bf);\n        }\n\n        if (thickEnd > thickStart) {\n            var codingRegion = f.orientation == '+' ? new Range(thickStart, thickEnd + 3) : new Range(thickStart - 3, thickEnd);\n            // +/- 3 to account for stop codon\n\n            var tl = intersection(spans, codingRegion);\n            if (tl) {\n                f.type = 'translation';\n                var tlList = tl.ranges();\n                var readingFrame = 0;\n                for (var s = 0; s < tlList.length; ++s) {\n                    // Record reading frame for every exon\n                    var index = s;\n                    if (f.orientation == '-') index = tlList.length - s - 1;\n                    var ts = tlList[index];\n                    var bf = shallowCopy(f);\n                    bf.min = ts.min();\n                    bf.max = ts.max();\n                    f.readframe = readingFrame;\n                    var length = ts.max() - ts.min();\n                    readingFrame = (readingFrame + length) % 3;\n                    this.sink(bf);\n                }\n            }\n        }\n    } else {\n        this.sink(f);\n    }\n};\n\nBedParseSession.prototype.flush = function () {};\n\nfunction WigParseSession(parser, sink) {\n    this.parser = parser;\n    this.sink = sink;\n    this.wigState = null;\n}\n\nWigParseSession.prototype.parse = function (line) {\n    var toks = line.split(__SPACE_REGEXP);\n\n    if (toks[0] == 'fixedStep') {\n        this.wigState = 'fixedStep';\n        this.chr = this.pos = this.step = null;\n        this.span = 1;\n\n        for (var ti = 1; ti < toks.length; ++ti) {\n            var m = __KV_REGEXP.exec(toks[ti]);\n            if (m) {\n                if (m[1] == 'chrom') {\n                    this.chr = m[2];\n                } else if (m[1] == 'start') {\n                    this.pos = parseInt(m[2]);\n                } else if (m[1] == 'step') {\n                    this.step = parseInt(m[2]);\n                } else if (m[1] == 'span') {\n                    this.span = parseInt(m[2]);\n                }\n            }\n        }\n    } else if (toks[0] == 'variableStep') {\n        this.wigState = 'variableStep';\n        this.chr = null;\n        this.span = 1;\n\n        for (var ti = 1; ti < toks.length; ++ti) {\n            var m = __KV_REGEXP.exec(toks[ti]);\n            if (m[1] == 'chrom') {\n                this.chr = m[2];\n            } else if (m[1] == 'span') {\n                this.span = parseInt(m[2]);\n            }\n        }\n    } else {\n        if (!this.wigState) {\n            if (toks.length < 4) return;\n\n            var f = { segment: toks[0],\n                min: parseInt(toks[1]) + 1,\n                max: parseInt(toks[2]),\n                score: parseFloat(toks[3]) };\n\n            this.sink(f);\n        } else if (this.wigState == 'fixedStep') {\n            if (toks.length != 1) return;\n            var score = parseFloat(toks[0]);\n            var f = { segment: this.chr, min: this.pos, max: this.pos + this.span - 1, score: score };\n            this.pos += this.step;\n            this.sink(f);\n        } else if (this.wigState == 'variableStep') {\n            if (toks.length != 2) return;\n            var pos = parseInt(toks[0]);\n            var score = parseFloat(toks[1]);\n            var f = { segment: this.chr, min: pos, max: pos + this.span - 1, score: score };\n            this.sink(f);\n        }\n    }\n};\n\nWigParseSession.prototype.flush = function () {};\n\nBedWigParser.prototype.getStyleSheet = function (callback) {\n    var thisB = this;\n    var stylesheet = new DASStylesheet();\n\n    if (this.type == 'wig') {\n        var wigStyle = new DASStyle();\n        wigStyle.glyph = 'HISTOGRAM';\n        wigStyle.BGCOLOR = 'blue';\n        wigStyle.HEIGHT = 30;\n        stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n    } else {\n        var wigStyle = new DASStyle();\n        wigStyle.glyph = 'BOX';\n        wigStyle.FGCOLOR = 'black';\n        wigStyle.BGCOLOR = 'blue';\n        wigStyle.HEIGHT = 8;\n        wigStyle.BUMP = true;\n        wigStyle.LABEL = true;\n        wigStyle.ZINDEX = 20;\n        stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n\n        var wigStyle = new DASStyle();\n        wigStyle.glyph = 'BOX';\n        wigStyle.FGCOLOR = 'black';\n        wigStyle.BGCOLOR = 'red';\n        wigStyle.HEIGHT = 10;\n        wigStyle.BUMP = true;\n        wigStyle.ZINDEX = 20;\n        stylesheet.pushStyle({ type: 'translation' }, null, wigStyle);\n\n        var tsStyle = new DASStyle();\n        tsStyle.glyph = 'BOX';\n        tsStyle.FGCOLOR = 'black';\n        tsStyle.BGCOLOR = 'white';\n        tsStyle.HEIGHT = 10;\n        tsStyle.ZINDEX = 10;\n        tsStyle.BUMP = true;\n        tsStyle.LABEL = true;\n        stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n\n        var densStyle = new DASStyle();\n        densStyle.glyph = 'HISTOGRAM';\n        densStyle.COLOR1 = 'white';\n        densStyle.COLOR2 = 'black';\n        densStyle.HEIGHT = 30;\n        stylesheet.pushStyle({ type: 'density' }, null, densStyle);\n    }\n\n    return callback(stylesheet);\n};\n\ndalliance_registerParserFactory('bed', function (t) {\n    return new BedWigParser(t);\n});\ndalliance_registerParserFactory('wig', function (t) {\n    return new BedWigParser(t);\n});\n\n},{\"./das\":10,\"./sourceadapters\":39,\"./spans\":41,\"./utils\":56}],3:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// bigwig.js: indexed binary WIG (and BED) files\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var spans = require('./spans');\n    var Range = spans.Range;\n    var union = spans.union;\n    var intersection = spans.intersection;\n\n    var das = require('./das');\n    var DASFeature = das.DASFeature;\n    var DASGroup = das.DASGroup;\n\n    var utils = require('./utils');\n    var shallowCopy = utils.shallowCopy;\n\n    var bin = require('./bin');\n    var readInt = bin.readInt;\n\n    var jszlib = require('jszlib');\n    var jszlib_inflate_buffer = jszlib.inflateBuffer;\n    var arrayCopy = jszlib.arrayCopy;\n}\n\nvar BIG_WIG_MAGIC = 0x888FFC26;\nvar BIG_WIG_MAGIC_BE = 0x26FC8F88;\nvar BIG_BED_MAGIC = 0x8789F2EB;\nvar BIG_BED_MAGIC_BE = 0xEBF28987;\n\nvar BIG_WIG_TYPE_GRAPH = 1;\nvar BIG_WIG_TYPE_VSTEP = 2;\nvar BIG_WIG_TYPE_FSTEP = 3;\n\nvar M1 = 256;\nvar M2 = 256 * 256;\nvar M3 = 256 * 256 * 256;\nvar M4 = 256 * 256 * 256 * 256;\n\nvar BED_COLOR_REGEXP = new RegExp(\"^[0-9]+,[0-9]+,[0-9]+\");\n\nfunction bwg_readOffset(ba, o) {\n    var offset = ba[o] + ba[o + 1] * M1 + ba[o + 2] * M2 + ba[o + 3] * M3 + ba[o + 4] * M4;\n    return offset;\n}\n\nfunction BigWig() {}\n\nBigWig.prototype.readChromTree = function (callback) {\n    var thisB = this;\n    this.chromsToIDs = {};\n    this.idsToChroms = {};\n    this.maxID = 0;\n\n    var udo = this.unzoomedDataOffset;\n    var eb = udo - this.chromTreeOffset & 3;\n    udo = udo + 4 - eb;\n\n    this.data.slice(this.chromTreeOffset, udo - this.chromTreeOffset).fetch(function (bpt) {\n        var ba = new Uint8Array(bpt);\n        var sa = new Int16Array(bpt);\n        var la = new Int32Array(bpt);\n        var bptMagic = la[0];\n        var blockSize = la[1];\n        var keySize = la[2];\n        var valSize = la[3];\n        var itemCount = bwg_readOffset(ba, 16);\n        var rootNodeOffset = 32;\n\n        var bptReadNode = function bptReadNode(offset) {\n            var nodeType = ba[offset];\n            var cnt = sa[offset / 2 + 1];\n            offset += 4;\n            for (var n = 0; n < cnt; ++n) {\n                if (nodeType == 0) {\n                    offset += keySize;\n                    var childOffset = bwg_readOffset(ba, offset);\n                    offset += 8;\n                    childOffset -= thisB.chromTreeOffset;\n                    bptReadNode(childOffset);\n                } else {\n                    var key = '';\n                    for (var ki = 0; ki < keySize; ++ki) {\n                        var charCode = ba[offset++];\n                        if (charCode != 0) {\n                            key += String.fromCharCode(charCode);\n                        }\n                    }\n                    var chromId = ba[offset + 3] << 24 | ba[offset + 2] << 16 | ba[offset + 1] << 8 | ba[offset + 0];\n                    var chromSize = ba[offset + 7] << 24 | ba[offset + 6] << 16 | ba[offset + 5] << 8 | ba[offset + 4];\n                    offset += 8;\n\n                    thisB.chromsToIDs[key] = chromId;\n                    if (key.indexOf('chr') == 0) {\n                        thisB.chromsToIDs[key.substr(3)] = chromId;\n                    }\n                    thisB.idsToChroms[chromId] = key;\n                    thisB.maxID = Math.max(thisB.maxID, chromId);\n                }\n            }\n        };\n        bptReadNode(rootNodeOffset);\n\n        callback(thisB);\n    });\n};\n\nfunction BigWigView(bwg, cirTreeOffset, cirTreeLength, isSummary) {\n    this.bwg = bwg;\n    this.cirTreeOffset = cirTreeOffset;\n    this.cirTreeLength = cirTreeLength;\n    this.isSummary = isSummary;\n}\n\nBigWigView.prototype.readWigData = function (chrName, min, max, callback) {\n    var chr = this.bwg.chromsToIDs[chrName];\n    if (chr === undefined) {\n        // Not an error because some .bwgs won't have data for all chromosomes.\n        return callback([]);\n    } else {\n        this.readWigDataById(chr, min, max, callback);\n    }\n};\n\nBigWigView.prototype.readWigDataById = function (chr, min, max, callback) {\n    var thisB = this;\n    if (!this.cirHeader) {\n        this.bwg.data.slice(this.cirTreeOffset, 48).fetch(function (result) {\n            thisB.cirHeader = result;\n            var la = new Int32Array(thisB.cirHeader);\n            thisB.cirBlockSize = la[1];\n            thisB.readWigDataById(chr, min, max, callback);\n        });\n        return;\n    }\n\n    var blocksToFetch = [];\n    var outstanding = 0;\n\n    var beforeBWG = Date.now();\n\n    var filter = function filter(chromId, fmin, fmax, toks) {\n        return (chr < 0 || chromId == chr) && fmin <= max && fmax >= min;\n    };\n\n    var cirFobRecur = function cirFobRecur(offset, level) {\n        if (thisB.bwg.instrument) console.log('level=' + level + '; offset=' + offset + '; time=' + (Date.now() | 0));\n\n        outstanding += offset.length;\n\n        if (offset.length == 1 && offset[0] - thisB.cirTreeOffset == 48 && thisB.cachedCirRoot) {\n            cirFobRecur2(thisB.cachedCirRoot, 0, level);\n            --outstanding;\n            if (outstanding == 0) {\n                thisB.fetchFeatures(filter, blocksToFetch, callback);\n            }\n            return;\n        }\n\n        var maxCirBlockSpan = 4 + thisB.cirBlockSize * 32; // Upper bound on size, based on a completely full leaf node.\n        var spans;\n        for (var i = 0; i < offset.length; ++i) {\n            var blockSpan = new Range(offset[i], offset[i] + maxCirBlockSpan);\n            spans = spans ? union(spans, blockSpan) : blockSpan;\n        }\n\n        var fetchRanges = spans.ranges();\n        for (var r = 0; r < fetchRanges.length; ++r) {\n            var fr = fetchRanges[r];\n            cirFobStartFetch(offset, fr, level);\n        }\n    };\n\n    var cirFobStartFetch = function cirFobStartFetch(offset, fr, level, attempts) {\n        var length = fr.max() - fr.min();\n        thisB.bwg.data.slice(fr.min(), fr.max() - fr.min()).fetch(function (resultBuffer) {\n            for (var i = 0; i < offset.length; ++i) {\n                if (fr.contains(offset[i])) {\n                    cirFobRecur2(resultBuffer, offset[i] - fr.min(), level);\n\n                    if (offset[i] - thisB.cirTreeOffset == 48 && offset[i] - fr.min() == 0) thisB.cachedCirRoot = resultBuffer;\n\n                    --outstanding;\n                    if (outstanding == 0) {\n                        thisB.fetchFeatures(filter, blocksToFetch, callback);\n                    }\n                }\n            }\n        });\n    };\n\n    var cirFobRecur2 = function cirFobRecur2(cirBlockData, offset, level) {\n        var ba = new Uint8Array(cirBlockData);\n        var sa = new Int16Array(cirBlockData);\n        var la = new Int32Array(cirBlockData);\n\n        var isLeaf = ba[offset];\n        var cnt = sa[offset / 2 + 1];\n        offset += 4;\n\n        if (isLeaf != 0) {\n            for (var i = 0; i < cnt; ++i) {\n                var lo = offset / 4;\n                var startChrom = la[lo];\n                var startBase = la[lo + 1];\n                var endChrom = la[lo + 2];\n                var endBase = la[lo + 3];\n                var blockOffset = bwg_readOffset(ba, offset + 16);\n                var blockSize = bwg_readOffset(ba, offset + 24);\n                if ((chr < 0 || startChrom < chr || startChrom == chr && startBase <= max) && (chr < 0 || endChrom > chr || endChrom == chr && endBase >= min)) {\n                    blocksToFetch.push({ offset: blockOffset, size: blockSize });\n                }\n                offset += 32;\n            }\n        } else {\n            var recurOffsets = [];\n            for (var i = 0; i < cnt; ++i) {\n                var lo = offset / 4;\n                var startChrom = la[lo];\n                var startBase = la[lo + 1];\n                var endChrom = la[lo + 2];\n                var endBase = la[lo + 3];\n                var blockOffset = bwg_readOffset(ba, offset + 16);\n                if ((chr < 0 || startChrom < chr || startChrom == chr && startBase <= max) && (chr < 0 || endChrom > chr || endChrom == chr && endBase >= min)) {\n                    recurOffsets.push(blockOffset);\n                }\n                offset += 24;\n            }\n            if (recurOffsets.length > 0) {\n                cirFobRecur(recurOffsets, level + 1);\n            }\n        }\n    };\n\n    cirFobRecur([thisB.cirTreeOffset + 48], 1);\n};\n\nBigWigView.prototype.fetchFeatures = function (filter, blocksToFetch, callback) {\n    var thisB = this;\n\n    blocksToFetch.sort(function (b0, b1) {\n        return (b0.offset | 0) - (b1.offset | 0);\n    });\n\n    if (blocksToFetch.length == 0) {\n        callback([]);\n    } else {\n        var features = [];\n        var createFeature = function createFeature(chr, fmin, fmax, opts) {\n            if (!opts) {\n                opts = {};\n            }\n\n            var f = new DASFeature();\n            f._chromId = chr;\n            f.segment = thisB.bwg.idsToChroms[chr];\n            f.min = fmin;\n            f.max = fmax;\n            f.type = thisB.bwg.type;\n\n            for (var k in opts) {\n                f[k] = opts[k];\n            }\n\n            features.push(f);\n        };\n\n        var tramp = function tramp() {\n            if (blocksToFetch.length == 0) {\n                var afterBWG = Date.now();\n                // dlog('BWG fetch took ' + (afterBWG - beforeBWG) + 'ms');\n                callback(features);\n                return; // just in case...\n            } else {\n                var block = blocksToFetch[0];\n                if (block.data) {\n                    thisB.parseFeatures(block.data, createFeature, filter);\n                    blocksToFetch.splice(0, 1);\n                    tramp();\n                } else {\n                    var fetchStart = block.offset;\n                    var fetchSize = block.size;\n                    var bi = 1;\n                    while (bi < blocksToFetch.length && blocksToFetch[bi].offset == fetchStart + fetchSize) {\n                        fetchSize += blocksToFetch[bi].size;\n                        ++bi;\n                    }\n\n                    thisB.bwg.data.slice(fetchStart, fetchSize).fetch(function (result) {\n                        var offset = 0;\n                        var bi = 0;\n                        while (offset < fetchSize) {\n                            var fb = blocksToFetch[bi];\n\n                            var data;\n                            if (thisB.bwg.uncompressBufSize > 0) {\n                                data = jszlib_inflate_buffer(result, offset + 2, fb.size - 2);\n                            } else {\n                                var tmp = new Uint8Array(fb.size); // FIXME is this really the best we can do?\n                                arrayCopy(new Uint8Array(result, offset, fb.size), 0, tmp, 0, fb.size);\n                                data = tmp.buffer;\n                            }\n                            fb.data = data;\n\n                            offset += fb.size;\n                            ++bi;\n                        }\n                        tramp();\n                    });\n                }\n            }\n        };\n        tramp();\n    }\n};\n\nBigWigView.prototype.parseFeatures = function (data, createFeature, filter) {\n    var ba = new Uint8Array(data);\n\n    if (this.isSummary) {\n        var sa = new Int16Array(data);\n        var la = new Int32Array(data);\n        var fa = new Float32Array(data);\n\n        var itemCount = data.byteLength / 32;\n        for (var i = 0; i < itemCount; ++i) {\n            var chromId = la[i * 8];\n            var start = la[i * 8 + 1];\n            var end = la[i * 8 + 2];\n            var validCnt = la[i * 8 + 3];\n            var minVal = fa[i * 8 + 4];\n            var maxVal = fa[i * 8 + 5];\n            var sumData = fa[i * 8 + 6];\n            var sumSqData = fa[i * 8 + 7];\n\n            if (filter(chromId, start + 1, end)) {\n                var summaryOpts = { type: 'bigwig', score: sumData / validCnt, maxScore: maxVal };\n                if (this.bwg.type == 'bigbed') {\n                    summaryOpts.type = 'density';\n                }\n                createFeature(chromId, start + 1, end, summaryOpts);\n            }\n        }\n    } else if (this.bwg.type == 'bigwig') {\n        var sa = new Int16Array(data);\n        var la = new Int32Array(data);\n        var fa = new Float32Array(data);\n\n        var chromId = la[0];\n        var blockStart = la[1];\n        var blockEnd = la[2];\n        var itemStep = la[3];\n        var itemSpan = la[4];\n        var blockType = ba[20];\n        var itemCount = sa[11];\n\n        if (blockType == BIG_WIG_TYPE_FSTEP) {\n            for (var i = 0; i < itemCount; ++i) {\n                var score = fa[i + 6];\n                var fmin = blockStart + i * itemStep + 1,\n                    fmax = blockStart + i * itemStep + itemSpan;\n                if (filter(chromId, fmin, fmax)) createFeature(chromId, fmin, fmax, { score: score });\n            }\n        } else if (blockType == BIG_WIG_TYPE_VSTEP) {\n            for (var i = 0; i < itemCount; ++i) {\n                var start = la[i * 2 + 6] + 1;\n                var end = start + itemSpan - 1;\n                var score = fa[i * 2 + 7];\n                if (filter(chromId, start, end)) createFeature(chromId, start, end, { score: score });\n            }\n        } else if (blockType == BIG_WIG_TYPE_GRAPH) {\n            for (var i = 0; i < itemCount; ++i) {\n                var start = la[i * 3 + 6] + 1;\n                var end = la[i * 3 + 7];\n                var score = fa[i * 3 + 8];\n                if (start > end) {\n                    start = end;\n                }\n                if (filter(chromId, start, end)) createFeature(chromId, start, end, { score: score });\n            }\n        } else {\n            console.log('Currently not handling bwgType=' + blockType);\n        }\n    } else if (this.bwg.type == 'bigbed') {\n        var offset = 0;\n        var dfc = this.bwg.definedFieldCount;\n        var schema = this.bwg.schema;\n\n        while (offset < ba.length) {\n            var chromId = ba[offset + 3] << 24 | ba[offset + 2] << 16 | ba[offset + 1] << 8 | ba[offset + 0];\n            var start = ba[offset + 7] << 24 | ba[offset + 6] << 16 | ba[offset + 5] << 8 | ba[offset + 4];\n            var end = ba[offset + 11] << 24 | ba[offset + 10] << 16 | ba[offset + 9] << 8 | ba[offset + 8];\n            offset += 12;\n            var rest = '';\n            while (true) {\n                var ch = ba[offset++];\n                if (ch != 0) {\n                    rest += String.fromCharCode(ch);\n                } else {\n                    break;\n                }\n            }\n\n            var featureOpts = {};\n\n            var bedColumns;\n            if (rest.length > 0) {\n                bedColumns = rest.split('\\t');\n            } else {\n                bedColumns = [];\n            }\n            if (bedColumns.length > 0 && dfc > 3) {\n                featureOpts.label = bedColumns[0];\n            }\n            if (bedColumns.length > 1 && dfc > 4) {\n                var score = parseInt(bedColumns[1]);\n                if (!isNaN(score)) featureOpts.score = score;\n            }\n            if (bedColumns.length > 2 && dfc > 5) {\n                featureOpts.orientation = bedColumns[2];\n            }\n            if (bedColumns.length > 5 && dfc > 8) {\n                var color = bedColumns[5];\n                if (BED_COLOR_REGEXP.test(color)) {\n                    featureOpts.itemRgb = 'rgb(' + color + ')';\n                }\n            }\n\n            if (bedColumns.length > dfc - 3 && schema) {\n                for (var col = dfc - 3; col < bedColumns.length; ++col) {\n                    featureOpts[schema.fields[col + 3].name] = bedColumns[col];\n                }\n            }\n\n            if (filter(chromId, start + 1, end, bedColumns)) {\n                if (dfc < 12) {\n                    createFeature(chromId, start + 1, end, featureOpts);\n                } else {\n                    var thickStart = bedColumns[3] | 0;\n                    var thickEnd = bedColumns[4] | 0;\n                    var blockCount = bedColumns[6] | 0;\n                    var blockSizes = bedColumns[7].split(',');\n                    var blockStarts = bedColumns[8].split(',');\n\n                    if (featureOpts.exonFrames) {\n                        var exonFrames = featureOpts.exonFrames.split(',');\n                        featureOpts.exonFrames = undefined;\n                    }\n\n                    featureOpts.type = 'transcript';\n                    var grp = new DASGroup();\n                    for (var k in featureOpts) {\n                        grp[k] = featureOpts[k];\n                    }\n                    grp.id = bedColumns[0];\n                    grp.segment = this.bwg.idsToChroms[chromId];\n                    grp.min = start + 1;\n                    grp.max = end;\n                    grp.notes = [];\n                    featureOpts.groups = [grp];\n\n                    // Moving towards using bigGenePred model, but will\n                    // still support old Dalliance-style BED12+gene-name for the\n                    // foreseeable future.\n                    if (bedColumns.length > 9) {\n                        var geneId = featureOpts.geneName || bedColumns[9];\n                        var geneName = geneId;\n                        if (bedColumns.length > 10) {\n                            geneName = bedColumns[10];\n                        }\n                        if (featureOpts.geneName2) geneName = featureOpts.geneName2;\n\n                        var gg = shallowCopy(grp);\n                        gg.id = geneId;\n                        gg.label = geneName;\n                        gg.type = 'gene';\n                        featureOpts.groups.push(gg);\n                    }\n\n                    var spanList = [];\n                    for (var b = 0; b < blockCount; ++b) {\n                        var bmin = (blockStarts[b] | 0) + start;\n                        var bmax = bmin + (blockSizes[b] | 0);\n                        var span = new Range(bmin, bmax);\n                        spanList.push(span);\n                    }\n                    var spans = union(spanList);\n\n                    var tsList = spans.ranges();\n                    for (var s = 0; s < tsList.length; ++s) {\n                        var ts = tsList[s];\n                        createFeature(chromId, ts.min() + 1, ts.max(), featureOpts);\n                    }\n\n                    if (thickEnd > thickStart) {\n                        var codingRegion = featureOpts.orientation == '+' ? new Range(thickStart, thickEnd + 3) : new Range(thickStart - 3, thickEnd);\n                        // +/- 3 to account for stop codon\n\n                        var tl = intersection(spans, codingRegion);\n                        if (tl) {\n                            featureOpts.type = 'translation';\n                            var tlList = tl.ranges();\n                            var readingFrame = 0;\n\n                            var tlOffset = 0;\n                            while (tlList[0].min() > tsList[tlOffset].max()) {\n                                tlOffset++;\n                            }for (var s = 0; s < tlList.length; ++s) {\n                                // Record reading frame for every exon\n                                var index = s;\n                                if (featureOpts.orientation == '-') index = tlList.length - s - 1;\n                                var ts = tlList[index];\n                                featureOpts.readframe = readingFrame;\n                                if (exonFrames) {\n                                    var brf = parseInt(exonFrames[index + tlOffset]);\n                                    if (typeof brf === 'number' && brf >= 0 && brf <= 2) {\n                                        featureOpts.readframe = brf;\n                                        featureOpts.readframeExplicit = true;\n                                    }\n                                }\n                                var length = ts.max() - ts.min();\n                                readingFrame = (readingFrame + length) % 3;\n                                createFeature(chromId, ts.min() + 1, ts.max(), featureOpts);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    } else {\n        throw Error(\"Don't know what to do with \" + this.bwg.type);\n    }\n};\n\n//\n// nasty cut/paste, should roll back in!\n//\n\nBigWigView.prototype.getFirstAdjacent = function (chrName, pos, dir, callback) {\n    var chr = this.bwg.chromsToIDs[chrName];\n    if (chr === undefined) {\n        // Not an error because some .bwgs won't have data for all chromosomes.\n        return callback([]);\n    } else {\n        this.getFirstAdjacentById(chr, pos, dir, callback);\n    }\n};\n\nBigWigView.prototype.getFirstAdjacentById = function (chr, pos, dir, callback) {\n    var thisB = this;\n    if (!this.cirHeader) {\n        this.bwg.data.slice(this.cirTreeOffset, 48).fetch(function (result) {\n            thisB.cirHeader = result;\n            var la = new Int32Array(thisB.cirHeader);\n            thisB.cirBlockSize = la[1];\n            thisB.getFirstAdjacentById(chr, pos, dir, callback);\n        });\n        return;\n    }\n\n    var blockToFetch = null;\n    var bestBlockChr = -1;\n    var bestBlockOffset = -1;\n\n    var outstanding = 0;\n\n    var beforeBWG = Date.now();\n\n    var cirFobRecur = function cirFobRecur(offset, level) {\n        outstanding += offset.length;\n\n        var maxCirBlockSpan = 4 + thisB.cirBlockSize * 32; // Upper bound on size, based on a completely full leaf node.\n        var spans;\n        for (var i = 0; i < offset.length; ++i) {\n            var blockSpan = new Range(offset[i], offset[i] + maxCirBlockSpan);\n            spans = spans ? union(spans, blockSpan) : blockSpan;\n        }\n\n        var fetchRanges = spans.ranges();\n        for (var r = 0; r < fetchRanges.length; ++r) {\n            var fr = fetchRanges[r];\n            cirFobStartFetch(offset, fr, level);\n        }\n    };\n\n    var cirFobStartFetch = function cirFobStartFetch(offset, fr, level, attempts) {\n        var length = fr.max() - fr.min();\n        thisB.bwg.data.slice(fr.min(), fr.max() - fr.min()).fetch(function (resultBuffer) {\n            for (var i = 0; i < offset.length; ++i) {\n                if (fr.contains(offset[i])) {\n                    cirFobRecur2(resultBuffer, offset[i] - fr.min(), level);\n                    --outstanding;\n                    if (outstanding == 0) {\n                        if (!blockToFetch) {\n                            if (dir > 0 && (chr != 0 || pos > 0)) {\n                                return thisB.getFirstAdjacentById(0, 0, dir, callback);\n                            } else if (dir < 0 && (chr != thisB.bwg.maxID || pos < 1000000000)) {\n                                return thisB.getFirstAdjacentById(thisB.bwg.maxID, 1000000000, dir, callback);\n                            }\n                            return callback([]);\n                        }\n\n                        thisB.fetchFeatures(function (chrx, fmin, fmax, toks) {\n                            return dir < 0 && (chrx < chr || fmax < pos) || dir > 0 && (chrx > chr || fmin > pos);\n                        }, [blockToFetch], function (features) {\n                            var bestFeature = null;\n                            var bestChr = -1;\n                            var bestPos = -1;\n                            for (var fi = 0; fi < features.length; ++fi) {\n                                var f = features[fi];\n                                var chrx = f._chromId,\n                                    fmin = f.min,\n                                    fmax = f.max;\n                                if (bestFeature == null || dir < 0 && (chrx > bestChr || fmax > bestPos) || dir > 0 && (chrx < bestChr || fmin < bestPos)) {\n                                    bestFeature = f;\n                                    bestPos = dir < 0 ? fmax : fmin;\n                                    bestChr = chrx;\n                                }\n                            }\n\n                            if (bestFeature != null) return callback([bestFeature]);else return callback([]);\n                        });\n                    }\n                }\n            }\n        });\n    };\n\n    var cirFobRecur2 = function cirFobRecur2(cirBlockData, offset, level) {\n        var ba = new Uint8Array(cirBlockData);\n        var sa = new Int16Array(cirBlockData);\n        var la = new Int32Array(cirBlockData);\n\n        var isLeaf = ba[offset];\n        var cnt = sa[offset / 2 + 1];\n        offset += 4;\n\n        if (isLeaf != 0) {\n            for (var i = 0; i < cnt; ++i) {\n                var lo = offset / 4;\n                var startChrom = la[lo];\n                var startBase = la[lo + 1];\n                var endChrom = la[lo + 2];\n                var endBase = la[lo + 3];\n                var blockOffset = bwg_readOffset(ba, offset + 16);\n                var blockSize = bwg_readOffset(ba, offset + 24);\n                if (dir < 0 && (startChrom < chr || startChrom == chr && startBase <= pos) || dir > 0 && (endChrom > chr || endChrom == chr && endBase >= pos)) {\n                    // console.log('Got an interesting block: startBase=' + startChrom + ':' + startBase + '; endBase=' + endChrom + ':' + endBase + '; offset=' + blockOffset + '; size=' + blockSize);\n                    if (/_random/.exec(thisB.bwg.idsToChroms[startChrom])) {\n                        // dlog('skipping random: ' + thisB.bwg.idsToChroms[startChrom]);\n                    } else if (blockToFetch == null || dir < 0 && (endChrom > bestBlockChr || endChrom == bestBlockChr && endBase > bestBlockOffset) || dir > 0 && (startChrom < bestBlockChr || startChrom == bestBlockChr && startBase < bestBlockOffset)) {\n                        //                        dlog('best is: startBase=' + startChrom + ':' + startBase + '; endBase=' + endChrom + ':' + endBase + '; offset=' + blockOffset + '; size=' + blockSize);\n                        blockToFetch = { offset: blockOffset, size: blockSize };\n                        bestBlockOffset = dir < 0 ? endBase : startBase;\n                        bestBlockChr = dir < 0 ? endChrom : startChrom;\n                    }\n                }\n                offset += 32;\n            }\n        } else {\n            var bestRecur = -1;\n            var bestPos = -1;\n            var bestChr = -1;\n            for (var i = 0; i < cnt; ++i) {\n                var lo = offset / 4;\n                var startChrom = la[lo];\n                var startBase = la[lo + 1];\n                var endChrom = la[lo + 2];\n                var endBase = la[lo + 3];\n                var blockOffset = la[lo + 4] << 32 | la[lo + 5];\n                if (dir < 0 && (startChrom < chr || startChrom == chr && startBase <= pos) && endChrom >= chr || dir > 0 && (endChrom > chr || endChrom == chr && endBase >= pos) && startChrom <= chr) {\n                    if (bestRecur < 0 || endBase > bestPos) {\n                        bestRecur = blockOffset;\n                        bestPos = dir < 0 ? endBase : startBase;\n                        bestChr = dir < 0 ? endChrom : startChrom;\n                    }\n                }\n                offset += 24;\n            }\n            if (bestRecur >= 0) {\n                cirFobRecur([bestRecur], level + 1);\n            }\n        }\n    };\n\n    cirFobRecur([thisB.cirTreeOffset + 48], 1);\n};\n\nBigWig.prototype.readWigData = function (chrName, min, max, callback) {\n    this.getUnzoomedView().readWigData(chrName, min, max, callback);\n};\n\nBigWig.prototype.getUnzoomedView = function () {\n    if (!this.unzoomedView) {\n        var cirLen = 4000;\n        var nzl = this.zoomLevels[0];\n        if (nzl) {\n            cirLen = this.zoomLevels[0].dataOffset - this.unzoomedIndexOffset;\n        }\n        this.unzoomedView = new BigWigView(this, this.unzoomedIndexOffset, cirLen, false);\n    }\n    return this.unzoomedView;\n};\n\nBigWig.prototype.getZoomedView = function (z) {\n    var zh = this.zoomLevels[z];\n    if (!zh.view) {\n        zh.view = new BigWigView(this, zh.indexOffset, /* this.zoomLevels[z + 1].dataOffset - zh.indexOffset */4000, true);\n    }\n    return zh.view;\n};\n\nfunction makeBwg(data, callback, name) {\n    var bwg = new BigWig();\n    bwg.data = data;\n    bwg.name = name;\n    bwg.data.slice(0, 512).salted().fetch(function (result) {\n        if (!result) {\n            return callback(null, \"Couldn't fetch file\");\n        }\n\n        var header = result;\n        var ba = new Uint8Array(header);\n        var sa = new Int16Array(header);\n        var la = new Int32Array(header);\n        var magic = ba[0] + M1 * ba[1] + M2 * ba[2] + M3 * ba[3];\n        if (magic == BIG_WIG_MAGIC) {\n            bwg.type = 'bigwig';\n        } else if (magic == BIG_BED_MAGIC) {\n            bwg.type = 'bigbed';\n        } else if (magic == BIG_WIG_MAGIC_BE || magic == BIG_BED_MAGIC_BE) {\n            return callback(null, \"Currently don't support big-endian BBI files\");\n        } else {\n            return callback(null, \"Not a supported format, magic=0x\" + magic.toString(16));\n        }\n\n        bwg.version = sa[2]; // 4\n        bwg.numZoomLevels = sa[3]; // 6\n        bwg.chromTreeOffset = bwg_readOffset(ba, 8);\n        bwg.unzoomedDataOffset = bwg_readOffset(ba, 16);\n        bwg.unzoomedIndexOffset = bwg_readOffset(ba, 24);\n        bwg.fieldCount = sa[16]; // 32\n        bwg.definedFieldCount = sa[17]; // 34\n        bwg.asOffset = bwg_readOffset(ba, 36);\n        bwg.totalSummaryOffset = bwg_readOffset(ba, 44);\n        bwg.uncompressBufSize = la[13]; // 52\n        bwg.extHeaderOffset = bwg_readOffset(ba, 56);\n\n        bwg.zoomLevels = [];\n        for (var zl = 0; zl < bwg.numZoomLevels; ++zl) {\n            var zlReduction = la[zl * 6 + 16];\n            var zlData = bwg_readOffset(ba, zl * 24 + 72);\n            var zlIndex = bwg_readOffset(ba, zl * 24 + 80);\n            bwg.zoomLevels.push({ reduction: zlReduction, dataOffset: zlData, indexOffset: zlIndex });\n        }\n\n        bwg.readChromTree(function () {\n            bwg.getAutoSQL(function (as) {\n                bwg.schema = as;\n                return callback(bwg);\n            });\n        });\n    }, { timeout: 5000 }); // Potential timeout on first request to catch mixed-content errors on\n    // Chromium.\n}\n\nBigWig.prototype._tsFetch = function (zoom, chr, min, max, callback) {\n    var bwg = this;\n    if (zoom >= this.zoomLevels.length - 1) {\n        if (!this.topLevelReductionCache) {\n            this.getZoomedView(this.zoomLevels.length - 1).readWigDataById(-1, 0, 300000000, function (feats) {\n                bwg.topLevelReductionCache = feats;\n                return bwg._tsFetch(zoom, chr, min, max, callback);\n            });\n        } else {\n            var f = [];\n            var c = this.topLevelReductionCache;\n            for (var fi = 0; fi < c.length; ++fi) {\n                if (c[fi]._chromId == chr) {\n                    f.push(c[fi]);\n                }\n            }\n            return callback(f);\n        }\n    } else {\n        var view;\n        if (zoom < 0) {\n            view = this.getUnzoomedView();\n        } else {\n            view = this.getZoomedView(zoom);\n        }\n        return view.readWigDataById(chr, min, max, callback);\n    }\n};\n\nBigWig.prototype.thresholdSearch = function (chrName, referencePoint, dir, threshold, callback) {\n    dir = dir < 0 ? -1 : 1;\n    var bwg = this;\n    var initialChr = this.chromsToIDs[chrName];\n    var candidates = [{ chrOrd: 0, chr: initialChr, zoom: bwg.zoomLevels.length - 4, min: 0, max: 300000000, fromRef: true }];\n    for (var i = 1; i <= this.maxID + 1; ++i) {\n        var chrId = (initialChr + dir * i) % (this.maxID + 1);\n        if (chrId < 0) chrId += this.maxID + 1;\n        candidates.push({ chrOrd: i, chr: chrId, zoom: bwg.zoomLevels.length - 1, min: 0, max: 300000000 });\n    }\n\n    function fbThresholdSearchRecur() {\n        if (candidates.length == 0) {\n            return callback(null);\n        }\n        candidates.sort(function (c1, c2) {\n            var d = c1.zoom - c2.zoom;\n            if (d != 0) return d;\n\n            d = c1.chrOrd - c2.chrOrd;\n            if (d != 0) return d;else return c1.min - c2.min * dir;\n        });\n\n        var candidate = candidates.splice(0, 1)[0];\n        bwg._tsFetch(candidate.zoom, candidate.chr, candidate.min, candidate.max, function (feats) {\n            var rp = dir > 0 ? 0 : 300000000;\n            if (candidate.fromRef) rp = referencePoint;\n\n            for (var fi = 0; fi < feats.length; ++fi) {\n                var f = feats[fi];\n                var score;\n                if (f.maxScore != undefined) score = f.maxScore;else score = f.score;\n\n                if (dir > 0) {\n                    if (score > threshold) {\n                        if (candidate.zoom < 0) {\n                            if (f.min > rp) return callback(f);\n                        } else if (f.max > rp) {\n                            candidates.push({ chr: candidate.chr, chrOrd: candidate.chrOrd, zoom: candidate.zoom - 2, min: f.min, max: f.max, fromRef: candidate.fromRef });\n                        }\n                    }\n                } else {\n                    if (score > threshold) {\n                        if (candidate.zoom < 0) {\n                            if (f.max < rp) return callback(f);\n                        } else if (f.min < rp) {\n                            candidates.push({ chr: candidate.chr, chrOrd: candidate.chrOrd, zoom: candidate.zoom - 2, min: f.min, max: f.max, fromRef: candidate.fromRef });\n                        }\n                    }\n                }\n            }\n            fbThresholdSearchRecur();\n        });\n    }\n\n    fbThresholdSearchRecur();\n};\n\nBigWig.prototype.getAutoSQL = function (callback) {\n    var thisB = this;\n    if (!this.asOffset) return callback(null);\n\n    this.data.slice(this.asOffset, 2048).fetch(function (result) {\n        var ba = new Uint8Array(result);\n        var s = '';\n        for (var i = 0; i < ba.length; ++i) {\n            if (ba[i] == 0) break;\n            s += String.fromCharCode(ba[i]);\n        }\n\n        /* \n         * Quick'n'dirty attempt to parse autoSql format.\n         * See: http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/059/5949/5949l2.html\n         */\n\n        var header_re = /(\\w+)\\s+(\\w+)\\s+(\"([^\"]+)\")?\\s+\\(\\s*/;\n        var field_re = /([\\w\\[\\]]+)\\s+(\\w+)\\s*;\\s*(\"([^\"]+)\")?\\s*/g;\n\n        var headerMatch = header_re.exec(s);\n        if (headerMatch) {\n            var as = {\n                declType: headerMatch[1],\n                name: headerMatch[2],\n                comment: headerMatch[4],\n\n                fields: []\n            };\n\n            s = s.substring(headerMatch[0]);\n            for (var m = field_re.exec(s); m != null; m = field_re.exec(s)) {\n                as.fields.push({ type: m[1],\n                    name: m[2],\n                    comment: m[4] });\n            }\n\n            return callback(as);\n        }\n    });\n};\n\nBigWig.prototype.getExtraIndices = function (callback) {\n    var thisB = this;\n    if (this.version < 4 || this.extHeaderOffset == 0 || this.type != 'bigbed') {\n        return callback(null);\n    } else {\n        this.data.slice(this.extHeaderOffset, 64).fetch(function (result) {\n            if (!result) {\n                return callback(null, \"Couldn't fetch extension header\");\n            }\n\n            var ba = new Uint8Array(result);\n            var sa = new Int16Array(result);\n            var la = new Int32Array(result);\n\n            var extHeaderSize = sa[0];\n            var extraIndexCount = sa[1];\n            var extraIndexListOffset = bwg_readOffset(ba, 4);\n\n            if (extraIndexCount == 0) {\n                return callback(null);\n            }\n\n            // FIXME 20byte records only make sense for single-field indices.\n            // Right now, these seem to be the only things around, but the format\n            // is actually more general.\n            thisB.data.slice(extraIndexListOffset, extraIndexCount * 20).fetch(function (eil) {\n                if (!eil) {\n                    return callback(null, \"Couldn't fetch index info\");\n                }\n\n                var ba = new Uint8Array(eil);\n                var sa = new Int16Array(eil);\n                var la = new Int32Array(eil);\n\n                var indices = [];\n                for (var ii = 0; ii < extraIndexCount; ++ii) {\n                    var eiType = sa[ii * 10];\n                    var eiFieldCount = sa[ii * 10 + 1];\n                    var eiOffset = bwg_readOffset(ba, ii * 20 + 4);\n                    var eiField = sa[ii * 10 + 8];\n                    var index = new BBIExtraIndex(thisB, eiType, eiFieldCount, eiOffset, eiField);\n                    indices.push(index);\n                }\n                callback(indices);\n            });\n        });\n    }\n};\n\nfunction BBIExtraIndex(bbi, type, fieldCount, offset, field) {\n    this.bbi = bbi;\n    this.type = type;\n    this.fieldCount = fieldCount;\n    this.offset = offset;\n    this.field = field;\n}\n\nBBIExtraIndex.prototype.lookup = function (name, callback) {\n    var thisB = this;\n\n    this.bbi.data.slice(this.offset, 32).fetch(function (bpt) {\n        var ba = new Uint8Array(bpt);\n        var sa = new Int16Array(bpt);\n        var la = new Int32Array(bpt);\n        var bptMagic = la[0];\n        var blockSize = la[1];\n        var keySize = la[2];\n        var valSize = la[3];\n        var itemCount = bwg_readOffset(ba, 16);\n        var rootNodeOffset = 32;\n\n        function bptReadNode(nodeOffset) {\n            thisB.bbi.data.slice(nodeOffset, 4 + blockSize * (keySize + valSize)).fetch(function (node) {\n                var ba = new Uint8Array(node);\n                var sa = new Uint16Array(node);\n                var la = new Uint32Array(node);\n\n                var nodeType = ba[0];\n                var cnt = sa[1];\n\n                var offset = 4;\n                if (nodeType == 0) {\n                    var lastChildOffset = null;\n                    for (var n = 0; n < cnt; ++n) {\n                        var key = '';\n                        for (var ki = 0; ki < keySize; ++ki) {\n                            var charCode = ba[offset++];\n                            if (charCode != 0) {\n                                key += String.fromCharCode(charCode);\n                            }\n                        }\n\n                        var childOffset = bwg_readOffset(ba, offset);\n                        offset += 8;\n\n                        if (name.localeCompare(key) < 0 && lastChildOffset) {\n                            bptReadNode(lastChildOffset);\n                            return;\n                        }\n                        lastChildOffset = childOffset;\n                    }\n                    bptReadNode(lastChildOffset);\n                } else {\n                    for (var n = 0; n < cnt; ++n) {\n                        var key = '';\n                        for (var ki = 0; ki < keySize; ++ki) {\n                            var charCode = ba[offset++];\n                            if (charCode != 0) {\n                                key += String.fromCharCode(charCode);\n                            }\n                        }\n\n                        // Specific for EI case.\n                        if (key == name) {\n                            var start = bwg_readOffset(ba, offset);\n                            var length = readInt(ba, offset + 8);\n\n                            return thisB.bbi.getUnzoomedView().fetchFeatures(function (chr, min, max, toks) {\n                                if (toks && toks.length > thisB.field - 3) return toks[thisB.field - 3] == name;\n                            }, [{ offset: start, size: length }], callback);\n                        }\n                        offset += valSize;\n                    }\n                    return callback([]);\n                }\n            });\n        }\n\n        bptReadNode(thisB.offset + rootNodeOffset);\n    });\n};\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        makeBwg: makeBwg,\n        BIG_BED_MAGIC: BIG_BED_MAGIC,\n        BIG_WIG_MAGIC: BIG_WIG_MAGIC\n    };\n}\n\n},{\"./bin\":4,\"./das\":10,\"./spans\":41,\"./utils\":56,\"jszlib\":385}],4:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// bin.js general binary data support\n//\n\n\"use strict\";\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\nif (typeof require !== 'undefined') {\n    var utils = require('./utils');\n    var shallowCopy = utils.shallowCopy;\n\n    var sha1 = require('./sha1');\n    var b64_sha1 = sha1.b64_sha1;\n\n    var Promise = require('es6-promise').Promise;\n}\n\nfunction BlobFetchable(b) {\n    this.blob = b;\n}\n\nBlobFetchable.prototype.slice = function (start, length) {\n    var b;\n\n    if (this.blob.slice) {\n        if (length) {\n            b = this.blob.slice(start, start + length);\n        } else {\n            b = this.blob.slice(start);\n        }\n    } else {\n        if (length) {\n            b = this.blob.webkitSlice(start, start + length);\n        } else {\n            b = this.blob.webkitSlice(start);\n        }\n    }\n    return new BlobFetchable(b);\n};\n\nBlobFetchable.prototype.salted = function () {\n    return this;\n};\n\nif (typeof FileReader !== 'undefined') {\n    // console.log('defining async BlobFetchable.fetch');\n\n    BlobFetchable.prototype.fetch = function (callback) {\n        var reader = new FileReader();\n        reader.onloadend = function (ev) {\n            callback(bstringToBuffer(reader.result));\n        };\n        reader.readAsBinaryString(this.blob);\n    };\n} else {\n    // if (console && console.log)\n    //    console.log('defining sync BlobFetchable.fetch');\n\n    BlobFetchable.prototype.fetch = function (callback) {\n        var reader = new FileReaderSync();\n        try {\n            var res = reader.readAsArrayBuffer(this.blob);\n            callback(res);\n        } catch (e) {\n            callback(null, e);\n        }\n    };\n}\n\nfunction URLFetchable(url, start, end, opts) {\n    if (!opts) {\n        if ((typeof start === 'undefined' ? 'undefined' : _typeof(start)) === 'object') {\n            opts = start;\n            start = undefined;\n        } else {\n            opts = {};\n        }\n    }\n\n    this.url = url;\n    this.start = start || 0;\n    if (end) {\n        this.end = end;\n    }\n    this.opts = opts;\n}\n\nURLFetchable.prototype.slice = function (s, l) {\n    if (s < 0) {\n        throw 'Bad slice ' + s;\n    }\n\n    var ns = this.start,\n        ne = this.end;\n    if (ns && s) {\n        ns = ns + s;\n    } else {\n        ns = s || ns;\n    }\n    if (l && ns) {\n        ne = ns + l - 1;\n    } else {\n        ne = ne || l - 1;\n    }\n    return new URLFetchable(this.url, ns, ne, this.opts);\n};\n\nvar seed = 0;\nvar isSafari = typeof navigator !== 'undefined' && navigator.userAgent.indexOf('Safari') >= 0 && navigator.userAgent.indexOf('Chrome') < 0;\n\nURLFetchable.prototype.fetchAsText = function (callback) {\n    var thisB = this;\n\n    this.getURL().then(function (url) {\n        try {\n            var req = new XMLHttpRequest();\n            var length;\n            if ((isSafari || thisB.opts.salt) && url.indexOf('?') < 0) {\n                url = url + '?salt=' + b64_sha1('' + Date.now() + ',' + ++seed);\n            }\n            req.open('GET', url, true);\n\n            if (thisB.end) {\n                if (thisB.end - thisB.start > 100000000) {\n                    throw 'Monster fetch!';\n                }\n                req.setRequestHeader('Range', 'bytes=' + thisB.start + '-' + thisB.end);\n                length = thisB.end - thisB.start + 1;\n            }\n\n            req.onreadystatechange = function () {\n                if (req.readyState == 4) {\n                    if (req.status == 200 || req.status == 206) {\n                        return callback(req.responseText);\n                    } else {\n                        return callback(null);\n                    }\n                }\n            };\n            if (thisB.opts.credentials) {\n                req.withCredentials = true;\n            }\n            req.send();\n        } catch (e) {\n            return callback(null);\n        }\n    }).catch(function (err) {\n        console.log(err);\n        return callback(null, err);\n    });\n};\n\nURLFetchable.prototype.salted = function () {\n    var o = shallowCopy(this.opts);\n    o.salt = true;\n    return new URLFetchable(this.url, this.start, this.end, o);\n};\n\nURLFetchable.prototype.getURL = function () {\n    if (this.opts.resolver) {\n        return this.opts.resolver(this.url).then(function (urlOrObj) {\n            if (typeof urlOrObj === 'string') {\n                return urlOrObj;\n            } else {\n                return urlOrObj.url;\n            }\n        });\n    } else {\n        return Promise.resolve(this.url);\n    }\n};\n\nURLFetchable.prototype.fetch = function (callback, opts) {\n    var thisB = this;\n\n    opts = opts || {};\n    var attempt = opts.attempt || 1;\n    var truncatedLength = opts.truncatedLength;\n    if (attempt > 3) {\n        return callback(null);\n    }\n\n    this.getURL().then(function (url) {\n        try {\n            var timeout;\n            if (opts.timeout && !thisB.opts.credentials) {\n                timeout = setTimeout(function () {\n                    console.log('timing out ' + url);\n                    req.abort();\n                    return callback(null, 'Timeout');\n                }, opts.timeout);\n            }\n\n            var req = new XMLHttpRequest();\n            var length;\n            if ((isSafari || thisB.opts.salt) && url.indexOf('?') < 0) {\n                url = url + '?salt=' + b64_sha1('' + Date.now() + ',' + ++seed);\n            }\n            req.open('GET', url, true);\n            req.overrideMimeType('text/plain; charset=x-user-defined');\n            if (thisB.end) {\n                if (thisB.end - thisB.start > 100000000) {\n                    throw 'Monster fetch!';\n                }\n                req.setRequestHeader('Range', 'bytes=' + thisB.start + '-' + thisB.end);\n                length = thisB.end - thisB.start + 1;\n            }\n            req.responseType = 'arraybuffer';\n            req.onreadystatechange = function () {\n                if (req.readyState == 4) {\n                    if (timeout) clearTimeout(timeout);\n                    if (req.status == 200 || req.status == 206) {\n                        if (req.response) {\n                            var bl = req.response.byteLength;\n                            if (length && length != bl && (!truncatedLength || bl != truncatedLength)) {\n                                return thisB.fetch(callback, { attempt: attempt + 1, truncatedLength: bl });\n                            } else {\n                                return callback(req.response);\n                            }\n                        } else if (req.mozResponseArrayBuffer) {\n                            return callback(req.mozResponseArrayBuffer);\n                        } else {\n                            var r = req.responseText;\n                            if (length && length != r.length && (!truncatedLength || r.length != truncatedLength)) {\n                                return thisB.fetch(callback, { attempt: attempt + 1, truncatedLength: r.length });\n                            } else {\n                                return callback(bstringToBuffer(req.responseText));\n                            }\n                        }\n                    } else {\n                        return thisB.fetch(callback, { attempt: attempt + 1 });\n                    }\n                }\n            };\n            if (thisB.opts.credentials) {\n                req.withCredentials = true;\n            }\n            req.send();\n        } catch (e) {\n            return callback(null);\n        }\n    }).catch(function (err) {\n        console.log(err);\n        return callback(null, err);\n    });\n};\n\nfunction bstringToBuffer(result) {\n    if (!result) {\n        return null;\n    }\n\n    var ba = new Uint8Array(result.length);\n    for (var i = 0; i < ba.length; ++i) {\n        ba[i] = result.charCodeAt(i);\n    }\n    return ba.buffer;\n}\n\n// Read from Uint8Array\n\nvar convertBuffer = new ArrayBuffer(8);\nvar ba = new Uint8Array(convertBuffer);\nvar fa = new Float32Array(convertBuffer);\n\nfunction readFloat(buf, offset) {\n    ba[0] = buf[offset];\n    ba[1] = buf[offset + 1];\n    ba[2] = buf[offset + 2];\n    ba[3] = buf[offset + 3];\n    return fa[0];\n}\n\nfunction readInt64(ba, offset) {\n    return ba[offset + 7] << 24 | ba[offset + 6] << 16 | ba[offset + 5] << 8 | ba[offset + 4];\n}\n\nfunction readInt(ba, offset) {\n    return ba[offset + 3] << 24 | ba[offset + 2] << 16 | ba[offset + 1] << 8 | ba[offset];\n}\n\nfunction readShort(ba, offset) {\n    return ba[offset + 1] << 8 | ba[offset];\n}\n\nfunction readByte(ba, offset) {\n    return ba[offset];\n}\n\nfunction readIntBE(ba, offset) {\n    return ba[offset] << 24 | ba[offset + 1] << 16 | ba[offset + 2] << 8 | ba[offset + 3];\n}\n\n// Exports if we are being used as a module\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        BlobFetchable: BlobFetchable,\n        URLFetchable: URLFetchable,\n\n        readInt: readInt,\n        readIntBE: readIntBE,\n        readInt64: readInt64,\n        readShort: readShort,\n        readByte: readByte,\n        readFloat: readFloat\n    };\n}\n\n},{\"./sha1\":38,\"./utils\":56,\"es6-promise\":384}],5:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// browser-us.js: standard UI wiring\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var browser = require('./cbrowser');\n    var Browser = browser.Browser;\n\n    var utils = require('./utils');\n    var makeElement = utils.makeElement;\n    var removeChildren = utils.removeChildren;\n\n    var nf = require('./numformats');\n    var formatLongInt = nf.formatLongInt;\n\n    var makeZoomSlider = require('./zoomslider');\n\n    // For side effects\n\n    require('./tier-edit');\n    require('./export-config');\n    require('./export-ui');\n    require('./export-image');\n    require('./svg-export');\n    require('./session');\n}\n\n/*\n * Quite a bit of this ought to be done using a templating system, but\n * since web-components isn't quite ready for prime time yet we'll stick\n * with constructing it all in Javascript for now...\n */\n\nBrowser.prototype.initUI = function (holder, genomePanel) {\n    if (!this.noSourceCSS) {\n        ['bootstrap-scoped.css', 'dalliance-scoped.css', 'font-awesome.min.css'].forEach(function (path) {\n            document.head.appendChild(makeElement('link', '', {\n                rel: 'stylesheet',\n                href: this.resolveURL('$$css/' + path)\n            }));\n        }.bind(this));\n    }\n\n    var b = this;\n\n    if (!b.disableDefaultFeaturePopup) {\n        this.addFeatureListener(function (ev, feature, hit, tier) {\n            b.featurePopup(ev, feature, hit, tier);\n        });\n    }\n\n    holder.classList.add('dalliance');\n    var toolbar = b.toolbar = makeElement('div', null, { className: 'btn-toolbar toolbar' });\n\n    var title = b.coordSystem.speciesName + ' ' + b.nameForCoordSystem(b.coordSystem);\n    if (this.setDocumentTitle) {\n        document.title = title + ' :: dalliance';\n    }\n\n    var locField = makeElement('input', '', { className: 'loc-field' });\n    b.makeTooltip(locField, 'Enter a genomic location or gene name');\n    var locStatusField = makeElement('p', '', { className: 'loc-status' });\n\n    var zoomInBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-search-plus' })], { className: 'btn' });\n    var zoomSlider = new makeZoomSlider({ width: b.zoomSliderWidth });\n    b.makeTooltip(zoomSlider, \"Highlighted button shows current zoom level, gray button shows inactive zoom level (click or tap SPACE to toggle).\");\n\n    var zoomOutBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-search-minus' })], { className: 'btn' });\n\n    var clearHighlightsButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-eraser' })], { className: 'btn' });\n\n    var addTrackBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-plus' })], { className: 'btn' });\n    var favBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-bookmark' })], { className: 'btn' });\n    var svgBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-print' })], { className: 'btn' });\n    var resetBtn = makeElement('a', [makeElement('i', null, { className: 'fa fa-refresh' })], { className: 'btn' });\n    var optsButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-cogs' })], { className: 'btn' });\n    var helpButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-question' })], { className: 'btn' });\n\n    var tierEditButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-road' })], { className: 'btn' });\n    b.makeTooltip(tierEditButton, 'Configure currently selected track(s) (E)');\n\n    var leapLeftButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-angle-left' })], { className: 'btn' }, { width: '5px' });\n    var leapRightButton = makeElement('a', [makeElement('i', null, { className: 'fa fa-angle-right' })], { className: 'btn pull-right' }, { width: '5px' });\n\n    var modeButtons = makeElement('div', null, { className: 'btn-group pull-right' });\n    if (!this.noTrackAdder) modeButtons.appendChild(addTrackBtn);\n    if (!this.noTrackEditor) modeButtons.appendChild(tierEditButton);\n    if (!this.noExport) modeButtons.appendChild(svgBtn);\n    if (!this.noOptions) modeButtons.appendChild(optsButton);\n    if (!this.noHelp) modeButtons.appendChild(helpButton);\n\n    this.setUiMode = function (m) {\n        this.uiMode = m;\n        var mb = { help: helpButton, add: addTrackBtn, opts: optsButton, 'export': svgBtn, tier: tierEditButton };\n        for (var x in mb) {\n            if (x == m) mb[x].classList.add('active');else mb[x].classList.remove('active');\n        }\n    };\n\n    if (!this.noLeapButtons) toolbar.appendChild(leapRightButton);\n\n    if (modeButtons.firstChild) toolbar.appendChild(modeButtons);\n\n    if (!this.noLeapButtons) toolbar.appendChild(leapLeftButton);\n    if (!this.noTitle) {\n        toolbar.appendChild(makeElement('div', makeElement('h4', title, {}, { margin: '0px' }), { className: 'btn-group title' }));\n    }\n    if (!this.noLocationField) toolbar.appendChild(makeElement('div', [locField, locStatusField], { className: 'btn-group loc-group' }));\n    if (!this.noClearHighlightsButton) toolbar.appendChild(clearHighlightsButton);\n\n    if (!this.noZoomSlider) {\n        toolbar.appendChild(makeElement('div', [zoomInBtn, makeElement('span', zoomSlider, { className: 'btn' }), zoomOutBtn], { className: 'btn-group' }));\n    }\n\n    if (this.toolbarBelow) {\n        holder.appendChild(genomePanel);\n        holder.appendChild(toolbar);\n    } else {\n        holder.appendChild(toolbar);\n        holder.appendChild(genomePanel);\n    }\n\n    var lt2 = Math.log(2) / Math.log(10);\n    var lt5 = Math.log(5) / Math.log(10);\n    var roundSliderValue = function roundSliderValue(x) {\n        var ltx = (x / b.zoomExpt + Math.log(b.zoomBase)) / Math.log(10);\n\n        var whole = ltx | 0;\n        var frac = ltx - whole;\n        var rounded;\n\n        if (frac < 0.01) rounded = whole;else if (frac <= lt2 + 0.01) rounded = whole + lt2;else if (frac <= lt5 + 0.01) rounded = whole + lt5;else {\n            rounded = whole + 1;\n        }\n\n        return (rounded * Math.log(10) - Math.log(b.zoomBase)) * b.zoomExpt;\n    };\n\n    var markSlider = function markSlider(x) {\n        zoomSlider.addLabel(x, humanReadableScale(Math.exp(x / b.zoomExpt) * b.zoomBase));\n    };\n\n    this.addViewListener(function (chr, min, max, _oldZoom, zoom) {\n        locField.value = chr + ':' + formatLongInt(min) + '..' + formatLongInt(max);\n        zoomSlider.min = zoom.min | 0;\n        zoomSlider.max = zoom.max | 0;\n        if (zoom.isSnapZooming) {\n            zoomSlider.value = zoom.alternate;\n            zoomSlider.value2 = zoom.current;\n            zoomSlider.active = 2;\n        } else {\n            zoomSlider.value = zoom.current;\n            zoomSlider.value2 = zoom.alternate;\n            zoomSlider.active = 1;\n        }\n\n        if (zoom.current == zoom.min) zoomInBtn.classList.add('disabled');else zoomInBtn.classList.remove('disabled');\n\n        if (zoom.current == zoom.max) zoomOutBtn.classList.add('disabled');else zoomOutBtn.classList.remove('disabled');\n\n        zoomSlider.removeLabels();\n        var zmin = zoom.min;\n        var zmax = zoom.max;\n        var zrange = zmax - zmin;\n\n        var numSliderTicks = 4;\n        if (b.zoomSliderWidth && b.zoomSliderWidth < 150) numSliderTicks = 3;\n        markSlider(roundSliderValue(zmin));\n        for (var sti = 1; sti < numSliderTicks - 1; ++sti) {\n            markSlider(roundSliderValue(zmin + 1.0 * sti * zrange / (numSliderTicks - 1)));\n        }\n        markSlider(roundSliderValue(zmax));\n\n        if (b.storeStatus) {\n            b.storeViewStatus();\n        }\n\n        if (b.highlights.length > 0) {\n            clearHighlightsButton.style.display = 'inline-block';\n        } else {\n            clearHighlightsButton.style.display = 'none';\n        }\n    });\n\n    this.addTierListener(function () {\n        if (b.storeStatus) {\n            b.storeTierStatus();\n        }\n    });\n\n    locField.addEventListener('keydown', function (ev) {\n        if (ev.keyCode == 40) {\n            ev.preventDefault();ev.stopPropagation();\n            b.setSelectedTier(0);\n        }if (ev.keyCode == 10 || ev.keyCode == 13) {\n            ev.preventDefault();\n\n            var g = locField.value;\n            b.search(g, function (err) {\n                if (err) {\n                    locStatusField.textContent = '' + err;\n                } else {\n                    locStatusField.textContent = '';\n                }\n            });\n        }\n    }, false);\n\n    var trackAddPopup;\n    addTrackBtn.addEventListener('click', function (ev) {\n        if (trackAddPopup && trackAddPopup.displayed) {\n            b.removeAllPopups();\n        } else {\n            trackAddPopup = b.showTrackAdder(ev);\n        }\n    }, false);\n    b.makeTooltip(addTrackBtn, 'Add a new track from the registry or an indexed file. (A)');\n\n    zoomInBtn.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n\n        b.zoomStep(-10);\n    }, false);\n    b.makeTooltip(zoomInBtn, 'Zoom in (+)');\n\n    zoomOutBtn.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n\n        b.zoomStep(10);\n    }, false);\n    b.makeTooltip(zoomOutBtn, 'Zoom out (-)');\n\n    zoomSlider.addEventListener('change', function (ev) {\n        var wantSnap = zoomSlider.active == 2;\n        if (wantSnap != b.isSnapZooming) {\n            b.savedZoom = b.zoomSliderValue - b.zoomMin;\n            b.isSnapZooming = wantSnap;\n        }\n        var activeZSV = zoomSlider.active == 1 ? zoomSlider.value : zoomSlider.value2;\n\n        b.zoomSliderValue = 1.0 * activeZSV;\n        b.zoom(Math.exp(1.0 * activeZSV / b.zoomExpt));\n    }, false);\n\n    favBtn.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n    }, false);\n    b.makeTooltip(favBtn, 'Favourite regions');\n\n    svgBtn.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        b.openExportPanel();\n    }, false);\n    b.makeTooltip(svgBtn, 'Export publication-quality SVG. (X)');\n\n    var optsPopup;\n    optsButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n\n        b.toggleOptsPopup(ev);\n    }, false);\n    b.makeTooltip(optsButton, 'Configure options.');\n\n    helpButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        b.toggleHelpPopup(ev);\n    });\n    b.makeTooltip(helpButton, 'Help; Keyboard shortcuts. (H)');\n\n    tierEditButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        if (b.selectedTiers.length == 1) {\n            b.openTierPanel(b.tiers[b.selectedTiers[0]]);\n        }\n    }, false);\n\n    leapLeftButton.addEventListener('click', function (ev) {\n        b.leap(b.reverseKeyScrolling ? -1 : 1, false);\n    }, false);\n    b.makeTooltip(leapLeftButton, function (ev) {\n        var st = b.getSelectedTier();\n        var tier;\n        if (st >= 0) tier = b.tiers[st];\n\n        if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof tier.quantLeapThreshold == 'number') {\n            return 'Jump to the next region with a score above the threshold in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\"\" (ctrl+LEFT)';\n        } else if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'leap')) {\n            return 'Jump to the next feature in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\" (ctrl+LEFT)';\n        } else {\n            return 'Jump left (shift+LEFT)';\n        }\n    });\n\n    leapRightButton.addEventListener('click', function (ev) {\n        b.leap(b.reverseKeyScrolling ? 1 : -1, false);\n    }, false);\n    b.makeTooltip(leapRightButton, function (ev) {\n        var st = b.getSelectedTier();\n        var tier;\n        if (st >= 0) tier = b.tiers[st];\n\n        if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof tier.quantLeapThreshold == 'number') {\n            return 'Jump to the next region with a score above the threshold in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\"\" (ctrl+RIGHT)';\n        } else if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'leap')) {\n            return 'Jump to the next feature in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\" (ctrl+RIGHT)';\n        } else {\n            return 'Jump right (shift+RIGHT)';\n        }\n    });\n    b.addTierSelectionListener(function () {\n        var st = b.getSelectedTier();\n        var tier;\n        if (st >= 0) tier = b.tiers[st];\n\n        var canLeap = false;\n        if (tier && tier.featureSource) {\n            if (b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof tier.quantLeapThreshold == 'number') canLeap = true;else if (b.sourceAdapterIsCapable(tier.featureSource, 'leap')) canLeap = true;\n        }\n\n        leapLeftButton.firstChild.className = canLeap ? 'fa fa-angle-double-left' : 'fa fa-angle-left';\n        leapRightButton.firstChild.className = canLeap ? 'fa fa-angle-double-right' : 'fa fa-angle-right';\n    });\n\n    clearHighlightsButton.addEventListener('click', function (ev) {\n        b.clearHighlights();\n    }, false);\n    b.makeTooltip(clearHighlightsButton, 'Clear highlights (C)');\n\n    b.addTierSelectionWrapListener(function (dir) {\n        if (dir < 0) {\n            b.setSelectedTier(null);\n            locField.focus();\n        }\n    });\n\n    b.addTierSelectionListener(function (sel) {\n        if (b.uiMode === 'tier') {\n            if (sel.length == 0) {\n                b.hideToolPanel();\n                b.manipulatingTier = null;\n                b.uiMode = 'none';\n            } else {\n                var ft = b.tiers[sel[0]];\n                if (ft != b.manipulatingTier) {\n                    b.openTierPanel(ft);\n                }\n            }\n        }\n    });\n\n    var uiKeyHandler = function uiKeyHandler(ev) {\n        // console.log('bukh: ' + ev.keyCode);\n        if (ev.keyCode == 65 || ev.keyCode == 97) {\n            // a\n            ev.preventDefault();ev.stopPropagation();\n            b.showTrackAdder();\n        } else if (ev.keyCode == 72 || ev.keyCode == 104) {\n            // h\n            ev.stopPropagation();ev.preventDefault();\n            b.toggleHelpPopup(ev);\n        } else if (ev.keyCode == 69 || ev.keyCode == 101) {\n            //e\n            ev.stopPropagation();ev.preventDefault();\n            if (b.selectedTiers.length == 1) {\n                b.openTierPanel(b.tiers[b.selectedTiers[0]]);\n            }\n        } else if (ev.keyCode == 88 || ev.keyCode == 120) {\n            // x\n            ev.stopPropagation();ev.preventDefault();\n            b.openExportPanel();\n        } else if (ev.keyCode == 67 || ev.keyCode == 99) {\n            // c\n            ev.stopPropagation();ev.preventDefault();\n            b.clearHighlights();\n        }\n    };\n\n    holder.addEventListener('focus', function (ev) {\n        holder.addEventListener('keydown', uiKeyHandler, false);\n    }, false);\n    holder.addEventListener('blur', function (ev) {\n        holder.removeEventListener('keydown', uiKeyHandler, false);\n    }, false);\n\n    holder.addEventListener('keydown', function (ev) {\n        if (ev.keyCode === 27) {\n            if (b.uiMode !== 'none') {\n                // Only consume event if tool panel is open.\n                ev.preventDefault();\n                ev.stopPropagation();\n                b.setUiMode('none');\n                b.hideToolPanel();\n\n                if (b.selectedTiers && b.selectedTiers.length > 0) {\n                    b.browserHolder.focus();\n                }\n            }\n        }\n    }, false);\n};\n\nBrowser.prototype.showToolPanel = function (panel, nowrap) {\n    var thisB = this;\n\n    if (this.activeToolPanel) {\n        this.activeToolPanel.parentElement.removeChild(this.activeToolPanel);\n    }\n\n    var content;\n    if (nowrap) content = panel;else content = makeElement('div', panel, {}, { overflowY: 'auto', width: '100%' });\n\n    var divider = makeElement('div', makeElement('i', null, { className: 'fa fa-caret-right' }), { className: 'tool-divider' });\n    divider.addEventListener('click', function (ev) {\n        thisB.hideToolPanel();\n        thisB.setUiMode('none');\n    }, false);\n    this.makeTooltip(divider, 'Close tool panel (ESC)');\n    this.activeToolPanel = makeElement('div', [divider, content], { className: 'tool-holder' });\n    this.svgHolder.appendChild(this.activeToolPanel);\n    this.resizeViewer();\n\n    var thisB = this;\n};\n\nBrowser.prototype.hideToolPanel = function () {\n    if (this.activeToolPanel) {\n        this.activeToolPanel.parentElement.removeChild(this.activeToolPanel);\n    }\n    this.svgHolder.style.width = '100%';\n    this.activeToolPanel = null;\n    this.resizeViewer();\n};\n\nBrowser.prototype.toggleHelpPopup = function (ev) {\n    if (this.uiMode === 'help') {\n        this.hideToolPanel();\n        this.setUiMode('none');\n    } else {\n        var helpFrame = makeElement('iframe', null, { scrolling: 'yes', seamless: 'seamless', src: this.resolveURL('$$help/index.html'), className: 'help-panel' });\n        this.showToolPanel(helpFrame, false);\n        this.setUiMode('help');\n    }\n};\n\nBrowser.prototype.toggleOptsPopup = function (ev) {\n    var b = this;\n\n    if (this.uiMode === 'opts') {\n        this.hideToolPanel();\n        this.setUiMode('none');\n    } else {\n        var optsForm = makeElement('div', null, { className: 'form-horizontal' }, { boxSizing: 'border-box', MozBoxSizing: 'border-box', display: 'inline-block', verticalAlign: 'top' });\n        var optsTable = makeElement('table');\n        optsTable.cellPadding = 5;\n\n        var scrollModeButton = makeElement('input', '', { type: 'checkbox', checked: b.reverseScrolling });\n        scrollModeButton.addEventListener('change', function (ev) {\n            b.reverseScrolling = scrollModeButton.checked;\n            b.storeStatus();\n        }, false);\n        optsTable.appendChild(makeElement('tr', [makeElement('td', 'Reverse trackpad scrolling', { align: 'right' }), makeElement('td', scrollModeButton)]));\n\n        var scrollKeyButton = makeElement('input', '', { type: 'checkbox', checked: b.reverseKeyScrolling });\n        scrollKeyButton.addEventListener('change', function (ev) {\n            b.reverseKeyScrolling = scrollKeyButton.checked;\n            b.storeStatus();\n        }, false);\n        optsTable.appendChild(makeElement('tr', [makeElement('td', 'Reverse scrolling buttons and keys', { align: 'right' }), makeElement('td', scrollKeyButton)]));\n\n        var rulerSelect = makeElement('select');\n        rulerSelect.appendChild(makeElement('option', 'Left', { value: 'left' }));\n        rulerSelect.appendChild(makeElement('option', 'Center', { value: 'center' }));\n        rulerSelect.appendChild(makeElement('option', 'Right', { value: 'right' }));\n        rulerSelect.appendChild(makeElement('option', 'None', { value: 'none' }));\n        rulerSelect.value = b.rulerLocation;\n        rulerSelect.addEventListener('change', function (ev) {\n            b.rulerLocation = rulerSelect.value;\n            b.positionRuler();\n            for (var ti = 0; ti < b.tiers.length; ++ti) {\n                b.tiers[ti].paintQuant();\n            }\n            b.storeStatus();\n        }, false);\n        optsTable.appendChild(makeElement('tr', [makeElement('td', 'Vertical guideline', { align: 'right' }), makeElement('td', rulerSelect)]));\n\n        var singleBaseHighlightButton = makeElement('input', '', { type: 'checkbox', checked: b.singleBaseHighlight });\n        singleBaseHighlightButton.addEventListener('change', function (ev) {\n            b.singleBaseHighlight = singleBaseHighlightButton.checked;\n            b.positionRuler();\n            b.storeStatus();\n        }, false);\n        singleBaseHighlightButton.setAttribute('id', 'singleBaseHightlightButton'); // making this because access is required when the key 'u' is pressed and the options are visible\n        optsTable.appendChild(makeElement('tr', [makeElement('td', 'Display and highlight current genome location', { align: 'right' }), makeElement('td', singleBaseHighlightButton)]));\n\n        optsForm.appendChild(optsTable);\n\n        var resetButton = makeElement('button', 'Reset browser', { className: 'btn' }, { marginLeft: 'auto', marginRight: 'auto', display: 'block' });\n        resetButton.addEventListener('click', function (ev) {\n            b.reset();\n        }, false);\n        optsForm.appendChild(resetButton);\n\n        this.showToolPanel(optsForm);\n        this.setUiMode('opts');\n    }\n};\n\nfunction humanReadableScale(x) {\n    var suffix = 'bp';\n    if (x > 1000000000) {\n        x /= 1000000000;\n        suffix = 'Gb';\n    } else if (x > 1000000) {\n        x /= 1000000;\n        suffix = 'Mb';\n    } else if (x > 1000) {\n        x /= 1000;\n        suffix = 'kb';\n    }\n    return '' + Math.round(x) + suffix;\n}\n\n},{\"./cbrowser\":6,\"./export-config\":16,\"./export-image\":17,\"./export-ui\":18,\"./numformats\":30,\"./session\":37,\"./svg-export\":44,\"./tier-edit\":51,\"./utils\":56,\"./zoomslider\":59}],6:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// cbrowser.js: canvas browser container\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var utils = require('./utils');\n    var Observed = utils.Observed;\n    var Awaited = utils.Awaited;\n    var makeElement = utils.makeElement;\n    var removeChildren = utils.removeChildren;\n    var miniJSONify = utils.miniJSONify;\n    var shallowCopy = utils.shallowCopy;\n    var textXHR = utils.textXHR;\n\n    var tier = require('./tier');\n    var DasTier = tier.DasTier;\n\n    var sha1 = require('./sha1');\n    var hex_sha1 = sha1.hex_sha1;\n\n    var thub = require('./thub');\n    var connectTrackHub = thub.connectTrackHub;\n\n    var VERSION = require('./version');\n\n    var nf = require('./numformats');\n    var formatQuantLabel = nf.formatQuantLabel;\n    var formatLongInt = nf.formatLongInt;\n\n    var Chainset = require('./chainset').Chainset;\n\n    var Promise = require('es6-promise').Promise;\n\n    var sourcecompare = require('./sourcecompare');\n    var sourcesAreEqual = sourcecompare.sourcesAreEqual;\n    var sourcesAreEqualModuloStyle = sourcecompare.sourcesAreEqualModuloStyle;\n    var sourceDataURI = sourcecompare.sourceDataURI;\n    var sourceStyleURI = sourcecompare.sourceStyleURI;\n\n    var DefaultRenderer = require('./default-renderer');\n\n    var MultiRenderer = require('./multi-renderer');\n    var SubRenderer = require('./sub-renderer');\n\n    var DummyRenderer = require('./dummy-renderer');\n}\n\nfunction Region(chr, min, max) {\n    this.min = min;\n    this.max = max;\n    this.chr = chr;\n}\n\nfunction Browser(opts) {\n    if (!opts) {\n        opts = {};\n    }\n\n    this.renderers = { 'default': DefaultRenderer,\n        'dummy': DummyRenderer,\n        'multi': MultiRenderer,\n        'sub': SubRenderer\n    };\n\n    this.defaultRenderer = opts.renderer || DefaultRenderer;\n\n    this.prefix = '//www.biodalliance.org/release-0.14/';\n\n    this.sources = [];\n    this.tiers = [];\n    this.tierGroups = {};\n\n    this.searchOnlySources = [];\n    this.searchOnlySourceHolders = [];\n\n    this.featureListeners = [];\n    this.featureHoverListeners = [];\n    this.viewListeners = [];\n    this.regionSelectListeners = [];\n    this.tierListeners = [];\n    this.tierSelectionListeners = [];\n    this.tierSelectionWrapListeners = [];\n\n    this.cookieKey = 'browser';\n\n    this.chains = {};\n\n    this.pageName = 'svgHolder';\n    this.zoomFactor = 1.0;\n    this.maxPixelsPerBase = 10;\n    this.origin = 0;\n    this.targetQuantRes = 1.0;\n    this.featurePanelWidth = 750;\n    this.zoomBase = 100;\n    this.zoomExpt = 30.0; // Back to being fixed....\n    this.zoomSliderValue = 100;\n    this.entryPoints = null;\n    this.currentSeqMax = -1; // init once EPs are fetched.\n\n    this.highlights = [];\n    this.selectedTiers = [1];\n\n    this.maxViewWidth = 500000;\n    this.defaultSubtierMax = 100;\n\n    this.highZoomThreshold = 0.2;\n    this.mediumZoomThreshold = 0.01;\n\n    this.minExtraWidth = 100.0;\n    this.maxExtraWidth = 1000.0;\n\n    // Options.\n\n    this.reverseScrolling = false;\n    this.rulerLocation = 'center';\n    this.defaultHighlightFill = 'red';\n    this.defaultHighlightAlpha = 0.3;\n    this.exportHighlights = true;\n    this.exportRuler = true;\n    this.exportBanner = true;\n    this.exportRegion = true;\n    this.singleBaseHighlight = true;\n\n    // Visual config.\n\n    // this.tierBackgroundColors = [\"rgb(245,245,245)\", \"rgb(230,230,250)\" /* 'white' */];\n    this.tierBackgroundColors = [\"rgb(245,245,245)\", 'white'];\n    this.minTierHeight = 20;\n    this.noDefaultLabels = false;\n\n    // Registry\n\n    this.availableSources = new Observed();\n    this.defaultSources = [];\n    this.mappableSources = {};\n\n    // Central DAS Registry no longer available 2015-05\n\n    this.registry = null; // '//www.dasregistry.org/das/sources';\n    this.noRegistryTabs = true;\n\n    this.defaultTrackAdderTab = null;\n\n    this.hubs = [];\n    this.hubObjects = [];\n\n    this.sourceCache = new SourceCache();\n\n    this.retina = true;\n\n    this.useFetchWorkers = true;\n    this.maxWorkers = 2;\n    this.workerPath = '$$worker-all.js';\n    this.resolvers = {};\n    this.resolverSeed = 1;\n\n    this.assemblyNamePrimary = true;\n    this.assemblyNameUcsc = true;\n\n    this.defaultSearchRegionPadding = 10000;\n\n    // HTTP warning support\n\n    this.httpCanaryURL = 'http://www.biodalliance.org/http-canary.txt';\n    this.httpWarningURL = '//www.biodalliance.org/https.html';\n\n    this.initListeners = [];\n\n    if (opts.baseColors) {\n        this.baseColors = opts.baseColors;\n    } else {\n        this.baseColors = {\n            A: 'green',\n            C: 'blue',\n            G: 'orange',\n            T: 'red',\n            '-': 'hotpink', // deletion\n            'I': 'red' // insertion\n        };\n    }\n\n    if (opts.viewStart !== undefined && typeof opts.viewStart !== 'number') {\n        throw Error('viewStart must be an integer');\n    }\n    if (opts.viewEnd !== undefined && typeof opts.viewEnd !== 'number') {\n        throw Error('viewEnd must be an integer');\n    }\n    if (opts.offscreenInitWidth !== undefined && typeof opts.offscreenInitWidth !== 'number') {\n        throw Error('offscreenInitWidth must be an integer');\n    }\n\n    for (var k in opts) {\n        this[k] = opts[k];\n    }\n\n    if (typeof opts.uiPrefix === 'string' && typeof opts.prefix !== 'string') {\n        this.prefix = opts.uiPrefix;\n    }\n    // If the prefix only starts with a single '/' this is relative to the current\n    // site, so we need to prefix the prefix with //{hostname}\n    if (this.prefix.indexOf('//') < 0 && this.prefix.indexOf('/') === 0) {\n        var location = window.location.hostname;\n        if (window.location.port) {\n            location += ':' + window.location.port;\n        };\n        this.prefix = '//' + location + this.prefix;\n    }\n    if (this.prefix.indexOf('//') === 0) {\n        var proto = window.location.protocol;\n        if (proto == 'http:' || proto == 'https:') {\n            // Protocol-relative URLs okay.\n        } else {\n            console.log(window.location.protocol);\n            console.log('WARNING: prefix is set to a protocol-relative URL (' + this.prefix + ' when loading from a non-HTTP source');\n            this.prefix = 'http:' + this.prefix;\n        }\n    }\n\n    if (!this.coordSystem) {\n        throw Error('Coordinate system must be configured');\n    }\n\n    if (this.chr === undefined || this.viewStart === undefined || this.viewEnd === undefined) {\n        throw Error('Viewed region (chr:start..end) must be defined');\n    }\n\n    var thisB = this;\n\n    if (document.readyState === 'complete') {\n        thisB.realInit();\n    } else {\n        var loadListener = function loadListener(ev) {\n            window.removeEventListener('load', loadListener, false);\n            thisB.realInit();\n        };\n        window.addEventListener('load', loadListener, false);\n    }\n}\n\nBrowser.prototype.resolveURL = function (url) {\n    return url.replace('$$', this.prefix);\n};\n\nBrowser.prototype.destroy = function () {\n    window.removeEventListener('resize', this.resizeListener, false);\n    if (this.fetchWorkers) {\n        var _iteratorNormalCompletion = true;\n        var _didIteratorError = false;\n        var _iteratorError = undefined;\n\n        try {\n            for (var _iterator = this.fetchWorkers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n                var worker = _step.value;\n\n                worker.terminate();\n            }\n        } catch (err) {\n            _didIteratorError = true;\n            _iteratorError = err;\n        } finally {\n            try {\n                if (!_iteratorNormalCompletion && _iterator.return) {\n                    _iterator.return();\n                }\n            } finally {\n                if (_didIteratorError) {\n                    throw _iteratorError;\n                }\n            }\n        }\n    }\n};\n\nBrowser.prototype.realInit = function () {\n    var self = this;\n    var thisB = this;\n\n    if (this.wasInitialized) {\n        console.log('Attemping to call realInit on an already-initialized Dalliance instance');\n        return;\n    }\n\n    this.wasInitialized = true;\n\n    if (typeof navigator !== 'undefined') {\n        var ua = navigator.userAgent || 'dummy';\n        if (ua.indexOf('Trident') >= 0 && ua.indexOf('rv:11') >= 0) {\n            // console.log('Detected IE11, disabling tier pinning.');\n            this.disablePinning = true;\n        }\n    }\n\n    this.defaultChr = this.chr;\n    this.defaultStart = this.viewStart;\n    this.defaultEnd = this.viewEnd;\n    this.defaultSources = [];\n    for (var i = 0; i < this.sources.length; ++i) {\n        var s = this.sources[i];\n        if (s) this.defaultSources.push(s);\n    }\n\n    if (this.restoreStatus) {\n        this.statusRestored = this.restoreStatus();\n    }\n\n    if (this.injectionPoint && this.injectionPoint instanceof Element) {\n        this.browserHolderHolder = this.injectionPoint;\n    } else if (this.injectionPoint) {\n        this.browserHolderHolder = document.getElementById(this.injectionPoint);\n        if (!this.browserHolderHolder) {\n            throw Error('injectionPoint must point to a valid DOM element of element ID');\n        }\n    } else {\n        this.browserHolderHolder = document.getElementById(this.pageName);\n        if (!this.browserHolderHolder) {\n            throw Error('pageName must be a valid element ID (or use the injectionPoint option instead)');\n        }\n    }\n\n    this.browserHolderHolder.classList.add('dalliance-injection-point');\n    this.browserHolder = makeElement('div', null, { className: 'dalliance dalliance-root', tabIndex: -1 });\n    if (this.maxHeight) {\n        this.browserHolder.style.maxHeight = this.maxHeight + 'px';\n    } else if (this.maxHeight != undefined) {\n        this.browserHolder.style.maxHeight = null;\n    }\n    removeChildren(this.browserHolderHolder);\n    this.browserHolderHolder.appendChild(this.browserHolder);\n    this.svgHolder = makeElement('div', null, { className: 'main-holder' });\n\n    this.initUI(this.browserHolder, this.svgHolder);\n\n    this.pinnedTierHolder = makeElement('div', null, { className: 'tier-holder tier-holder-pinned' });\n    this.tierHolder = makeElement('div', this.makeLoader(24), { className: 'tier-holder tier-holder-rest' });\n\n    this.locSingleBase = makeElement('span', '', { className: 'loc-single-base' });\n    var locSingleBaseHolder = makeElement('div', this.locSingleBase, { className: 'loc-single-base-holder' });\n    // Add listener to update single base location\n    this.addViewListener(function (chr, minFloor, maxFloor, zoomSliderValue, zoomSliderDict, min, max) {\n        // Just setting textContent causes layout flickering in Blink.\n        // This approach means that the element is never empty.\n        var loc = Math.round((max + min) / 2);\n        self.locSingleBase.appendChild(document.createTextNode(chr + ':' + formatLongInt(loc)));\n        self.locSingleBase.removeChild(self.locSingleBase.firstChild);\n    });\n\n    if (this.disablePinning) {\n        this.tierHolderHolder = this.tierHolder;\n    } else {\n        this.tierHolderHolder = makeElement('div', [locSingleBaseHolder, this.pinnedTierHolder, this.tierHolder], { className: 'tier-holder-holder' });\n        this.svgHolder.appendChild(this.tierHolderHolder);\n    }\n    this.svgHolder.appendChild(this.tierHolderHolder);\n\n    this.bhtmlRoot = makeElement('div');\n    if (!this.disablePoweredBy) {\n        this.bhtmlRoot.appendChild(makeElement('span', ['Powered by ', makeElement('a', 'Biodalliance', { href: 'http://www.biodalliance.org/' }), ' ' + VERSION], { className: 'powered-by' }));\n    }\n    this.browserHolder.appendChild(this.bhtmlRoot);\n\n    this.resizeListener = function (ev) {\n        thisB.resizeViewer();\n    };\n\n    this.ruler = makeElement('div', null, { className: 'guideline' });\n    this.ruler2 = makeElement('div', null, { className: 'single-base-guideline' });\n    this.tierHolderHolder.appendChild(this.ruler);\n    this.tierHolderHolder.appendChild(this.ruler2);\n    this.chainConfigs = this.chains || {};\n    this.chains = {};\n    for (var k in this.chainConfigs) {\n        var cc = this.chainConfigs[k];\n        if (cc instanceof Chainset) {\n            console.log('WARNING: Should no longer use \"new Chainset\" in Biodalliance configurations.');\n        }\n        this.chains[k] = new Chainset(cc);\n    }\n\n    var promisedWorkers;\n    if (this.maxWorkers > 0) {\n        var pw = [];\n        for (var fi = 0; fi < this.maxWorkers; ++fi) {\n            pw.push(makeFetchWorker(this));\n        }promisedWorkers = Promise.all(pw);\n    } else {\n        promisedWorkers = Promise.resolve([]);\n    }\n\n    this.fetchWorkers = null;\n    this.nextWorker = 0;\n    promisedWorkers.then(function (v) {\n        console.log('Booted ' + v.length + ' workers');\n        thisB.fetchWorkers = v;\n    }, function (v) {\n        console.log('Failed to boot workers', v);\n    }).then(function () {\n        if (self.offscreenInitWidth || window.getComputedStyle(thisB.browserHolderHolder).display != 'none' && thisB.tierHolder.getBoundingClientRect().width > 0) {\n            setTimeout(function () {\n                thisB.realInit2();\n            }, 1);\n        } else {\n            var pollInterval = setInterval(function () {\n                if (window.getComputedStyle(thisB.browserHolderHolder).display != 'none' && thisB.tierHolder.getBoundingClientRect().width > 0) {\n                    clearInterval(pollInterval);\n                    thisB.realInit2();\n                }\n            }, 300);\n        }\n    });\n};\n\nBrowser.prototype.realInit2 = function () {\n    var _this = this;\n\n    var thisB = this;\n\n    // Remove the loader icon, if needed\n    removeChildren(this.tierHolder);\n    removeChildren(this.pinnedTierHolder);\n\n    this.featurePanelWidth = this.tierHolder.getBoundingClientRect().width | thisB.offscreenInitWidth | 0;\n    window.addEventListener('resize', this.resizeListener, false);\n\n    this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n    if (!this.zoomMax) {\n        this.zoomMax = this.zoomExpt * Math.log(this.maxViewWidth / this.zoomBase);\n        this.zoomMin = this.zoomExpt * Math.log(this.featurePanelWidth / this.maxPixelsPerBase / this.zoomBase);\n    }\n    this.zoomSliderValue = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n    // Event handlers\n\n    this.tierHolderHolder.addEventListener('mousewheel', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n\n        if (ev.wheelDeltaX) {\n            var delta = ev.wheelDeltaX / 5;\n            if (!thisB.reverseScrolling) {\n                delta = -delta;\n            }\n            thisB.move(delta);\n        }\n\n        if (ev.wheelDeltaY) {\n            var delta = ev.wheelDeltaY;\n            if (thisB.reverseScrolling) {\n                delta = -delta;\n            }\n            thisB.tierHolder.scrollTop += delta;\n        }\n    }, false);\n\n    this.tierHolderHolder.addEventListener('MozMousePixelScroll', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        if (ev.axis == 1) {\n            if (ev.detail != 0) {\n                var delta = ev.detail / 4;\n                if (thisB.reverseScrolling) {\n                    delta = -delta;\n                }\n                thisB.move(delta);\n            }\n        } else {\n            var delta = ev.detail;\n            if (!thisB.reverseScrolling) {\n                delta = -delta;\n            }\n\n            thisB.tierHolder.scrollTop += delta;\n        }\n    }, false);\n\n    this.tierHolderHolder.addEventListener('touchstart', function (ev) {\n        return thisB.touchStartHandler(ev);\n    }, false);\n    this.tierHolderHolder.addEventListener('touchmove', function (ev) {\n        return thisB.touchMoveHandler(ev);\n    }, false);\n    this.tierHolderHolder.addEventListener('touchend', function (ev) {\n        return thisB.touchEndHandler(ev);\n    }, false);\n    this.tierHolderHolder.addEventListener('touchcancel', function (ev) {\n        return thisB.touchCancelHandler(ev);\n    }, false);\n\n    var keyHandler = function keyHandler(ev) {\n        // console.log('cbkh: ' + ev.keyCode);\n        if (ev.keyCode == 13) {\n            // enter\n            var layoutsChanged = false;\n            for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                var t = thisB.tiers[ti];\n                if (t.wantedLayoutHeight && t.wantedLayoutHeight != t.layoutHeight) {\n                    t.layoutHeight = t.wantedLayoutHeight;\n                    t.clipTier();\n                    layoutsChanged = true;\n                }\n            }\n            if (layoutsChanged) {\n                thisB.arrangeTiers();\n            }\n        } else if (ev.keyCode == 32 || ev.charCode == 32) {\n            // space\n            if (!thisB.isSnapZooming) {\n                thisB.isSnapZooming = true;\n                var newZoom = (thisB.savedZoom || 0.0) + thisB.zoomMin;\n                thisB.savedZoom = thisB.zoomSliderValue - thisB.zoomMin;\n                thisB.zoomSliderValue = newZoom;\n                thisB.zoom(Math.exp(1.0 * newZoom / thisB.zoomExpt));\n            } else {\n                thisB.isSnapZooming = false;\n                var newZoom = (thisB.savedZoom || 20.0) + thisB.zoomMin;\n                thisB.savedZoom = thisB.zoomSliderValue - thisB.zoomMin;\n                thisB.zoomSliderValue = newZoom;\n                thisB.zoom(Math.exp(1.0 * newZoom / thisB.zoomExpt));\n            }\n            ev.stopPropagation();ev.preventDefault();\n        } else if (ev.keyCode == 85) {\n            // u\n            if (thisB.uiMode === 'opts') {\n                // if the options are visible, toggle the checkbox too\n                var check = document.getElementById(\"singleBaseHightlightButton\").checked;\n                document.getElementById(\"singleBaseHightlightButton\").checked = !check;\n            }\n            thisB.singleBaseHighlight = !thisB.singleBaseHighlight;\n            thisB.positionRuler();\n            ev.stopPropagation();ev.preventDefault();\n        } else if (ev.keyCode == 39) {\n            // right arrow\n            ev.stopPropagation();ev.preventDefault();\n            thisB.scrollArrowKey(ev, -1);\n        } else if (ev.keyCode == 37) {\n            // left arrow\n            ev.stopPropagation();ev.preventDefault();\n            thisB.scrollArrowKey(ev, 1);\n        } else if (ev.keyCode == 38 || ev.keyCode == 87) {\n            // up arrow | w\n            ev.stopPropagation();ev.preventDefault();\n\n            if (ev.shiftKey) {\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                var tt = thisB.tiers[st];\n                var ch = tt.forceHeight || tt.subtiers[0].height;\n                if (ch >= 40) {\n                    tt.mergeConfig({ height: ch - 10 });\n                }\n            } else if (ev.ctrlKey || ev.metaKey) {\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                var tt = thisB.tiers[st];\n\n                if (tt.quantLeapThreshold) {\n                    var th = tt.subtiers[0].height;\n                    var tq = tt.subtiers[0].quant;\n                    if (!tq) return;\n\n                    var qmin = 1.0 * tq.min;\n                    var qmax = 1.0 * tq.max;\n\n                    var qscale = (qmax - qmin) / th;\n                    tt.mergeConfig({ quantLeapThreshold: qmin + ((Math.round((tt.quantLeapThreshold - qmin) / qscale) | 0) + 1) * qscale });\n\n                    tt.notify('Threshold: ' + formatQuantLabel(tt.quantLeapThreshold));\n                }\n            } else if (ev.altKey) {\n                var cnt = thisB.selectedTiers.length;\n                if (cnt == 0) return;\n\n                var st = thisB.selectedTiers[0];\n                var contiguous = true;\n                var mt = [];\n                for (var si = 0; si < thisB.selectedTiers.length; ++si) {\n                    mt.push(thisB.tiers[thisB.selectedTiers[si]]);\n                    if (si > 0 && thisB.selectedTiers[si] - thisB.selectedTiers[si - 1] != 1) contiguous = false;\n                }\n\n                if (contiguous && st <= 0) return;\n\n                for (var si = thisB.selectedTiers.length - 1; si >= 0; --si) {\n                    thisB.tiers.splice(thisB.selectedTiers[si], 1);\n                }thisB.selectedTiers.splice(0, cnt);\n\n                var ip = contiguous ? st - 1 : st;\n                for (var si = 0; si < mt.length; ++si) {\n                    thisB.tiers.splice(ip + si, 0, mt[si]);\n                    thisB.selectedTiers.push(ip + si);\n                }\n\n                thisB.withPreservedSelection(thisB._ensureTiersGrouped);\n                thisB.markSelectedTiers();\n                thisB.notifyTierSelection();\n                thisB.reorderTiers();\n                thisB.notifyTier(\"selected\", st);\n            } else {\n                var st = thisB.getSelectedTier();\n                if (st > 0) {\n                    thisB.setSelectedTier(st - 1);\n                    var nst = thisB.tiers[thisB.getSelectedTier()];\n                    var top = nst.row.offsetTop,\n                        bottom = top + nst.row.offsetHeight;\n                    if (top < thisB.tierHolder.scrollTop || bottom > thisB.tierHolder.scrollTop + thisB.tierHolder.offsetHeight) {\n                        thisB.tierHolder.scrollTop = top;\n                    }\n                } else {\n                    thisB.notifyTierSelectionWrap(-1);\n                }\n            }\n        } else if (ev.keyCode == 40 || ev.keyCode == 83) {\n            // down arrow | s\n            ev.stopPropagation();ev.preventDefault();\n\n            if (ev.shiftKey) {\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                var tt = thisB.tiers[st];\n                var ch = tt.forceHeight || tt.subtiers[0].height;\n                tt.mergeConfig({ height: ch + 10 });\n            } else if (ev.ctrlKey || ev.metaKey) {\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                var tt = thisB.tiers[st];\n\n                if (tt.quantLeapThreshold) {\n                    var th = tt.subtiers[0].height;\n                    var tq = tt.subtiers[0].quant;\n                    if (!tq) return;\n\n                    var qmin = 1.0 * tq.min;\n                    var qmax = 1.0 * tq.max;\n                    var qscale = (qmax - qmin) / th;\n\n                    var it = Math.round((tt.quantLeapThreshold - qmin) / qscale) | 0;\n                    if (it > 1) {\n                        tt.mergeConfig({ quantLeapThreshold: qmin + (it - 1) * qscale });\n                        tt.notify('Threshold: ' + formatQuantLabel(tt.quantLeapThreshold));\n                    }\n                }\n            } else if (ev.altKey) {\n                var cnt = thisB.selectedTiers.length;\n                if (cnt == 0) return;\n\n                var st = thisB.selectedTiers[0];\n                var discontig = 0;\n                var mt = [];\n                for (var si = 0; si < thisB.selectedTiers.length; ++si) {\n                    mt.push(thisB.tiers[thisB.selectedTiers[si]]);\n                    if (si > 0) discontig += thisB.selectedTiers[si] - thisB.selectedTiers[si - 1] - 1;\n                }\n                var contiguous = discontig == 0;\n\n                if (contiguous && st + cnt >= thisB.tiers.length) return;\n\n                for (var si = thisB.selectedTiers.length - 1; si >= 0; --si) {\n                    thisB.tiers.splice(thisB.selectedTiers[si], 1);\n                }thisB.selectedTiers.splice(0, cnt);\n\n                var ip = contiguous ? st + 1 : st + discontig;\n                for (var si = 0; si < mt.length; ++si) {\n                    thisB.tiers.splice(ip + si, 0, mt[si]);\n                    thisB.selectedTiers.push(ip + si);\n                }\n\n                thisB.withPreservedSelection(function () {\n                    thisB._ensureTiersGrouped(true);\n                });\n                thisB.markSelectedTiers();\n                thisB.notifyTierSelection();\n                thisB.reorderTiers();\n                thisB.notifyTier(\"selected\", st);\n            } else {\n                var st = thisB.getSelectedTier();\n                if (st < thisB.tiers.length - 1) {\n                    thisB.setSelectedTier(st + 1);\n                    var nst = thisB.tiers[thisB.getSelectedTier()];\n                    var top = nst.row.offsetTop,\n                        bottom = top + nst.row.offsetHeight;\n                    if (top < thisB.tierHolder.scrollTop || bottom > thisB.tierHolder.scrollTop + thisB.tierHolder.offsetHeight) {\n                        thisB.tierHolder.scrollTop = Math.min(top, bottom - thisB.tierHolder.offsetHeight);\n                    }\n                }\n            }\n        } else if (ev.keyCode == 187 || ev.keyCode == 61) {\n            // +\n            ev.stopPropagation();ev.preventDefault();\n            thisB.zoomStep(-10);\n        } else if (ev.keyCode == 189 || ev.keyCode == 173) {\n            // -\n            ev.stopPropagation();ev.preventDefault();\n            thisB.zoomStep(10);\n        } else if (ev.keyCode == 73 || ev.keyCode == 105) {\n            // i\n            ev.stopPropagation();ev.preventDefault();\n            var st = thisB.getSelectedTier();\n            if (st < 0) return;\n            var t = thisB.tiers[st];\n            if (!t.infoVisible) {\n                t.infoElement.style.display = 'block';\n                t.updateHeight();\n                t.infoVisible = true;\n            } else {\n                t.infoElement.style.display = 'none';\n                t.updateHeight();\n                t.infoVisible = false;\n            }\n        } else if (ev.keyCode == 84 || ev.keyCode == 116) {\n            // t\n            var bumpStatus;\n            if (ev.shiftKey) {\n                ev.stopPropagation();ev.preventDefault();\n                for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                    var t = thisB.tiers[ti];\n                    if (t.dasSource.collapseSuperGroups) {\n                        if (bumpStatus === undefined) {\n                            bumpStatus = !t.bumped;\n                        }\n                        t.mergeConfig({ bumped: bumpStatus });\n                    }\n                }\n            } else if (!ev.ctrlKey && !ev.metaKey) {\n                ev.stopPropagation();ev.preventDefault();\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                var t = thisB.tiers[st];\n\n                if (t.dasSource.collapseSuperGroups) {\n                    if (bumpStatus === undefined) {\n                        bumpStatus = !t.bumped;\n                    }\n                    t.mergeConfig({ bumped: bumpStatus });\n                }\n            }\n        } else if (ev.keyCode == 77 || ev.keyCode == 109) {\n            // m\n            ev.stopPropagation();ev.preventDefault();\n            if ((ev.ctrlKey || ev.metaKey) && thisB.selectedTiers.length > 1) {\n                thisB.mergeSelectedTiers();\n            }\n        } else if (ev.keyCode == 68 || ev.keyCode == 100) {\n            // d\n            ev.stopPropagation();ev.preventDefault();\n            if (ev.ctrlKey || ev.metaKey) {\n                var st = thisB.getSelectedTier();\n                if (st < 0) return;\n                thisB.addTier(thisB.tiers[st].dasSource);\n            }\n        } else if (ev.keyCode == 80 || ev.keyCode == 112) {\n            // p\n            if (ev.ctrlKey || ev.metaKey) {\n                // Need to be careful because order of tiers could change\n                // once we start updating pinning.\n                var tt = [];\n                for (var st = 0; st < thisB.selectedTiers.length; ++st) {\n                    tt.push(thisB.tiers[thisB.selectedTiers[st]]);\n                }\n                for (var ti = 0; ti < tt.length; ++ti) {\n                    tt[ti].mergeConfig({ pinned: !tt[ti].pinned });\n                }\n            }\n        } else {\n            // console.log('key: ' + ev.keyCode + '; char: ' + ev.charCode);\n        }\n    };\n\n    this.browserHolder.addEventListener('focus', function (ev) {\n        thisB.browserHolder.addEventListener('keydown', keyHandler, false);\n    }, false);\n    this.browserHolder.addEventListener('blur', function (ev) {\n        thisB.browserHolder.removeEventListener('keydown', keyHandler, false);\n    }, false);\n\n    // Popup support (does this really belong here? FIXME)\n    this.hPopupHolder = makeElement('div');\n    this.hPopupHolder.style['font-family'] = 'helvetica';\n    this.hPopupHolder.style['font-size'] = '12pt';\n    this.hPopupHolder.classList.add('dalliance');\n    document.body.appendChild(this.hPopupHolder);\n\n    for (var t = 0; t < this.sources.length; ++t) {\n        var source = this.sources[t];\n        if (!source) continue;\n\n        var config = {};\n        if (this.restoredConfigs) {\n            config = this.restoredConfigs[t];\n        }\n\n        if (!source.disabled) {\n            this.makeTier(source, config).then(function (tier) {\n                thisB.refreshTier(tier);\n            });\n        }\n    }\n\n    var _iteratorNormalCompletion2 = true;\n    var _didIteratorError2 = false;\n    var _iteratorError2 = undefined;\n\n    try {\n        for (var _iterator2 = this.searchOnlySources[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n            var _source = _step2.value;\n\n            if (!_source.disabled) {\n                var _createSources = this.createSources(_source),\n                    features = _createSources.features;\n\n                if (features) {\n                    this.searchOnlySourceHolders.push({\n                        dasSource: _source,\n                        featureSource: features\n                    });\n                }\n            }\n        }\n    } catch (err) {\n        _didIteratorError2 = true;\n        _iteratorError2 = err;\n    } finally {\n        try {\n            if (!_iteratorNormalCompletion2 && _iterator2.return) {\n                _iterator2.return();\n            }\n        } finally {\n            if (_didIteratorError2) {\n                throw _iteratorError2;\n            }\n        }\n    }\n\n    if (this.onFirstRender) {\n        Promise.all(this.tiers.map(function (t) {\n            return t.firstRenderPromise;\n        })).then(function () {\n            return _this.onFirstRender();\n        }).catch(function (err) {\n            return console.log(err);\n        });\n    }\n\n    thisB._ensureTiersGrouped();\n    thisB.arrangeTiers();\n    thisB.reorderTiers();\n\n    var ss = this.getSequenceSource();\n    if (ss) {\n        ss.getSeqInfo(this.chr, function (si) {\n            if (si) thisB.currentSeqMax = si.length;else thisB.currentSeqMax = -1;\n        });\n    }\n\n    this.queryRegistry();\n    for (var m in this.chains) {\n        this.queryRegistry(m, true);\n    }\n\n    if (this.hubs) {\n        for (var hi = 0; hi < this.hubs.length; ++hi) {\n            var hc = this.hubs[hi];\n            if (typeof hc == 'string') {\n                hc = { url: hc };\n            };\n\n            (function (hc) {\n                connectTrackHub(hc.url, function (hub, err) {\n                    if (err) {\n                        console.log(err);\n                    } else {\n                        var tdb;\n                        if (hc.genome) tdb = hub.genomes[hc.genome];else tdb = hub.genomes[thisB.coordSystem.ucscName];\n\n                        if (tdb) {\n                            if (hc.mapping) tdb.mapping = hc.mapping;\n                            if (hc.label) tdb.hub.altLabel = hc.label;\n                            thisB.hubObjects.push(tdb);\n                        }\n                    }\n                }, hc);\n            })(hc);\n        }\n    }\n\n    if (this.fullScreen) {\n        this.setFullScreenHeight();\n    }\n\n    if (!this.statusRestored && this.storeStatus) {\n        this.storeStatus();\n    }\n\n    thisB.setLocation(this.chr, this.viewStart, this.viewEnd, function () {\n        thisB.setSelectedTier(1);\n        // Ping any init listeners.\n        for (var ii = 0; ii < thisB.initListeners.length; ++ii) {\n            try {\n                thisB.initListeners[ii].call(thisB);\n            } catch (e) {\n                console.log(e);\n            }\n        }\n    });\n};\n\n//\n// Touch event support\n//\n\nBrowser.prototype.touchStartHandler = function (ev) {\n    // Events not consumed so they can be interpretted as clicks as well.\n\n    this.touchOriginX = ev.touches[0].pageX;\n    this.touchOriginY = ev.touches[0].pageY;\n    if (ev.touches.length == 2) {\n        var sep = Math.abs(ev.touches[0].pageX - ev.touches[1].pageX);\n        this.zooming = true;\n        this.zoomLastSep = this.zoomInitialSep = sep;\n        this.zoomInitialScale = this.scale;\n    }\n};\n\nBrowser.prototype.touchMoveHandler = function (ev) {\n    // These events *are* consumed to ensure we never get any dragging that\n    // we don't manage ourselves.\n\n    ev.stopPropagation();ev.preventDefault();\n\n    if (ev.touches.length == 1) {\n        var touchX = ev.touches[0].pageX;\n        var touchY = ev.touches[0].pageY;\n        if (this.touchOriginX && touchX != this.touchOriginX) {\n            this.move(touchX - this.touchOriginX);\n        }\n        if (this.touchOriginY && touchY != this.touchOriginY) {\n            this.tierHolder.scrollTop -= touchY - this.touchOriginY;\n        }\n        this.touchOriginX = touchX;\n        this.touchOriginY = touchY;\n    } else if (this.zooming && ev.touches.length == 2) {\n        var sep = Math.abs(ev.touches[0].pageX - ev.touches[1].pageX);\n        if (sep != this.zoomLastSep) {\n            var cp = (ev.touches[0].pageX + ev.touches[1].pageX) / 2;\n            var scp = this.viewStart + cp / this.scale | 0;\n            this.scale = this.zoomInitialScale * (sep / this.zoomInitialSep);\n            this.viewStart = scp - cp / this.scale | 0;\n            for (var i = 0; i < this.tiers.length; ++i) {\n                tiers[i].getRenderer().drawTier(tiers[i]);\n            }\n        }\n        this.zoomLastSep = sep;\n    }\n};\n\nBrowser.prototype.touchEndHandler = function (ev) {};\n\nBrowser.prototype.touchCancelHandler = function (ev) {};\n\nBrowser.prototype.makeTier = function (source, config) {\n    try {\n        return this.realMakeTier(source, config);\n    } catch (e) {\n        console.log('Error initializing', source);\n        console.log(e.stack || e);\n    }\n};\n\nBrowser.prototype.realMakeTier = function (source, config) {\n    var thisB = this;\n    var background = null;\n    if (this.tierBackgroundColors) {\n        background = this.tierBackgroundColors[this.tiers.length % this.tierBackgroundColors.length];\n    }\n\n    var tier = new DasTier(this, source, config, background);\n    tier.oorigin = this.viewStart;\n\n    var isDragging = false;\n    var dragOrigin, dragMoveOrigin;\n    var hoverTimeout;\n\n    var featureLookup = function featureLookup(rx, ry) {\n        var st = tier.subtiers;\n        if (!st) {\n            return;\n        }\n\n        var sti = 0;\n        ry -= tier.padding;;\n        while (sti < st.length && ry > st[sti].height && sti < st.length - 1) {\n            ry = ry - st[sti].height - tier.padding;\n            ++sti;\n        }\n        if (sti >= st.length) {\n            return;\n        }\n\n        var glyphs = st[sti].glyphs;\n        var viewCenter = (thisB.viewStart + thisB.viewEnd) / 2;\n        var offset = (tier.glyphCacheOrigin - thisB.viewStart) * thisB.scale;\n        rx -= offset;\n\n        return glyphLookup(glyphs, rx, ry);\n    };\n\n    var dragMoveHandler = function dragMoveHandler(ev) {\n        ev.preventDefault();ev.stopPropagation();\n        var rx = ev.clientX;\n        if (rx != dragMoveOrigin) {\n            thisB.move(rx - dragMoveOrigin, true);\n            dragMoveOrigin = rx;\n        }\n        thisB.isDragging = true;\n    };\n\n    var dragUpHandler = function dragUpHandler(ev) {\n        window.removeEventListener('mousemove', dragMoveHandler, true);\n        window.removeEventListener('mouseup', dragUpHandler, true);\n        thisB.move(ev.clientX - dragMoveOrigin); // Snap back (FIXME: consider animation)\n    };\n\n    tier.viewport.addEventListener('mousedown', function (ev) {\n        thisB.browserHolder.focus();\n        ev.preventDefault();\n        var br = tier.row.getBoundingClientRect();\n        var rx = ev.clientX,\n            ry = ev.clientY;\n\n        window.addEventListener('mousemove', dragMoveHandler, true);\n        window.addEventListener('mouseup', dragUpHandler, true);\n        dragOrigin = dragMoveOrigin = rx;\n        thisB.isDragging = false; // Not dragging until a movement event arrives.\n    }, false);\n\n    tier.viewport.addEventListener('mousemove', function (ev) {\n        var br = tier.row.getBoundingClientRect();\n        var rx = ev.clientX - br.left,\n            ry = ev.clientY - br.top;\n\n        var hit = featureLookup(rx, ry);\n        if (hit && hit.length > 0) {\n            tier.row.style.cursor = 'pointer';\n        } else {\n            tier.row.style.cursor = 'default';\n        }\n\n        if (hoverTimeout) {\n            clearTimeout(hoverTimeout);\n        }\n\n        if (isDragging) {\n            // if (tier.dasSource.tier_type !== 'sequence' && rx != dragMoveOrigin) {\n            //    thisB.move((rx - dragMoveOrigin));\n            //    dragMoveOrigin = rx;\n            // }\n        } else {\n            hoverTimeout = setTimeout(function () {\n                var hit = featureLookup(rx, ry);\n                if (hit && hit.length > 0) {\n                    thisB.notifyFeatureHover(ev, hit[hit.length - 1], hit, tier);\n                }\n            }, 1000);\n        }\n    });\n\n    var doubleClickTimeout = null;\n    tier.viewport.addEventListener('mouseup', function (ev) {\n        var br = tier.row.getBoundingClientRect();\n        var rx = ev.clientX - br.left,\n            ry = ev.clientY - br.top;\n\n        var hit = featureLookup(rx, ry);\n        if (hit && hit.length > 0 && !thisB.isDragging) {\n            if (doubleClickTimeout) {\n                clearTimeout(doubleClickTimeout);\n                doubleClickTimeout = null;\n                thisB.featureDoubleClick(hit, rx, ry);\n            } else {\n                doubleClickTimeout = setTimeout(function () {\n                    doubleClickTimeout = null;\n                    thisB.notifyFeature(ev, hit[hit.length - 1], hit, tier);\n                }, 500);\n            }\n        }\n\n        if (thisB.isDragging && rx != dragOrigin && tier.sequenceSource) {\n            var a = thisB.viewStart + rx / thisB.scale;\n            var b = thisB.viewStart + dragOrigin / thisB.scale;\n\n            var min, max;\n            if (a < b) {\n                min = a | 0;max = b | 0;\n            } else {\n                min = b | 0;max = a | 0;\n            }\n\n            thisB.notifyRegionSelect(thisB.chr, min, max);\n        }\n        thisB.isDragging = false;\n    }, false);\n\n    tier.viewport.addEventListener('mouseout', function (ev) {\n        isDragging = false;\n    });\n\n    tier.removeButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n            if (thisB.tiers[ti] === tier) {\n                thisB.removeTier({ index: ti });\n                break;\n            }\n        }\n    }, false);\n    tier.nameButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n\n        if (ev.shiftKey) {\n            var hitTier = -1;\n            for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                if (thisB.tiers[ti] === tier) {\n                    hitTier = ti;\n                    break;\n                }\n            }\n            if (hitTier >= 0) {\n                var i = thisB.selectedTiers.indexOf(hitTier);\n                if (i >= 0) {\n                    thisB.selectedTiers.splice(i, 1);\n                } else {\n                    thisB.selectedTiers.push(hitTier);\n                    thisB.selectedTiers.sort();\n                }\n                thisB.markSelectedTiers();\n                thisB.notifyTierSelection();\n\n                if (thisB.selectedTiers.length > 0) {\n                    thisB.browserHolder.focus();\n                } else {\n                    thisB.notifyTierSelectionWrap(-1);\n                }\n            }\n        } else {\n            for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                if (thisB.tiers[ti] === tier) {\n                    thisB.browserHolder.focus();\n                    if (thisB.selectedTiers.length != 1 || thisB.selectedTiers[0] != ti) {\n                        thisB.setSelectedTier(ti);\n                        return;\n                    }\n                }\n            }\n\n            if (!tier.infoVisible) {\n                tier.infoElement.style.display = 'block';\n                tier.updateHeight();\n                tier.infoVisible = true;\n            } else {\n                tier.infoElement.style.display = 'none';\n                tier.updateHeight();\n                tier.infoVisible = false;\n            }\n        }\n    }, false);\n    tier.bumpButton.addEventListener('click', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        var bumpStatus;\n        var t = tier;\n        if (t.dasSource.collapseSuperGroups) {\n            if (bumpStatus === undefined) {\n                bumpStatus = !t.bumped;\n            }\n            t.mergeConfig({ bumped: bumpStatus });\n        }\n    }, false);\n\n    var dragLabel;\n    var dragTierHolder;\n    var dragTierHolderScrollLimit;\n    var tierOrdinal;\n    var yAtLastReorder;\n    var tiersWereReordered = false;\n\n    var labelDragHandler = function labelDragHandler(ev) {\n        var label = tier.label;\n\n        ev.stopPropagation();ev.preventDefault();\n        if (!dragLabel) {\n            if (tier.pinned) {\n                dragTierHolder = thisB.pinnedTierHolder;\n            } else {\n                dragTierHolder = thisB.tierHolder;\n            }\n            dragTierHolderScrollLimit = dragTierHolder.scrollHeight - dragTierHolder.offsetHeight;\n\n            dragLabel = label.cloneNode(true);\n            dragLabel.style.cursor = 'pointer';\n            dragTierHolder.appendChild(dragLabel);\n            label.style.visibility = 'hidden';\n\n            for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                if (thisB.tiers[ti] === tier) {\n                    tierOrdinal = ti;\n                    break;\n                }\n            }\n\n            yAtLastReorder = ev.clientY;\n        }\n\n        var holderBCR = dragTierHolder.getBoundingClientRect();\n        dragLabel.style.left = label.getBoundingClientRect().left - holderBCR.left + 'px';\n        dragLabel.style.top = ev.clientY - holderBCR.top + dragTierHolder.scrollTop - 10 + 'px';\n\n        var pty = ev.clientY - holderBCR.top + dragTierHolder.scrollTop;\n        for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n            var tt = thisB.tiers[ti];\n            if (tt.pinned ^ tier.pinned) continue;\n\n            var ttr = tt.row.getBoundingClientRect();\n            pty -= ttr.bottom - ttr.top;\n            if (pty < 0) {\n                if (ti < tierOrdinal && ev.clientY < yAtLastReorder || ti > tierOrdinal && ev.clientY > yAtLastReorder) {\n                    thisB.withPreservedSelection(function () {\n                        thisB.tiers.splice(tierOrdinal, 1);\n                        thisB.tiers.splice(ti, 0, tier);\n                        thisB._ensureTiersGrouped(ti > tierOrdinal);\n                    });\n\n                    for (var tix = 0; tix < thisB.tiers.length; ++tix) {\n                        if (thisB.tiers[tix] == tier) tierOrdinal = tix;\n                    }yAtLastReorder = ev.clientY;\n                    thisB.reorderTiers();\n                    dragTierHolder.appendChild(dragLabel); // Because reorderTiers removes all children.\n                    tiersWereReordered = true;\n                }\n                break;\n            }\n        }\n\n        if (dragLabel.offsetTop < dragTierHolder.scrollTop) {\n            dragTierHolder.scrollTop -= dragTierHolder.scrollTop - dragLabel.offsetTop;\n        } else if (dragLabel.offsetTop + dragLabel.offsetHeight > dragTierHolder.scrollTop + dragTierHolder.offsetHeight) {\n            dragTierHolder.scrollTop = Math.min(dragTierHolder.scrollTop + (dragLabel.offsetTop + dragLabel.offsetHeight) - (dragTierHolder.scrollTop + dragTierHolder.offsetHeight), dragTierHolderScrollLimit);\n        }\n    };\n\n    var labelReleaseHandler = function labelReleaseHandler(ev) {\n        var label = tier.label;\n\n        ev.stopPropagation();ev.preventDefault();\n        if (dragLabel) {\n            dragLabel.style.cursor = 'auto';\n            dragTierHolder.removeChild(dragLabel);\n            dragLabel = null;\n            label.style.visibility = 'visible';\n        }\n        document.removeEventListener('mousemove', labelDragHandler, false);\n        document.removeEventListener('mouseup', labelReleaseHandler, false);\n\n        if (tiersWereReordered) {\n            for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n                if (thisB.tiers[ti] == tier) {\n                    thisB.setSelectedTier(ti);\n                    break;\n                }\n            }\n            thisB.notifyTier(\"reordered\", tier);\n        }\n    };\n\n    tier.label.addEventListener('mousedown', function (ev) {\n        ev.stopPropagation();ev.preventDefault();\n        tiersWereReordered = false;\n        document.addEventListener('mousemove', labelDragHandler, false);\n        document.addEventListener('mouseup', labelReleaseHandler, false);\n    }, false);\n\n    this.tiers.push(tier); // NB this currently tells any extant knownSpace about the new tier.\n\n    // fetches stylesheet\n    return tier.init().then(function (updatedTier) {\n        updatedTier.currentlyHeight = 50;\n        thisB.updateHeight();\n        updatedTier.updateLabel();\n\n        thisB.withPreservedSelection(thisB._ensureTiersGrouped);\n        updatedTier._updateFromConfig();\n        thisB.reorderTiers();\n\n        return updatedTier;\n    });\n};\n\nBrowser.prototype.reorderTiers = function () {\n    removeChildren(this.tierHolder);\n    removeChildren(this.pinnedTierHolder);\n    if (this.disablePinning) {\n        this.tierHolder.appendChild(this.ruler);\n        this.tierHolder.appendChild(this.ruler2);\n    }\n    var hasPinned = false;\n    var pinnedTiers = [],\n        unpinnedTiers = [];\n    for (var i = 0; i < this.tiers.length; ++i) {\n        var t = this.tiers[i];\n        var visible = ['sub', 'dummy'].indexOf(this.tiers[i].dasSource.renderer) === -1;\n        if (t.pinned && !this.disablePinning) {\n            pinnedTiers.push(t);\n            if (visible) this.pinnedTierHolder.appendChild(this.tiers[i].row);\n            hasPinned = true;\n        } else {\n            unpinnedTiers.push(t);\n            if (visible) this.tierHolder.appendChild(this.tiers[i].row);\n        }\n    }\n\n    this.withPreservedSelection(function () {\n        this.tiers.splice(0, this.tiers.length);\n        for (var i = 0; i < pinnedTiers.length; ++i) {\n            this.tiers.push(pinnedTiers[i]);\n        }for (var i = 0; i < unpinnedTiers.length; ++i) {\n            this.tiers.push(unpinnedTiers[i]);\n        }\n    });\n\n    if (hasPinned) this.pinnedTierHolder.classList.add('tier-holder-pinned-full');else this.pinnedTierHolder.classList.remove('tier-holder-pinned-full');\n\n    this.arrangeTiers();\n};\n\nBrowser.prototype.withPreservedSelection = function (f) {\n    var st = [];\n    for (var xi = 0; xi < this.selectedTiers.length; ++xi) {\n        st.push(this.tiers[this.selectedTiers[xi]]);\n    }\n\n    f.call(this);\n\n    this.selectedTiers = [];\n    for (var sti = 0; sti < this.tiers.length; ++sti) {\n        if (st.indexOf(this.tiers[sti]) >= 0) this.selectedTiers.push(sti);\n    }\n};\n\nBrowser.prototype.refreshTier = function (tier, tierCallback) {\n    var renderer = this.getTierRenderer(tier);\n    if (tier.dasSource.renderer === 'multi') {\n        renderer.drawTier(tier);\n    } else {\n        var renderCallback = tierCallback || renderer.renderTier;\n        if (this.knownSpace) {\n            this.knownSpace.invalidate(tier, renderCallback);\n        }\n    }\n};\n\nBrowser.prototype.getTierRenderer = function (tier) {\n    var renderer = tier.dasSource.renderer || this.defaultRenderer;\n    if (typeof renderer === 'string') {\n        return this.renderers[renderer];\n    } else if (typeof renderer.renderTier === 'function' && typeof renderer.drawTier === 'function') {\n        return renderer;\n    } else {\n        console.log(\"Tier doesn't have a renderer\");\n    }\n};\n\n/* Internal use only, assumes selection is being managed elsewhere... */\n\nBrowser.prototype._ensureTiersGrouped = function (down) {\n    var groupedTiers = {};\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var t = this.tiers[ti];\n        if (t.dasSource.tierGroup) {\n            pusho(groupedTiers, t.dasSource.tierGroup, t);\n        }\n    }\n\n    var newTiers = [];\n    if (down) this.tiers.reverse();\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var t = this.tiers[ti];\n        if (t.dasSource.tierGroup) {\n            var nt = groupedTiers[t.dasSource.tierGroup];\n            if (nt) {\n                if (down) nt.reverse();\n                for (var nti = 0; nti < nt.length; ++nti) {\n                    newTiers.push(nt[nti]);\n                }groupedTiers[t.dasSource.tierGroup] = null;\n            }\n        } else {\n            newTiers.push(t);\n        }\n    }\n    if (down) newTiers.reverse();\n    this.tiers.splice(0, this.tiers.length);\n    for (var nti = 0; nti < newTiers.length; ++nti) {\n        this.tiers.push(newTiers[nti]);\n    }\n};\n\nBrowser.prototype.arrangeTiers = function () {\n    var arrangedTiers = [];\n    var groupedTiers = {};\n\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var t = this.tiers[ti];\n        if (t.pinned) {\n            arrangedTiers.push(t);\n            if (t.dasSource.tierGroup) {\n                pusho(groupedTiers, t.dasSource.tierGroup, t);\n            }\n        }\n    }\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var t = this.tiers[ti];\n        if (!t.pinned) {\n            arrangedTiers.push(t);\n            if (t.dasSource.tierGroup) {\n                pusho(groupedTiers, t.dasSource.tierGroup, t);\n            }\n        }\n    }\n\n    for (var g in groupedTiers) {\n        var tiers = groupedTiers[g];\n        var tierGroup = this.tierGroups[g];\n        if (!tierGroup) {\n            tierGroup = {\n                element: makeElement('div', makeElement('span', g, { className: 'tier-group-label' }), { className: \"tier-group\" })\n            };\n            this.tierGroups[g] = tierGroup;\n        }\n\n        if (tierGroup.element.parentNode) tierGroup.element.parentNode.removeChild(tierGroup.element);\n\n        var holder = tiers[0].pinned ? this.pinnedTierHolder : this.tierHolder;\n        var min = 10000000,\n            max = 0;\n        for (var ti = 0; ti < tiers.length; ++ti) {\n            var row = tiers[ti].row;\n            min = Math.min(min, row.offsetTop);\n            max = Math.max(max, row.offsetTop + row.offsetHeight);\n        }\n        tierGroup.element.style.top = min + 'px';\n        tierGroup.element.style.left = '0px';\n        tierGroup.element.style.height = max - min + 'px';\n        holder.appendChild(tierGroup.element);\n    }\n\n    if (this.tierBackgroundColors) {\n        for (var ti = 0; ti < arrangedTiers.length; ++ti) {\n            var t = arrangedTiers[ti];\n            t.setBackground(this.tierBackgroundColors[ti % this.tierBackgroundColors.length]);\n            if (t.dasSource.tierGroup) t.label.style.left = '18px';else t.label.style.left = '2px';\n            t.background = this.tierBackgroundColors[ti % this.tierBackgroundColors.length];\n        }\n    }\n};\n\nBrowser.prototype.refresh = function () {\n    this.retrieveTierData(this.tiers);\n    this.drawOverlays();\n    this.positionRuler();\n};\n\nvar defaultTierRenderer = function defaultTierRenderer(status, tier) {\n    console.log(\"DEPRECATED!\");\n};\n\nBrowser.prototype.retrieveTierData = function (tiers) {\n    this.notifyLocation();\n    var width = this.viewEnd - this.viewStart + 1;\n    var minExtraW = this.minExtraWidth / this.scale | 0;\n    var maxExtraW = this.maxExtraWidth / this.scale | 0;\n\n    var newOrigin = (this.viewStart + this.viewEnd) / 2;\n    var oh = newOrigin - this.origin;\n    this.origin = newOrigin;\n    this.scaleAtLastRedraw = this.scale;\n    for (var t = 0; t < tiers.length; ++t) {\n        var od = oh;\n        if (tiers[t].originHaxx) {\n            od += tiers[t].originHaxx;\n        }\n        tiers[t].originHaxx = od;\n    }\n\n    var scaledQuantRes = this.targetQuantRes / this.scale;\n\n    var innerDrawnStart = Math.max(1, (this.viewStart | 0) - minExtraW);\n    var innerDrawnEnd = Math.min((this.viewEnd | 0) + minExtraW, (this.currentSeqMax | 0) > 0 ? this.currentSeqMax | 0 : 1000000000);\n    var outerDrawnStart = Math.max(1, (this.viewStart | 0) - maxExtraW);\n    var outerDrawnEnd = Math.min((this.viewEnd | 0) + maxExtraW, (this.currentSeqMax | 0) > 0 ? this.currentSeqMax | 0 : 1000000000);\n\n    if (!this.knownSpace || this.knownSpace.chr !== this.chr) {\n        var ss = this.getSequenceSource();\n        if (this.knownSpace) this.knownSpace.cancel();\n        // known space is created based on the entire tier list, for future caching purposes, even if only a subset of the tiers are needed to be rendered now.\n        this.knownSpace = new KnownSpace(this.tiers, this.chr, outerDrawnStart, outerDrawnEnd, scaledQuantRes, ss);\n    }\n\n    var seg = this.knownSpace.bestCacheOverlapping(this.chr, innerDrawnStart, innerDrawnEnd);\n    if (seg && seg.min <= innerDrawnStart && seg.max >= innerDrawnEnd) {\n        this.drawnStart = Math.max(seg.min, outerDrawnStart);\n        this.drawnEnd = Math.min(seg.max, outerDrawnEnd);\n    } else {\n        this.drawnStart = outerDrawnStart;\n        this.drawnEnd = outerDrawnEnd;\n    }\n    // send in the subset of tiers to retrieve.\n    this.knownSpace.retrieveFeatures(tiers, this.chr, this.drawnStart, this.drawnEnd, scaledQuantRes);\n};\n\nfunction setSources(msh, availableSources, maybeMapping) {\n    if (maybeMapping) {\n        for (var s = 0; s < availableSources.length; ++s) {\n            availableSources[s].mapping = maybeMapping;\n        }\n    }\n    msh.set(availableSources);\n}\n\nBrowser.prototype.queryRegistry = function (maybeMapping, tryCache) {\n    if (!this.registry) return;\n\n    var thisB = this;\n    var coords, msh;\n    if (maybeMapping) {\n        coords = this.chains[maybeMapping].coords;\n        if (!thisB.mappableSources[maybeMapping]) {\n            thisB.mappableSources[maybeMapping] = new Observed();\n        }\n        msh = thisB.mappableSources[maybeMapping];\n    } else {\n        coords = this.coordSystem;\n        msh = this.availableSources;\n    }\n    var cacheHash = hex_sha1(miniJSONify(coords));\n    if (tryCache) {\n        var cacheTime = localStorage['dalliance.registry.' + cacheHash + '.last_queried'];\n        if (cacheTime) {\n            try {\n                setSources(msh, JSON.parse(localStorage['dalliance.registry.' + cacheHash + '.sources']), maybeMapping);\n                var cacheAge = (Date.now() | 0) - (cacheTime | 0);\n                if (cacheAge < 12 * 60 * 60 * 1000) {\n                    return;\n                }\n            } catch (rex) {\n                console.log('Bad registry cache: ' + rex);\n            }\n        }\n    }\n\n    var rurl = this.registry;\n    if (rurl.indexOf('//') == 0) {\n        var proto = window.location.protocol;\n        if (proto != 'https:' && proto != 'http:') rurl = 'http:' + rurl;\n    }\n    new DASRegistry(rurl).sources(function (sources) {\n        var availableSources = [];\n        for (var s = 0; s < sources.length; ++s) {\n            var source = sources[s];\n            if (!source.coords || source.coords.length == 0) {\n                continue;\n            }\n            var scoords = source.coords[0];\n            if (scoords.taxon != coords.taxon || scoords.auth != coords.auth || scoords.version != coords.version) {\n                continue;\n            }\n            availableSources.push(source);\n        }\n\n        localStorage['dalliance.registry.' + cacheHash + '.sources'] = JSON.stringify(availableSources);\n        localStorage['dalliance.registry.' + cacheHash + '.last_queried'] = '' + Date.now();\n\n        setSources(msh, availableSources, maybeMapping);\n    }, function (error) {\n        // msh.set(null);\n    }, coords);\n};\n\n//\n// Navigation\n//\n\nBrowser.prototype.move = function (pos, soft) {\n    var wid = this.viewEnd - this.viewStart;\n    var nStart = this.viewStart - 1.0 * pos / this.scale;\n    var nEnd = nStart + wid;\n\n    if (!soft) {\n        if (this.currentSeqMax > 0 && nEnd > this.currentSeqMax) {\n            nEnd = this.currentSeqMax;\n            nStart = this.viewEnd - wid;\n        }\n        if (nStart < 1) {\n            nStart = 1;\n            nEnd = nStart + wid;\n        }\n    }\n\n    this.setLocation(null, nStart, nEnd, null, soft);\n};\n\nBrowser.prototype.zoomStep = function (delta) {\n    var oz = 1.0 * this.zoomSliderValue;\n    var nz = oz + delta;\n    if (nz < this.zoomMin) {\n        nz = this.zoomMin;\n    }\n    if (nz > this.zoomMax) {\n        nz = this.zoomMax;\n    }\n\n    if (nz != oz) {\n        this.zoomSliderValue = nz; // FIXME maybe ought to set inside zoom!\n        this.zoom(Math.exp(1.0 * nz / this.zoomExpt));\n    }\n};\n\nBrowser.prototype.zoom = function (factor) {\n    this.zoomFactor = factor;\n    var viewCenter = Math.round((this.viewStart + this.viewEnd) / 2.0) | 0;\n    this.viewStart = viewCenter - this.zoomBase * this.zoomFactor / 2;\n    this.viewEnd = viewCenter + this.zoomBase * this.zoomFactor / 2;\n    if (this.currentSeqMax > 0 && this.viewEnd > this.currentSeqMax + 5) {\n        var len = this.viewEnd - this.viewStart + 1;\n        this.viewEnd = this.currentSeqMax;\n        this.viewStart = this.viewEnd - len + 1;\n    }\n    if (this.viewStart < 1) {\n        var len = this.viewEnd - this.viewStart + 1;\n        this.viewStart = 1;\n        this.viewEnd = this.viewStart + len - 1;\n    }\n    this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n    var width = this.viewEnd - this.viewStart + 1;\n\n    var scaleRat = this.scale / this.scaleAtLastRedraw;\n\n    this.notifyLocation();\n    this.refresh();\n};\n\nBrowser.prototype.spaceCheck = function (dontRefresh) {\n    if (!this.knownSpace || this.knownSpace.chr !== this.chr) {\n        this.refresh();\n        return;\n    }\n\n    var width = (this.viewEnd - this.viewStart | 0) + 1;\n    var minExtraW = this.minExtraWidth / this.scale | 0;\n    var maxExtraW = this.maxExtraWidth / this.scale | 0;\n\n    if ((this.drawnStart | 0) > Math.max(1, (this.viewStart | 0) - minExtraW | 0) || (this.drawnEnd | 0) < Math.min((this.viewEnd | 0) + minExtraW, (this.currentSeqMax | 0) > 0 ? this.currentSeqMax | 0 : 1000000000)) {\n        this.refresh();\n    }\n};\n\nBrowser.prototype.resizeViewer = function (skipRefresh) {\n    var width = this.tierHolder.getBoundingClientRect().width | 0;\n    if (width == 0) return;\n\n    var oldFPW = Math.max(this.featurePanelWidth, 300); // Can get silly values stored\n    // when the browser is hidden.\n    this.featurePanelWidth = width | 0;\n\n    if (oldFPW != this.featurePanelWidth) {\n        this.zoomMax = this.zoomExpt * Math.log(this.maxViewWidth / this.zoomBase);\n        this.zoomMin = this.zoomExpt * Math.log(this.featurePanelWidth / this.maxPixelsPerBase / this.zoomBase); // FIXME hard-coded minimum.\n        this.zoomSliderValue = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n        var viewWidth = this.viewEnd - this.viewStart;\n        var nve = this.viewStart + viewWidth * this.featurePanelWidth / oldFPW;\n\n        this.viewEnd = nve;\n\n        var wid = this.viewEnd - this.viewStart + 1;\n        if (this.currentSeqMax > 0 && this.viewEnd > this.currentSeqMax) {\n            this.viewEnd = this.currentSeqMax;\n            this.viewStart = this.viewEnd - wid + 1;\n        }\n        if (this.viewStart < 1) {\n            this.viewStart = 1;\n            this.viewEnd = this.viewStart + wid - 1;\n        }\n\n        this.positionRuler();\n\n        if (!skipRefresh) {\n            this.spaceCheck();\n        }\n        this.notifyLocation();\n    }\n\n    if (this.fullScreen) {\n        this.setFullScreenHeight();\n    }\n};\n\nBrowser.prototype.setFullScreenHeight = function () {\n    var rest = document.body.offsetHeight - this.browserHolder.offsetHeight;\n    this.browserHolder.style.maxHeight = Math.max(300, window.innerHeight - rest - 20) + 'px';\n};\n\nBrowser.prototype.addTier = function (conf) {\n    var thisB = this;\n    conf = shallowCopy(conf);\n    conf.disabled = false;\n\n    return this.makeTier(conf).then(function (tier) {\n        thisB.refreshTier(tier);\n        thisB.markSelectedTiers();\n        thisB.positionRuler();\n        thisB.notifyTier(\"added\", tier);\n        return tier;\n    });\n};\n\nBrowser.prototype.removeTier = function (conf, force) {\n    var target = -1;\n\n    if (typeof conf.index !== 'undefined' && conf.index >= 0 && conf.index < this.tiers.length) {\n        target = conf.index;\n    } else {\n        for (var ti = 0; ti < this.tiers.length; ++ti) {\n            var ts = this.tiers[ti].dasSource;\n\n            if (sourcesAreEqual(conf, ts)) {\n                target = ti;break;\n            }\n        }\n    }\n\n    if (target < 0) {\n        throw \"Couldn't find requested tier\";\n    }\n\n    var targetTier = this.tiers[target];\n    this.tiers.splice(target, 1);\n\n    var nst = [];\n    for (var sti = 0; sti < this.selectedTiers.length; ++sti) {\n        var st = this.selectedTiers[sti];\n        if (st < target) {\n            nst.push(st);\n        } else if (st > target) {\n            nst.push(st - 1);\n        }\n    }\n    this.selectedTiers = nst;\n    this.markSelectedTiers();\n\n    targetTier.destroy();\n    if (this.knownSpace) {\n        this.knownSpace.featureCache[targetTier] = null;\n    }\n\n    this.reorderTiers();\n    this.notifyTier(\"removed\", targetTier);\n};\n\nBrowser.prototype.removeAllTiers = function () {\n    var thisB = this;\n    this.selectedTiers = [];\n    this.markSelectedTiers();\n    this.tiers.forEach(function (targetTier) {\n        targetTier.destroy();\n        if (thisB.knownSpace) {\n            thisB.knownSpace.featureCache[targetTier] = null;\n        }\n    });\n    this.tiers.length = 0;\n    this.reorderTiers();\n    this.notifyTier(\"removedAll\", null);\n};\n\nBrowser.prototype.getSequenceSource = function () {\n    if (this._sequenceSource === undefined) this._sequenceSource = this._getSequenceSource();\n    return this._sequenceSource;\n};\n\nBrowser.prototype._getSequenceSource = function () {\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        if (this.tiers[ti].sequenceSource) {\n            return this.tiers[ti].sequenceSource;\n        }\n    }\n\n    for (var si = 0; si < this.defaultSources.length; ++si) {\n        var s = this.defaultSources[si];\n        if (s.provides_entrypoints || s.tier_type == 'sequence' || s.twoBitURI || s.twoBitBlob) {\n            if (s.twoBitURI || s.twoBitBlob) {\n                return new TwoBitSequenceSource(s);\n            } else if (s.ensemblURI) {\n                return new EnsemblSequenceSource(s);\n            } else {\n                return new DASSequenceSource(s);\n            }\n        }\n    }\n};\n\nBrowser.prototype.setLocation = function (newChr, newMin, newMax, callback, soft) {\n    if (typeof newMin !== 'number') {\n        throw Error('minimum must be a number (got ' + JSON.stringify(newMin) + ')');\n    }\n    if (typeof newMax !== 'number') {\n        throw Error('maximum must be a number (got ' + JSON.stringify(newMax) + ')');\n    }\n\n    if (newMin > newMax) {\n        var oldNewMin = newMin;\n        newMin = newMax;\n        newMax = oldNewMin;\n    } else if (newMin === newMax) {\n        newMax += 1;\n    }\n\n    if (!callback) {\n        callback = function callback(err) {\n            if (err) {\n                throw err;\n            }\n        };\n    }\n    var thisB = this;\n\n    if ((!newChr || newChr == this.chr) && this.currentSeqMax > 0) {\n        return this._setLocation(null, newMin, newMax, null, callback, soft);\n    } else {\n        var ss = this.getSequenceSource();\n        if (!ss) {\n            return callback('Need a sequence source');\n        }\n\n        var findChr = newChr || this.chr;\n        ss.getSeqInfo(findChr, function (si) {\n            if (!si) {\n                var altChr;\n                if (findChr.indexOf('chr') == 0) {\n                    altChr = findChr.substr(3);\n                } else {\n                    altChr = 'chr' + findChr;\n                }\n                ss.getSeqInfo(altChr, function (si2) {\n                    if (!si2 && newChr) {\n                        return callback(\"Couldn't find sequence '\" + newChr + \"'\");\n                    } else if (!si2) {\n                        return thisB._setLocation(null, newMin, newMax, null, callback, soft);\n                    } else {\n                        return thisB._setLocation(altChr, newMin, newMax, si2, callback, soft);\n                    }\n                });\n            } else {\n                return thisB._setLocation(newChr, newMin, newMax, si, callback, soft);\n            }\n        });\n    }\n};\n\nBrowser.prototype._setLocation = function (newChr, newMin, newMax, newChrInfo, callback, soft) {\n    var chrChanged = false;\n    if (newChr) {\n        if (newChr.indexOf('chr') == 0) newChr = newChr.substring(3);\n\n        if (this.chr != newChr) chrChanged = true;\n        this.chr = newChr;\n        this.currentSeqMax = newChrInfo.length;\n    }\n\n    newMin = parseFloat(newMin);newMax = parseFloat(newMax);\n\n    var newWidth = Math.max(10, newMax - newMin + 1);\n\n    if (!soft) {\n        var csm = this.currentSeqMax;\n        if (csm <= 0) csm = 1000000000000;\n        if (newMin < 1) {\n            newMin = 1;newMax = newMin + newWidth - 1;\n        }\n        if (newMax > csm) {\n            newMax = csm;\n            newMin = Math.max(1, newMax - newWidth + 1);\n        }\n    }\n\n    this.viewStart = newMin;\n    this.viewEnd = newMax;\n    var newScale = Math.max(this.featurePanelWidth || this.offscreenInitWidth, 50) / (this.viewEnd - this.viewStart);\n    var oldScale = this.scale;\n    var scaleChanged = Math.abs(newScale - oldScale) > 0.000001;\n    this.scale = newScale;\n\n    var newZS, oldZS;\n    oldZS = this.zoomSliderValue;\n    this.zoomSliderValue = newZS = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n    if (scaleChanged || chrChanged) {\n        for (var i = 0; i < this.tiers.length; ++i) {\n            this.tiers[i].viewportHolder.style.left = '5000px';\n            this.tiers[i].overlay.style.left = '5000px';\n        }\n\n        this.refresh();\n        // var self = this;\n        // this.tiers.forEach(function(tier) {self.refreshTier(tier);});\n        // this.refreshTier\n\n        if (this.savedZoom) {\n            newZS -= this.zoomMin;\n            oldZS -= this.zoomMin;\n            var difToActive = newZS - oldZS;\n            var difToSaved = newZS - this.savedZoom;\n            if (Math.abs(difToActive) > Math.abs(difToSaved)) {\n                this.isSnapZooming = !this.isSnapZooming;\n                this.savedZoom = oldZS;\n            }\n        } else {\n            this.isSnapZooming = false;\n            this.savedZoom = null;\n        }\n    } else {\n        var viewCenter = (this.viewStart + this.viewEnd) / 2;\n\n        for (var i = 0; i < this.tiers.length; ++i) {\n            var offset = (this.viewStart - this.tiers[i].norigin) * this.scale;\n            this.tiers[i].viewportHolder.style.left = '' + ((-offset | 0) - 1000) + 'px';\n            this.tiers[i].drawOverlay();\n        }\n    }\n\n    this.notifyLocation();\n\n    this.spaceCheck();\n    if (this.instrumentActivity) this.activityStartTime = Date.now() | 0;\n    return callback();\n};\n\nBrowser.prototype.setCenterLocation = function (newChr, newCenterLoc) {\n    var halfWidth = (this.viewEnd - this.viewStart) / 2,\n        newMin = newCenterLoc - halfWidth,\n        newMax = newCenterLoc + halfWidth;\n    this.setLocation(newChr, newMin, newMax);\n};\n\nBrowser.prototype.pingActivity = function () {\n    if (!this.instrumentActivity || !this.activityStartTime) return;\n\n    var activity = 0;\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        if (this.tiers[ti].loaderButton.style.display !== 'none') ++activity;\n    }\n\n    if (activity == 0) {\n        var now = Date.now() | 0;\n        console.log('Loading took ' + (now - this.activityStartTime) + 'ms');\n        this.activityStartTime = null;\n    }\n};\n\nBrowser.prototype.addInitListener = function (handler) {\n    this.initListeners.push(handler);\n};\n\nBrowser.prototype.addFeatureListener = function (handler, opts) {\n    opts = opts || {};\n    this.featureListeners.push(handler);\n};\n\nBrowser.prototype.removeFeatureListener = function (handler, opts) {\n    var idx = arrayIndexOf(this.featureListeners, handler);\n    if (idx >= 0) {\n        this.featureListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyFeature = function (ev, feature, hit, tier) {\n    for (var fli = 0; fli < this.featureListeners.length; ++fli) {\n        try {\n            if (this.featureListeners[fli](ev, feature, hit, tier)) return;\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.addFeatureHoverListener = function (handler, opts) {\n    opts = opts || {};\n    this.featureHoverListeners.push(handler);\n};\n\nBrowser.prototype.removeFeatureHoverListener = function (handler, opts) {\n    var idx = arrayIndexOf(this.featureHoverListeners, handler);\n    if (idx >= 0) {\n        this.featureHoverListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyFeatureHover = function (ev, feature, hit, tier) {\n    for (var fli = 0; fli < this.featureHoverListeners.length; ++fli) {\n        try {\n            this.featureHoverListeners[fli](ev, feature, hit, tier);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.addViewListener = function (handler, opts) {\n    opts = opts || {};\n    this.viewListeners.push(handler);\n};\n\nBrowser.prototype.removeViewListener = function (handler, opts) {\n    var idx = arrayIndexOf(this.viewListeners, handler);\n    if (idx >= 0) {\n        this.viewListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyLocation = function () {\n    var nvs = Math.max(1, this.viewStart | 0);\n    var nve = this.viewEnd | 0;\n    if (this.currentSeqMax > 0 && nve > this.currentSeqMax) nve = this.currentSeqMax;\n\n    for (var lli = 0; lli < this.viewListeners.length; ++lli) {\n        try {\n            this.viewListeners[lli](this.chr, nvs, nve, this.zoomSliderValue, { current: this.zoomSliderValue,\n                alternate: this.savedZoom + this.zoomMin || this.zoomMin,\n                isSnapZooming: this.isSnapZooming,\n                min: this.zoomMin,\n                max: this.zoomMax }, this.viewStart, this.viewEnd);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.addTierListener = function (handler) {\n    this.tierListeners.push(handler);\n};\n\nBrowser.prototype.removeTierListener = function (handler) {\n    var idx = arrayIndexOf(this.tierListeners, handler);\n    if (idx >= 0) {\n        this.tierListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyTier = function (status, tier) {\n    for (var tli = 0; tli < this.tierListeners.length; ++tli) {\n        try {\n            this.tierListeners[tli](status, tier);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.addRegionSelectListener = function (handler) {\n    this.regionSelectListeners.push(handler);\n};\n\nBrowser.prototype.removeRegionSelectListener = function (handler) {\n    var idx = arrayIndexOf(this.regionSelectListeners, handler);\n    if (idx >= 0) {\n        this.regionSelectListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyRegionSelect = function (chr, min, max) {\n    for (var rli = 0; rli < this.regionSelectListeners.length; ++rli) {\n        try {\n            this.regionSelectListeners[rli](chr, min, max);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.highlightRegion = function (chr, min, max) {\n    var thisB = this;\n\n    if (chr == this.chr) {\n        return this._highlightRegion(chr, min, max);\n    }\n\n    var ss = this.getSequenceSource();\n    if (!ss) {\n        throw 'Need a sequence source';\n    }\n\n    ss.getSeqInfo(chr, function (si) {\n        if (!si) {\n            var altChr;\n            if (chr.indexOf('chr') == 0) {\n                altChr = chr.substr(3);\n            } else {\n                altChr = 'chr' + chr;\n            }\n            ss.getSeqInfo(altChr, function (si2) {\n                if (!si2) {\n                    // Fail silently.\n                } else {\n                    return thisB._highlightRegion(altChr, min, max);\n                }\n            });\n        } else {\n            return thisB._highlightRegion(chr, min, max);\n        }\n    });\n};\n\nBrowser.prototype._highlightRegion = function (chr, min, max) {\n    for (var hi = 0; hi < this.highlights.length; ++hi) {\n        var h = this.highlights[hi];\n        if (h.chr == chr && h.min == min && h.max == max) return;\n    }\n\n    this.highlights.push(new Region(chr, min, max));\n    var visStart = this.viewStart - 1000 / this.scale;\n    var visEnd = this.viewEnd + 1000 / this.scale;\n    if ((chr == this.chr || chr == 'chr' + this.chr) && min < visEnd && max > visStart) {\n        this.drawOverlays();\n    }\n\n    this.notifyLocation();\n};\n\nBrowser.prototype.clearHighlights = function () {\n    this.highlights = [];\n    this.drawOverlays();\n    this.notifyLocation();\n};\n\nBrowser.prototype.drawOverlays = function () {\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        this.tiers[ti].drawOverlay();\n    }\n};\n\nBrowser.prototype.featuresInRegion = function (chr, min, max) {\n    var features = [];\n    if (chr !== this.chr) {\n        return [];\n    }\n\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var fl = this.tiers[ti].currentFeatures || [];\n        for (var fi = 0; fi < fl.length; ++fi) {\n            var f = fl[fi];\n            if (f.min <= max && f.max >= min) {\n                features.push(f);\n            }\n        }\n    }\n    return features;\n};\n\nBrowser.prototype.getSelectedTier = function () {\n    if (this.selectedTiers.length > 0) return this.selectedTiers[0];else return -1;\n};\n\nBrowser.prototype.setSelectedTier = function (t) {\n    if (t == null) {\n        this.selectedTiers = [];\n    } else {\n        this.selectedTiers = [t];\n    }\n    this.markSelectedTiers();\n    this.notifyTierSelection();\n};\n\nBrowser.prototype.markSelectedTiers = function () {\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var button = this.tiers[ti].nameButton;\n\n        if (this.selectedTiers.indexOf(ti) >= 0) {\n            button.classList.add('active');\n        } else {\n            button.classList.remove('active');\n        }\n    }\n    if (this.selectedTiers.length > 0) {\n        var browserMid = this.browserHolder.offsetTop + this.browserHolder.offsetHeight / 2;\n        if (browserMid > document.body.scrollTop && browserMid + 100 < document.body.scrollTop + window.innerHeight) this.browserHolder.focus();\n    }\n};\n\nBrowser.prototype.addTierSelectionListener = function (handler) {\n    this.tierSelectionListeners.push(handler);\n};\n\nBrowser.prototype.removeTierSelectionListener = function (handler) {\n    var idx = arrayIndexOf(this.tierSelectionListeners, handler);\n    if (idx >= 0) {\n        this.tierSelectionListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyTierSelection = function () {\n    for (var fli = 0; fli < this.tierSelectionListeners.length; ++fli) {\n        try {\n            this.tierSelectionListeners[fli](this.selectedTiers);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.addTierSelectionWrapListener = function (f) {\n    this.tierSelectionWrapListeners.push(f);\n};\n\nBrowser.prototype.removeTierSelectionWrapListener = function (handler) {\n    var idx = arrayIndexOf(this.tierSelectionWrapListeners, handler);\n    if (idx >= 0) {\n        this.tierSelectionWrapListeners.splice(idx, 1);\n    }\n};\n\nBrowser.prototype.notifyTierSelectionWrap = function (i) {\n    for (var fli = 0; fli < this.tierSelectionWrapListeners.length; ++fli) {\n        try {\n            this.tierSelectionWrapListeners[fli](i);\n        } catch (ex) {\n            console.log(ex.stack);\n        }\n    }\n};\n\nBrowser.prototype.positionRuler = function () {\n    var display = 'none';\n    var left = '';\n    var right = '';\n\n    if (this.rulerLocation == 'center') {\n        display = 'block';\n        left = '' + (this.featurePanelWidth / 2 | 0) + 'px';\n    } else if (this.rulerLocation == 'left') {\n        display = 'block';\n        left = '0px';\n    } else if (this.rulerLocation == 'right') {\n        display = 'block';\n        right = '0px';\n    } else {\n        display = 'none';\n    }\n\n    this.ruler.style.display = display;\n    this.ruler.style.left = left;\n    this.ruler.style.right = right;\n\n    if (this.singleBaseHighlight) {\n        this.ruler2.style.display = 'block';\n        this.ruler2.style.borderWidth = '1px';\n        if (this.scale < 1) {\n            this.ruler2.style.width = '0px';\n            this.ruler2.style.borderRightWidth = '0px';\n        } else {\n            this.ruler2.style.width = this.scale + 'px';\n            this.ruler2.style.borderRightWidth = '1px';\n        }\n        // Position accompanying single base location text\n        this.locSingleBase.style.visibility = 'visible';\n        var centreOffset = this.featurePanelWidth / 2 - this.locSingleBase.offsetWidth / 2 + this.ruler2.offsetWidth / 2;\n        this.locSingleBase.style.left = '' + (centreOffset | 0) + 'px';\n    } else {\n        this.locSingleBase.style.visibility = 'hidden';\n        this.ruler2.style.width = '1px';\n        this.ruler2.style.borderWidth = '0px';\n        this.ruler2.style.display = this.rulerLocation == 'center' ? 'none' : 'block';\n    }\n\n    this.ruler2.style.left = '' + (this.featurePanelWidth / 2 | 0) + 'px';\n\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var tier = this.tiers[ti];\n        var q = tier.quantOverlay;\n\n        var quant;\n        if (tier.subtiers && tier.subtiers.length > 0) quant = tier.subtiers[0].quant;\n\n        if (q) {\n            q.style.display = quant ? display : 'none';\n            q.style.left = left;\n            q.style.right = right;\n        }\n    }\n};\n\nBrowser.prototype.featureDoubleClick = function (hit, rx, ry) {\n    if (!hit || hit.length == 0) return;\n\n    var f = hit[hit.length - 1];\n\n    if (!f.min || !f.max) {\n        return;\n    }\n\n    var fstart = ((f.min | 0) - (this.viewStart | 0)) * this.scale;\n    var fwidth = (f.max - f.min + 1) * this.scale;\n\n    var newMid = ((f.min | 0) + (f.max | 0)) / 2;\n    if (fwidth > 10) {\n        var frac = 1.0 * (rx - fstart) / fwidth;\n        if (frac < 0.3) {\n            newMid = f.min | 0;\n        } else if (frac > 0.7) {\n            newMid = (f.max | 0) + 1;\n        }\n    }\n\n    var width = this.viewEnd - this.viewStart;\n    this.setLocation(null, newMid - width / 2, newMid + width / 2);\n};\n\nBrowser.prototype.zoomForScale = function (scale) {\n    var ssScale;\n    if (scale > this.highZoomThreshold) {\n        ssScale = 'high';\n    } else if (scale > this.mediumZoomThreshold) {\n        ssScale = 'medium';\n    } else {\n        ssScale = 'low';\n    }\n    return ssScale;\n};\n\nBrowser.prototype.zoomForCurrentScale = function () {\n    return this.zoomForScale(this.scale);\n};\n\nBrowser.prototype.updateHeight = function () {\n    var tierTotal = 0;\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        tierTotal += this.tiers[ti].currentHeight || 30;\n    }this.ruler.style.height = '' + tierTotal + 'px';\n    this.ruler2.style.height = '' + tierTotal + 'px';\n    this.browserHolder.style.display = 'block';\n    this.browserHolder.style.display = '-webkit-flex';\n    this.browserHolder.style.display = 'flex';\n    // this.svgHolder.style.maxHeight = '' + Math.max(tierTotal, 500) + 'px';\n};\n\nBrowser.prototype.scrollArrowKey = function (ev, dir) {\n    if (this.reverseKeyScrolling) dir = -dir;\n\n    if (ev.ctrlKey || ev.metaKey) {\n        var fedge = false;\n        if (ev.shiftKey) {\n            fedge = true;\n        }\n\n        this.leap(dir, fedge);\n    } else if (this.scale > 1) {\n        // per-base scrolling mode, tries to perfectly center.\n        var mid = (this.viewStart + this.viewEnd) / 2;\n        var err = mid - Math.round(mid);\n        var n = 1;\n        if (ev.shiftKey) n *= 10;\n        if (dir > 0) {\n            n = -n;\n            n -= err;\n            if (err > 0) n += 1;\n        } else {\n            n -= err;\n            if (err < 0) n -= 1;\n        }\n        this.setLocation(null, this.viewStart + n, this.viewEnd + n);\n    } else {\n        this.move(ev.shiftKey ? 100 * dir : 25 * dir);\n    }\n};\n\nBrowser.prototype.leap = function (dir, fedge) {\n    var thisB = this;\n    var pos = (thisB.viewStart + thisB.viewEnd + 1) / 2 | 0;\n    if (dir > 0 && thisB.viewStart <= 1) {\n        pos -= 100000000;\n    } else if (dir < 0 && thisB.viewEnd >= thisB.currentSeqMax) {\n        pos += 100000000;\n    }\n\n    var st = thisB.getSelectedTier();\n    if (st < 0) return;\n    var tier = thisB.tiers[st];\n\n    if (tier && (tier.featureSource && this.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof tier.quantLeapThreshold == 'number' || tier.featureSource && this.sourceAdapterIsCapable(tier.featureSource, 'leap'))) {\n        tier.findNextFeature(thisB.chr, pos, -dir, fedge, function (nxt) {\n            if (nxt) {\n                var nmin = nxt.min;\n                var nmax = nxt.max;\n                if (fedge) {\n                    if (dir > 0) {\n                        if (nmin > pos + 1) {\n                            nmax = nmin;\n                        } else {\n                            nmax++;\n                            nmin = nmax;\n                        }\n                    } else {\n                        if (nmax < pos - 1) {\n                            nmax++;\n                            nmin = nmax;\n                        } else {\n                            nmax = nmin;\n                        }\n                    }\n                }\n                var wid = thisB.viewEnd - thisB.viewStart + 1;\n                if (parseFloat(wid / 2) == parseInt(wid / 2)) {\n                    wid--;\n                }\n                var newStart = (nmin + nmax - wid) / 2 + 1;\n                var newEnd = newStart + wid - 1;\n                var pos2 = pos;\n                thisB.setLocation(nxt.segment, newStart, newEnd);\n            } else {\n                alert('no next feature'); // FIXME better reporting would be nice!\n            }\n        });\n    } else {\n        this.move(100 * dir);\n    }\n};\n\nfunction glyphLookup(glyphs, rx, ry, matches) {\n    matches = matches || [];\n\n    for (var gi = glyphs.length - 1; gi >= 0; --gi) {\n        var g = glyphs[gi];\n        if (!g.notSelectable && g.min() <= rx && g.max() >= rx) {\n            if (g.minY) {\n                if (ry < g.minY() || ry > g.maxY()) continue;\n            }\n\n            if (g.feature) {\n                matches.push(g.feature);\n            } else if (g.group) {\n                matches.push(g.group);\n            }\n\n            if (g.glyphs) {\n                return glyphLookup(g.glyphs, rx, ry, matches);\n            } else if (g.glyph) {\n                return glyphLookup([g.glyph], rx, ry, matches);\n            } else {\n                return matches;\n            }\n        }\n    }\n    return matches;\n}\n\nBrowser.prototype.nameForCoordSystem = function (cs) {\n    var primary = null,\n        ucsc = null;\n    if (this.assemblyNamePrimary) {\n        primary = '' + cs.auth;\n        if (typeof cs.version !== 'undefined') primary += cs.version;\n    }\n    if (this.assemblyNameUcsc) {\n        ucsc = cs.ucscName;\n    }\n    if (primary != null && ucsc != null) return primary + '/' + ucsc;else return primary || ucsc || 'unknown';\n};\n\nBrowser.prototype.makeLoader = function (size) {\n    size = size || 16;\n    var retina = window.devicePixelRatio > 1;\n    if (size < 20) {\n        return makeElement('img', null, { src: this.resolveURL('$$img/spinner_' + (retina ? 16 : 32) + '.gif'), width: '16', height: '16' });\n    } else {\n        return makeElement('img', null, { src: this.resolveURL('$$img/spinner_' + (retina ? 24 : 48) + '.gif'), width: '24', height: '24' });\n    }\n};\n\nBrowser.prototype.canFetchPlainHTTP = function () {\n    var self = this;\n    if (!this._plainHTTPPromise) {\n        var worker = this.getWorker();\n        if (worker) {\n            this._plainHTTPPromise = new Promise(function (resolve, reject) {\n                worker.postCommand({ command: 'textxhr',\n                    uri: self.httpCanaryURL }, function (result, err) {\n                    if (result) {\n                        resolve(true);\n                    } else {\n                        resolve(false);\n                    }\n                });\n            });\n        } else {\n            this._plainHTTPPromise = new Promise(function (resolve, reject) {\n                textXHR(self.httpCanaryURL, function (result, err) {\n                    if (result) {\n                        resolve(true);\n                    } else {\n                        resolve(false);\n                    }\n                }, { timeout: 2000 });\n            });\n        }\n    }\n    return this._plainHTTPPromise;\n};\n\nBrowser.prototype.getWorker = function () {\n    if (!this.useFetchWorkers || !this.fetchWorkers || this.fetchWorkers.length == 0) return null;\n\n    if (this.nextWorker >= this.fetchWorkers.length) this.nextWorker = 0;\n    return this.fetchWorkers[this.nextWorker++];\n};\n\nBrowser.prototype.registerResolver = function (resolver) {\n    var id = 'res' + ++this.resolverSeed;\n    this.resolvers[id] = resolver;\n    return id;\n};\n\nfunction FetchWorker(browser, worker) {\n    var thisB = this;\n    this.tagSeed = 0;\n    this.callbacks = {};\n    this.browser = browser;\n    this.worker = worker;\n\n    this.worker.onmessage = function (ev) {\n        var data = ev.data;\n\n        if (!data.cmd) {\n            var cb = thisB.callbacks[data.tag];\n            if (cb) {\n                cb(data.result, data.error);\n                delete thisB.callbacks[data.tag];\n            }\n        } else if (data.cmd == 'resolve') {\n            var resolver = thisB.browser.resolvers[data.resolver];\n            if (resolver) {\n                resolver(data.url).then(function (url) {\n                    thisB.worker.postMessage({\n                        tag: data.tag,\n                        url: url\n                    });\n                }).catch(function (err) {\n                    console.log(err);\n                    thisB.worker.postMessage({\n                        tag: data.tag,\n                        err: err.toString()\n                    });\n                });\n            } else {\n                console.log('No resolver ' + data.resolver);\n            }\n        } else {\n            console.log('Bad worker callback ' + data.cmd);\n        }\n    };\n}\n\nfunction makeFetchWorker(browser) {\n    var wurl = browser.resolveURL(browser.workerPath);\n    if (wurl.indexOf('//') == 0) {\n        var proto = window.location.protocol;\n        if (proto == 'https:') wurl = 'https:' + wurl;else wurl = 'http:' + wurl;\n    }\n\n    var wscript = 'importScripts(\"' + wurl + '?version=' + VERSION + '\");';\n    var wblob = new Blob([wscript], { type: 'application/javascript' });\n\n    return new Promise(function (resolve, reject) {\n        var worker = new Worker(URL.createObjectURL(wblob));\n\n        worker.onmessage = function (ev) {\n            if (ev.data.tag === 'init') {\n                console.log('Worker initialized');\n                resolve(new FetchWorker(browser, worker));\n            }\n        };\n\n        worker.onerror = function (ev) {\n            reject(ev.message);\n        };\n    });\n}\n\nFetchWorker.prototype.postCommand = function (cmd, callback, transfer) {\n    var tag = 'x' + ++this.tagSeed;\n    cmd.tag = tag;\n    this.callbacks[tag] = callback;\n    this.worker.postMessage(cmd, transfer);\n};\n\nFetchWorker.prototype.terminate = function () {\n    this.worker.terminate();\n};\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        Browser: Browser\n    };\n\n    // Required because they add stuff to Browser.prototype\n    require('./browser-ui');\n    require('./track-adder');\n    require('./feature-popup');\n    require('./tier-actions');\n    require('./domui');\n    require('./search');\n\n    var sa = require('./sourceadapters');\n    var TwoBitSequenceSource = sa.TwoBitSequenceSource;\n    var EnsemblSequenceSource = sa.EnsemblSequenceSource;\n    var DASSequenceSource = sa.DASSequenceSource;\n\n    var KnownSpace = require('./kspace').KnownSpace;\n\n    var DASRegistry = require('./das').DASRegistry;\n}\n\nfunction SourceCache() {\n    this.sourcesByURI = {};\n}\n\nSourceCache.prototype.get = function (conf) {\n    var scb = this.sourcesByURI[sourceDataURI(conf)];\n    if (scb) {\n        for (var si = 0; si < scb.configs.length; ++si) {\n            if (sourcesAreEqualModuloStyle(scb.configs[si], conf)) {\n                return scb.sources[si];\n            }\n        }\n    }\n};\n\nSourceCache.prototype.put = function (conf, source) {\n    var uri = sourceDataURI(conf);\n    var scb = this.sourcesByURI[uri];\n    if (!scb) {\n        scb = { configs: [], sources: [] };\n        this.sourcesByURI[uri] = scb;\n    }\n    scb.configs.push(conf);\n    scb.sources.push(source);\n};\n\n},{\"./browser-ui\":5,\"./chainset\":7,\"./das\":10,\"./default-renderer\":11,\"./domui\":12,\"./dummy-renderer\":13,\"./feature-popup\":21,\"./kspace\":25,\"./multi-renderer\":29,\"./numformats\":30,\"./search\":35,\"./sha1\":38,\"./sourceadapters\":39,\"./sourcecompare\":40,\"./sub-renderer\":43,\"./thub\":49,\"./tier\":52,\"./tier-actions\":50,\"./track-adder\":53,\"./utils\":56,\"./version\":58,\"es6-promise\":384}],7:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// chainset.js: liftover support\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var das = require('./das');\n    var DASSource = das.DASSource;\n    var DASSegment = das.DASSegment;\n\n    var utils = require('./utils');\n    var pusho = utils.pusho;\n    var shallowCopy = utils.shallowCopy;\n\n    var parseCigar = require('./cigar').parseCigar;\n\n    var bin = require('./bin');\n    var URLFetchable = bin.URLFetchable;\n\n    var bbi = require('./bigwig');\n    var makeBwg = bbi.makeBwg;\n\n    var Promise = require('es6-promise').Promise;\n}\n\nfunction Chainset(conf, srcTag, destTag, coords) {\n    if (typeof conf == 'string') {\n        this.uri = conf;\n        this.srcTag = srcTag;\n        this.destTag = destTag;\n        this.coords = coords;\n    } else {\n        this.uri = conf.uri;\n        this.srcTag = conf.srcTag;\n        this.destTag = conf.destTag;\n        this.coords = shallowCopy(conf.coords);\n        this.type = conf.type;\n        this.credentials = conf.credentials;\n    }\n\n    this.chainsBySrc = {};\n    this.chainsByDest = {};\n    this.postFetchQueues = {};\n    this.fetchedTiles = {};\n    this.granularity = 1000000; // size in bases of tile to fetch\n\n    if (this.type == 'bigbed') {\n        this.chainFetcher = new BBIChainFetcher(this.uri, this.credentials);\n    } else if (this.type == 'alias') {\n        this.chainFetcher = new AliasChainFetcher(conf);\n    } else {\n        this.chainFetcher = new DASChainFetcher(this.uri, this.srcTag, this.destTag);\n    }\n};\n\nChainset.prototype.exportConfig = function () {\n    return {\n        uri: this.uri,\n        srcTag: this.srcTag,\n        destTag: this.destTag,\n        coords: this.coords,\n        type: this.type,\n        credentials: this.credentials\n    };\n};\n\nChainset.prototype.mapPoint = function (chr, pos) {\n    var chains = this.chainsBySrc[chr] || [];\n    for (var ci = 0; ci < chains.length; ++ci) {\n        var c = chains[ci];\n        if (pos >= c.srcMin && pos <= c.srcMax) {\n            var cpos;\n            if (c.srcOri == '-') {\n                cpos = c.srcMax - pos;\n            } else {\n                cpos = pos - c.srcMin;\n            }\n            var blocks = c.blocks;\n            for (var bi = 0; bi < blocks.length; ++bi) {\n                var b = blocks[bi];\n                var bSrc = b[0];\n                var bDest = b[1];\n                var bSize = b[2];\n                if (cpos >= bSrc && cpos <= bSrc + bSize) {\n                    var apos = cpos - bSrc;\n\n                    var dpos;\n                    if (c.destOri == '-') {\n                        dpos = c.destMax - bDest - apos;\n                    } else {\n                        dpos = apos + bDest + c.destMin;\n                    }\n                    return { seq: c.destChr, pos: dpos, flipped: c.srcOri != c.destOri };\n                }\n            }\n        }\n    }\n    return null;\n};\n\nChainset.prototype.mapSegment = function (chr, min, max) {\n    var chains = this.chainsBySrc[chr] || [];\n    var mappings = [];\n    for (var ci = 0; ci < chains.length; ++ci) {\n        var c = chains[ci];\n        if (max >= c.srcMin && min <= c.srcMax) {\n            var cmin, cmax;\n            if (c.srcOri == '-') {\n                cmin = c.srcMax - max;\n                cmax = c.srcMax - min;\n            } else {\n                cmin = min - c.srcMin;\n                cmax = max - c.srcMin;\n            }\n            var blocks = c.blocks;\n            for (var bi = 0; bi < blocks.length; ++bi) {\n                var b = blocks[bi];\n                var bSrc = b[0];\n                var bDest = b[1];\n                var bSize = b[2];\n                if (cmax >= bSrc && cmin <= bSrc + bSize) {\n                    var m = {\n                        segment: c.destChr,\n                        flipped: c.srcOri == '-' ^ c.destOri == '-' };\n\n                    if (c.destOri == '-') {\n                        if (cmin >= bSrc) {\n                            m.max = c.destMax - bDest - cmin + bSrc;\n                        } else {\n                            m.max = c.destMax - bDest;\n                            m.partialMax = bSrc - cmin;\n                        }\n                        if (cmax <= bSrc + bSize) {\n                            m.min = c.destMax - bDest - cmax + bSrc;\n                        } else {\n                            m.min = c.destMax - bDest - bSize;\n                            m.partialMin = cmax - bSrc - bSize;\n                        }\n                    } else {\n                        if (cmin >= bSrc) {\n                            m.min = c.destMin + bDest + cmin - bSrc;\n                        } else {\n                            m.min = c.destMin + bDest;\n                            m.partialMin = bSrc - cmin;\n                        }\n                        if (cmax <= bSrc + bSize) {\n                            m.max = c.destMin + bDest + cmax - bSrc;\n                        } else {\n                            m.max = c.destMin + bDest + bSize;\n                            m.partialMax = cmax - bSrc - bSize;\n                        }\n                    }\n                    mappings.push(m);\n                }\n            }\n        }\n    }\n    return mappings;\n};\n\nChainset.prototype.unmapPoint = function (chr, pos) {\n    var chains = this.chainsByDest[chr] || [];\n    for (var ci = 0; ci < chains.length; ++ci) {\n        var c = chains[ci];\n        if (pos >= c.destMin && pos <= c.destMax) {\n            var cpos;\n            if (c.srcOri == '-') {\n                cpos = c.destMax - pos;\n            } else {\n                cpos = pos - c.destMin;\n            }\n\n            var blocks = c.blocks;\n            for (var bi = 0; bi < blocks.length; ++bi) {\n                var b = blocks[bi];\n                var bSrc = b[0];\n                var bDest = b[1];\n                var bSize = b[2];\n\n                if (cpos >= bDest && cpos <= bDest + bSize) {\n                    var apos = cpos - bDest;\n\n                    var dpos = apos + bSrc + c.srcMin;\n                    var dpos;\n                    if (c.destOri == '-') {\n                        dpos = c.srcMax - bSrc - apos;\n                    } else {\n                        dpos = apos + bSrc + c.srcMin;\n                    }\n                    return { seq: c.srcChr, pos: dpos, flipped: c.srcOri != c.destOri };\n                }\n            }\n            // return null;\n        }\n    }\n    return null;\n};\n\nChainset.prototype.sourceBlocksForRange = function (chr, min, max, callback) {\n    var STATE_PENDING = 1;\n    var STATE_FETCHED = 2;\n\n    var thisCS = this;\n    var minTile = min / this.granularity | 0;\n    var maxTile = max / this.granularity | 0;\n\n    var needsNewOrPending = false;\n    var needsNewFetch = false;\n    for (var t = minTile; t <= maxTile; ++t) {\n        var tn = chr + '_' + t;\n        if (this.fetchedTiles[tn] != STATE_FETCHED) {\n            needsNewOrPending = true;\n            if (this.fetchedTiles[tn] != STATE_PENDING) {\n                this.fetchedTiles[tn] = STATE_PENDING;\n                needsNewFetch = true;\n            }\n        }\n    }\n\n    if (needsNewOrPending) {\n        if (!this.postFetchQueues[chr]) {\n            this.chainFetcher.fetchChains(chr, minTile * this.granularity, (maxTile + 1) * this.granularity - 1).then(function (chains) {\n                if (!thisCS.chainsByDest) thisCS.chainsByDest[chr] = [];\n                for (var ci = 0; ci < chains.length; ++ci) {\n                    var chain = chains[ci];\n\n                    {\n                        var cbs = thisCS.chainsBySrc[chain.srcChr];\n                        if (!cbs) {\n                            thisCS.chainsBySrc[chain.srcChr] = [chain];\n                        } else {\n                            var present = false;\n                            for (var oci = 0; oci < cbs.length; ++oci) {\n                                var oc = cbs[oci];\n                                if (oc.srcMin == chain.srcMin && oc.srcMax == chain.srcMax) {\n                                    present = true;\n                                    break;\n                                }\n                            }\n                            if (!present) cbs.push(chain);\n                        }\n                    }\n\n                    {\n                        var cbd = thisCS.chainsByDest[chain.destChr];\n                        if (!cbd) {\n                            thisCS.chainsByDest[chain.destChr] = [chain];\n                        } else {\n                            var present = false;\n                            for (var oci = 0; oci < cbd.length; ++oci) {\n                                var oc = cbd[oci];\n                                if (oc.destMin == chain.destMin && oc.destMax == chain.destMax) {\n                                    present = true;\n                                    break;\n                                }\n                            }\n                            if (!present) cbd.push(chain);\n                        }\n                    }\n                }\n                for (var t = minTile; t <= maxTile; ++t) {\n                    var tn = chr + '_' + t;\n                    thisCS.fetchedTiles[tn] = STATE_FETCHED;\n                }\n                if (thisCS.postFetchQueues[chr]) {\n                    var pfq = thisCS.postFetchQueues[chr];\n                    for (var i = 0; i < pfq.length; ++i) {\n                        pfq[i]();\n                    }\n                    thisCS.postFetchQueues[chr] = null;\n                }\n            }).catch(function (err) {\n                console.log(err);\n            });\n        }\n\n        pusho(this.postFetchQueues, chr, function () {\n            // Will either succeed if the tiles that are needed have already been fetched,\n            // or queue up a new fetch.\n\n            thisCS.sourceBlocksForRange(chr, min, max, callback);\n        });\n    } else {\n        var srcBlocks = [];\n        var chains = this.chainsByDest[chr] || [];\n        for (var ci = 0; ci < chains.length; ++ci) {\n            var c = chains[ci];\n            if (min <= c.destMax && max >= c.destMin) {\n                var cmin, cmax;\n                if (c.srcOri == '-') {\n                    cmin = c.destMax - max;\n                    cmax = c.destMax - min;\n                } else {\n                    cmin = min - c.destMin;\n                    cmax = max - c.destMin;\n                }\n\n                var blocks = c.blocks;\n                for (var bi = 0; bi < blocks.length; ++bi) {\n                    var b = blocks[bi];\n                    var bSrc = b[0];\n                    var bDest = b[1];\n                    var bSize = b[2];\n\n                    if (cmax >= bDest && cmin <= bDest + bSize) {\n                        var amin = Math.max(cmin, bDest) - bDest;\n                        var amax = Math.min(cmax, bDest + bSize) - bDest;\n\n                        if (c.destOri == '-') {\n                            srcBlocks.push(new DASSegment(c.srcChr, c.srcMax - bSrc - amax, c.srcMax - bSrc - amin));\n                        } else {\n                            srcBlocks.push(new DASSegment(c.srcChr, c.srcMin + amin + bSrc, c.srcMin + amax + bSrc));\n                        }\n                    }\n                }\n            }\n        }\n        callback(srcBlocks);\n    }\n};\n\nfunction DASChainFetcher(uri, srcTag, destTag) {\n    this.source = new DASSource(uri);\n    this.srcTag = srcTag;\n    this.destTag = destTag;\n}\n\nDASChainFetcher.prototype.fetchChains = function (chr, _min, _max) {\n    var thisCS = this;\n\n    return new Promise(function (resolve, reject) {\n        thisCS.source.alignments(chr, {}, function (aligns) {\n            var chains = [];\n\n            for (var ai = 0; ai < aligns.length; ++ai) {\n                var aln = aligns[ai];\n                for (var bi = 0; bi < aln.blocks.length; ++bi) {\n                    var block = aln.blocks[bi];\n                    var srcSeg, destSeg;\n                    for (var si = 0; si < block.segments.length; ++si) {\n                        var seg = block.segments[si];\n                        var obj = aln.objects[seg.object];\n                        if (obj.dbSource === thisCS.srcTag) {\n                            srcSeg = seg;\n                        } else if (obj.dbSource === thisCS.destTag) {\n                            destSeg = seg;\n                        }\n                    }\n                    if (srcSeg && destSeg) {\n                        var chain = {\n                            srcChr: aln.objects[srcSeg.object].accession,\n                            srcMin: srcSeg.min | 0,\n                            srcMax: srcSeg.max | 0,\n                            srcOri: srcSeg.strand,\n                            destChr: aln.objects[destSeg.object].accession,\n                            destMin: destSeg.min | 0,\n                            destMax: destSeg.max | 0,\n                            destOri: destSeg.strand,\n                            blocks: []\n                        };\n\n                        var srcops = parseCigar(srcSeg.cigar),\n                            destops = parseCigar(destSeg.cigar);\n\n                        var srcOffset = 0,\n                            destOffset = 0;\n                        var srci = 0,\n                            desti = 0;\n                        while (srci < srcops.length && desti < destops.length) {\n                            if (srcops[srci].op == 'M' && destops[desti].op == 'M') {\n                                var blockLen = Math.min(srcops[srci].cnt, destops[desti].cnt);\n                                chain.blocks.push([srcOffset, destOffset, blockLen]);\n                                if (srcops[srci].cnt == blockLen) {\n                                    ++srci;\n                                } else {\n                                    srcops[srci].cnt -= blockLen;\n                                }\n                                if (destops[desti].cnt == blockLen) {\n                                    ++desti;\n                                } else {\n                                    destops[desti] -= blockLen;\n                                }\n                                srcOffset += blockLen;\n                                destOffset += blockLen;\n                            } else if (srcops[srci].op == 'I') {\n                                destOffset += srcops[srci++].cnt;\n                            } else if (destops[desti].op == 'I') {\n                                srcOffset += destops[desti++].cnt;\n                            }\n                        }\n\n                        chains.push(chain);\n                    }\n                }\n            }\n            resolve(chains);\n        });\n    });\n};\n\nfunction BBIChainFetcher(uri, credentials) {\n    var self = this;\n    this.uri = uri;\n    this.credentials = credentials;\n\n    this.bwg = new Promise(function (resolve, reject) {\n        makeBwg(new URLFetchable(self.uri, { credentials: self.credentials,\n            resolver: self.resolver }), function (bwg, err) {\n            if (bwg) {\n                resolve(bwg);\n            } else {\n                reject(err);\n            }\n        });\n    });\n\n    this.bwg.then(function (bwg, err) {\n        if (err) console.log(err);\n    });\n}\n\nfunction pi(x) {\n    return parseInt(x);\n}\n\nfunction cleanChr(c) {\n    if (c.indexOf('chr') == 0) return c.substr(3);else return c;\n}\n\nfunction bbiFeatureToChain(feature) {\n    var chain = {\n        srcChr: cleanChr(feature.srcChrom),\n        srcMin: parseInt(feature.srcStart),\n        srcMax: parseInt(feature.srcEnd),\n        srcOri: feature.srcOri,\n        destChr: cleanChr(feature.segment),\n        destMin: feature.min - 1, // Convert back from bigbed parser\n        destMax: feature.max,\n        destOri: feature.ori,\n        blocks: []\n    };\n    var srcStarts = feature.srcStarts.split(',').map(pi);\n    var destStarts = feature.destStarts.split(',').map(pi);\n    var blockLengths = feature.blockLens.split(',').map(pi);\n    for (var bi = 0; bi < srcStarts.length; ++bi) {\n        chain.blocks.push([srcStarts[bi], destStarts[bi], blockLengths[bi]]);\n    }\n\n    return chain;\n}\n\nBBIChainFetcher.prototype.fetchChains = function (chr, min, max) {\n    return this.bwg.then(function (bwg, err) {\n        if (!bwg) throw Error(\"No BWG\");\n\n        return new Promise(function (resolve, reject) {\n            bwg.getUnzoomedView().readWigData(chr, min, max, function (feats) {\n                resolve(feats.map(bbiFeatureToChain));\n            });\n        });\n    });\n};\n\nfunction AliasChainFetcher(conf) {\n    this.conf = conf;\n    this.forwardAliases = {};\n    var sa = conf.sequenceAliases || [];\n    for (var ai = 0; ai < sa.length; ++ai) {\n        var al = sa[ai];\n        if (al.length < 2) continue;\n\n        var fa = [];\n        for (var i = 0; i < al.length - 1; ++i) {\n            fa.push(al[i]);\n        }this.forwardAliases[al[al.length - 1]] = fa;\n    }\n}\n\nAliasChainFetcher.prototype.fetchChains = function (chr, min, max) {\n    var resp = [];\n    var fa = this.forwardAliases[chr] || [];\n    for (var i = 0; i < fa.length; ++i) {\n        resp.push({\n            srcChr: fa[i],\n            srcMin: 1,\n            srcMax: 1000000000,\n            srcOri: '+',\n            destChr: chr,\n            destMin: 1,\n            destMax: 1000000000,\n            destOri: '+',\n            blocks: [[1, 1, 1000000000]]\n        });\n    }\n\n    return Promise.resolve(resp);\n};\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        Chainset: Chainset\n    };\n}\n\n},{\"./bigwig\":3,\"./bin\":4,\"./cigar\":8,\"./das\":10,\"./utils\":56,\"es6-promise\":384}],8:[function(require,module,exports){\n'use strict';\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// chainset.js: liftover support\n//\n\nvar CIGAR_REGEXP = new RegExp('([0-9]*)([MIDS])', 'g');\n\nfunction parseCigar(cigar) {\n    var cigops = [];\n    var match;\n    while ((match = CIGAR_REGEXP.exec(cigar)) != null) {\n        var count = match[1];\n        if (count.length == 0) {\n            count = 1;\n        }\n        cigops.push({ cnt: count | 0, op: match[2] });\n    }\n    return cigops;\n}\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        parseCigar: parseCigar\n    };\n}\n\n},{}],9:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// color.js\n//\n\n\"use strict\";\n\nfunction DColour(red, green, blue, name) {\n    this.red = red | 0;\n    this.green = green | 0;\n    this.blue = blue | 0;\n    if (name) {\n        this.name = name;\n    }\n}\n\nDColour.prototype.toSvgString = function () {\n    if (!this.name) {\n        this.name = \"rgb(\" + this.red + \",\" + this.green + \",\" + this.blue + \")\";\n    }\n\n    return this.name;\n};\n\nfunction hex2(x) {\n    var y = '00' + x.toString(16);\n    return y.substring(y.length - 2);\n}\n\nDColour.prototype.toHexString = function () {\n    return '#' + hex2(this.red) + hex2(this.green) + hex2(this.blue);\n};\n\nvar palette = {\n    red: new DColour(255, 0, 0, 'red'),\n    green: new DColour(0, 255, 0, 'green'),\n    blue: new DColour(0, 0, 255, 'blue'),\n    yellow: new DColour(255, 255, 0, 'yellow'),\n    white: new DColour(255, 255, 255, 'white'),\n    black: new DColour(0, 0, 0, 'black'),\n    gray: new DColour(180, 180, 180, 'gray'),\n    grey: new DColour(180, 180, 180, 'grey'),\n    lightskyblue: new DColour(135, 206, 250, 'lightskyblue'),\n    lightsalmon: new DColour(255, 160, 122, 'lightsalmon'),\n    hotpink: new DColour(255, 105, 180, 'hotpink')\n};\n\nvar COLOR_RE = new RegExp('^#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$');\nvar CSS_COLOR_RE = /rgb\\(([0-9]+),([0-9]+),([0-9]+)\\)/;\n\nfunction dasColourForName(name) {\n    var c = palette[name];\n    if (!c) {\n        var match = COLOR_RE.exec(name);\n        if (match) {\n            c = new DColour('0x' + match[1] | 0, '0x' + match[2] | 0, '0x' + match[3] | 0, name);\n            palette[name] = c;\n        } else {\n            match = CSS_COLOR_RE.exec(name);\n            if (match) {\n                c = new DColour(match[1] | 0, match[2] | 0, match[3] | 0, name);\n                palette[name] = c;\n            } else {\n                console.log(\"couldn't handle color: \" + name);\n                c = palette.black;\n                palette[name] = c;\n            }\n        }\n    }\n    return c;\n}\n\nfunction makeColourSteps(steps, stops, colours) {\n    var dcolours = [];\n    for (var ci = 0; ci < colours.length; ++ci) {\n        dcolours.push(dasColourForName(colours[ci]));\n    }\n\n    var grad = [];\n    STEP_LOOP: for (var si = 0; si < steps; ++si) {\n        var rs = 1.0 * si / (steps - 1);\n        var score = stops[0] + (stops[stops.length - 1] - stops[0]) * rs;\n        for (var i = 0; i < stops.length - 1; ++i) {\n            if (score >= stops[i] && score <= stops[i + 1]) {\n                var frac = (score - stops[i]) / (stops[i + 1] - stops[i]);\n                var ca = dcolours[i];\n                var cb = dcolours[i + 1];\n\n                var fill = new DColour(ca.red * (1.0 - frac) + cb.red * frac | 0, ca.green * (1.0 - frac) + cb.green * frac | 0, ca.blue * (1.0 - frac) + cb.blue * frac | 0).toSvgString();\n                grad.push(fill);\n\n                continue STEP_LOOP;\n            }\n        }\n        throw 'Bad step';\n    }\n\n    return grad;\n}\n\nfunction makeGradient(steps, color1, color2, color3) {\n    if (color3) {\n        return makeColourSteps(steps, [0, 0.5, 1], [color1, color2, color3]);\n    } else {\n        return makeColourSteps(steps, [0, 1], [color1, color2]);\n    }\n}\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        makeColourSteps: makeColourSteps,\n        makeGradient: makeGradient,\n        dasColourForName: dasColourForName\n    };\n}\n\n},{}],10:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// das.js: queries and low-level data model.\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var utils = require('./utils');\n    var shallowCopy = utils.shallowCopy;\n    var pusho = utils.pusho;\n\n    var color = require('./color');\n    var makeColourSteps = color.makeColourSteps;\n}\n\nvar dasLibErrorHandler = function dasLibErrorHandler(errMsg) {\n    alert(errMsg);\n};\nvar dasLibRequestQueue = new Array();\n\nfunction DASSegment(name, start, end, description) {\n    this.name = name;\n    this.start = start;\n    this.end = end;\n    this.description = description;\n}\nDASSegment.prototype.toString = function () {\n    return this.name + ':' + this.start + '..' + this.end;\n};\nDASSegment.prototype.isBounded = function () {\n    return this.start && this.end;\n};\nDASSegment.prototype.toDASQuery = function () {\n    var q = 'segment=' + this.name;\n    if (this.start && this.end) {\n        q += ':' + this.start + ',' + this.end;\n    }\n    return q;\n};\n\nfunction DASSource(a1, a2) {\n    var options;\n    if (typeof a1 == 'string') {\n        this.uri = a1;\n        options = a2 || {};\n    } else {\n        options = a1 || {};\n    }\n    for (var k in options) {\n        this[k] = options[k];\n    }\n\n    if (!this.coords) {\n        this.coords = [];\n    }\n    if (!this.props) {\n        this.props = {};\n    }\n\n    this.dasBaseURI = this.uri;\n    if (this.dasBaseURI && this.dasBaseURI.substr(this.uri.length - 1) != '/') {\n        this.dasBaseURI = this.dasBaseURI + '/';\n    }\n}\n\nDASSource.prototype.getURI = function (uri) {\n    if (this.resolver) {\n        return this.resolver(uri).then(function (urlOrObj) {\n            if (typeof urlOrObj === 'string') {\n                return urlOrObj;\n            } else {\n                return urlOrObj.url;\n            }\n        });\n    } else {\n        return Promise.resolve(uri);\n    }\n};\n\nfunction DASCoords() {}\n\nfunction coordsMatch(c1, c2) {\n    return c1.taxon == c2.taxon && c1.auth == c2.auth && c1.version == c2.version;\n}\n\n//\n// DAS 1.6 entry_points command\n//\n\nDASSource.prototype.entryPoints = function (callback) {\n    var dasURI = this.dasBaseURI + 'entry_points';\n    this.doCrossDomainRequest(dasURI, function (responseXML) {\n        if (!responseXML) {\n            return callback([]);\n        }\n\n        var entryPoints = new Array();\n\n        var segs = responseXML.getElementsByTagName('SEGMENT');\n        for (var i = 0; i < segs.length; ++i) {\n            var seg = segs[i];\n            var segId = seg.getAttribute('id');\n\n            var segSize = seg.getAttribute('size');\n            var segMin, segMax;\n            if (segSize) {\n                segMin = 1;segMax = segSize | 0;\n            } else {\n                segMin = seg.getAttribute('start');\n                if (segMin) {\n                    segMin |= 0;\n                }\n                segMax = seg.getAttribute('stop');\n                if (segMax) {\n                    segMax |= 0;\n                }\n            }\n            var segDesc = null;\n            if (seg.firstChild) {\n                segDesc = seg.firstChild.nodeValue;\n            }\n            entryPoints.push(new DASSegment(segId, segMin, segMax, segDesc));\n        }\n        callback(entryPoints);\n    });\n};\n\n//\n// DAS 1.6 sequence command\n// Do we need an option to fall back to the dna command?\n//\n\nfunction DASSequence(name, start, end, alpha, seq) {\n    this.name = name;\n    this.start = start;\n    this.end = end;\n    this.alphabet = alpha;\n    this.seq = seq;\n}\n\nDASSource.prototype.sequence = function (segment, callback) {\n    var dasURI = this.dasBaseURI + 'sequence?' + segment.toDASQuery();\n    this.doCrossDomainRequest(dasURI, function (responseXML) {\n        if (!responseXML) {\n            callback([]);\n            return;\n        } else {\n            var seqs = new Array();\n\n            var segs = responseXML.getElementsByTagName('SEQUENCE');\n            for (var i = 0; i < segs.length; ++i) {\n                var seg = segs[i];\n                var segId = seg.getAttribute('id');\n                var segMin = seg.getAttribute('start');\n                var segMax = seg.getAttribute('stop');\n                var segAlpha = 'DNA';\n                var segSeq = null;\n                if (seg.firstChild) {\n                    var rawSeq = seg.firstChild.nodeValue;\n                    segSeq = '';\n                    var idx = 0;\n                    while (true) {\n                        var space = rawSeq.indexOf('\\n', idx);\n                        if (space >= 0) {\n                            segSeq += rawSeq.substring(idx, space).toUpperCase();\n                            idx = space + 1;\n                        } else {\n                            segSeq += rawSeq.substring(idx).toUpperCase();\n                            break;\n                        }\n                    }\n                }\n                seqs.push(new DASSequence(segId, segMin, segMax, segAlpha, segSeq));\n            }\n\n            callback(seqs);\n        }\n    });\n};\n\n//\n// DAS 1.6 features command\n//\n\nfunction DASFeature() {}\n\nfunction DASGroup(id) {\n    if (id) this.id = id;\n}\n\nfunction DASLink(desc, uri) {\n    this.desc = desc;\n    this.uri = uri;\n}\n\nDASSource.prototype.features = function (segment, options, callback) {\n    options = options || {};\n    var thisB = this;\n\n    var dasURI;\n    if (this.features_uri) {\n        dasURI = this.features_uri;\n    } else {\n        var filters = [];\n\n        if (segment) {\n            filters.push(segment.toDASQuery());\n        } else if (options.group) {\n            var g = options.group;\n            if (typeof g == 'string') {\n                filters.push('group_id=' + g);\n            } else {\n                for (var gi = 0; gi < g.length; ++gi) {\n                    filters.push('group_id=' + g[gi]);\n                }\n            }\n        }\n\n        if (options.adjacent) {\n            var adj = options.adjacent;\n            if (typeof adj == 'string') {\n                adj = [adj];\n            }\n            for (var ai = 0; ai < adj.length; ++ai) {\n                filters.push('adjacent=' + adj[ai]);\n            }\n        }\n\n        if (options.type) {\n            if (typeof options.type == 'string') {\n                filters.push('type=' + options.type);\n            } else {\n                for (var ti = 0; ti < options.type.length; ++ti) {\n                    filters.push('type=' + options.type[ti]);\n                }\n            }\n        }\n\n        if (options.maxbins) {\n            filters.push('maxbins=' + options.maxbins);\n        }\n\n        if (filters.length > 0) {\n            dasURI = this.dasBaseURI + 'features?' + filters.join(';');\n        } else {\n            callback([], 'No filters specified');\n        }\n    }\n\n    this.doCrossDomainRequest(dasURI, function (responseXML, req) {\n        if (!responseXML) {\n            var msg;\n            if (req.status == 0) {\n                msg = 'server may not support CORS';\n            } else {\n                msg = 'status=' + req.status;\n            }\n            callback([], 'Failed request: ' + msg);\n            return;\n        }\n        /*      if (req) {\n                    var caps = req.getResponseHeader('X-DAS-Capabilties');\n                    if (caps) {\n                        alert(caps);\n                    }\n                } */\n\n        var features = new Array();\n        var segmentMap = {};\n\n        var segs = responseXML.getElementsByTagName('SEGMENT');\n        for (var si = 0; si < segs.length; ++si) {\n            var segmentXML = segs[si];\n            var segmentID = segmentXML.getAttribute('id');\n            segmentMap[segmentID] = {\n                min: segmentXML.getAttribute('start'),\n                max: segmentXML.getAttribute('stop')\n            };\n\n            var featureXMLs = segmentXML.getElementsByTagName('FEATURE');\n            for (var i = 0; i < featureXMLs.length; ++i) {\n                var feature = featureXMLs[i];\n                var dasFeature = new DASFeature();\n\n                dasFeature.segment = segmentID;\n                dasFeature.id = feature.getAttribute('id');\n                dasFeature.label = feature.getAttribute('label');\n\n                /*\n                                var childNodes = feature.childNodes;\n                                for (var c = 0; c < childNodes.length; ++c) {\n                                    var cn = childNodes[c];\n                                    if (cn.nodeType == Node.ELEMENT_NODE) {\n                                        var key = cn.tagName;\n                                        //var val = null;\n                                        //if (cn.firstChild) {\n                                        //   val = cn.firstChild.nodeValue;\n                                        //}\n                                        dasFeature[key] = 'x';\n                                    }\n                                } */\n\n                var spos = elementValue(feature, \"START\");\n                var epos = elementValue(feature, \"END\");\n                if ((spos | 0) > (epos | 0)) {\n                    dasFeature.min = epos | 0;\n                    dasFeature.max = spos | 0;\n                } else {\n                    dasFeature.min = spos | 0;\n                    dasFeature.max = epos | 0;\n                }\n                {\n                    var tec = feature.getElementsByTagName('TYPE');\n                    if (tec.length > 0) {\n                        var te = tec[0];\n                        if (te.firstChild) {\n                            dasFeature.type = te.firstChild.nodeValue;\n                        }\n                        dasFeature.typeId = te.getAttribute('id');\n                        dasFeature.typeCv = te.getAttribute('cvId');\n                    }\n                }\n                dasFeature.type = elementValue(feature, \"TYPE\");\n                if (!dasFeature.type && dasFeature.typeId) {\n                    dasFeature.type = dasFeature.typeId; // FIXME?\n                }\n\n                dasFeature.method = elementValue(feature, \"METHOD\");\n                {\n                    var ori = elementValue(feature, \"ORIENTATION\");\n                    if (!ori) {\n                        ori = '0';\n                    }\n                    dasFeature.orientation = ori;\n                }\n                dasFeature.score = elementValue(feature, \"SCORE\");\n                dasFeature.links = dasLinksOf(feature);\n                dasFeature.notes = dasNotesOf(feature);\n\n                var groups = feature.getElementsByTagName(\"GROUP\");\n                for (var gi = 0; gi < groups.length; ++gi) {\n                    var groupXML = groups[gi];\n                    var dasGroup = new DASGroup();\n                    dasGroup.type = groupXML.getAttribute('type');\n                    dasGroup.id = groupXML.getAttribute('id');\n                    dasGroup.links = dasLinksOf(groupXML);\n                    dasGroup.notes = dasNotesOf(groupXML);\n                    if (!dasFeature.groups) {\n                        dasFeature.groups = new Array(dasGroup);\n                    } else {\n                        dasFeature.groups.push(dasGroup);\n                    }\n                }\n\n                // Magic notes.  Check with TAD before changing this.\n                if (dasFeature.notes) {\n                    for (var ni = 0; ni < dasFeature.notes.length; ++ni) {\n                        var n = dasFeature.notes[ni];\n                        if (n.indexOf('Genename=') == 0) {\n                            var gg = new DASGroup();\n                            gg.type = 'gene';\n                            gg.id = n.substring(9);\n                            if (!dasFeature.groups) {\n                                dasFeature.groups = new Array(gg);\n                            } else {\n                                dasFeature.groups.push(gg);\n                            }\n                        }\n                    }\n                }\n\n                {\n                    var pec = feature.getElementsByTagName('PART');\n                    if (pec.length > 0) {\n                        var parts = [];\n                        for (var pi = 0; pi < pec.length; ++pi) {\n                            parts.push(pec[pi].getAttribute('id'));\n                        }\n                        dasFeature.parts = parts;\n                    }\n                }\n                {\n                    var pec = feature.getElementsByTagName('PARENT');\n                    if (pec.length > 0) {\n                        var parents = [];\n                        for (var pi = 0; pi < pec.length; ++pi) {\n                            parents.push(pec[pi].getAttribute('id'));\n                        }\n                        dasFeature.parents = parents;\n                    }\n                }\n\n                features.push(dasFeature);\n            }\n        }\n\n        callback(features, undefined, segmentMap);\n    }, function (err) {\n        callback([], err);\n    });\n};\n\nfunction DASAlignment(type) {\n    this.type = type;\n    this.objects = {};\n    this.blocks = [];\n}\n\nDASSource.prototype.alignments = function (segment, options, callback) {\n    var dasURI = this.dasBaseURI + 'alignment?query=' + segment;\n    this.doCrossDomainRequest(dasURI, function (responseXML) {\n        if (!responseXML) {\n            callback([], 'Failed request ' + dasURI);\n            return;\n        }\n\n        var alignments = [];\n        var aliXMLs = responseXML.getElementsByTagName('alignment');\n        for (var ai = 0; ai < aliXMLs.length; ++ai) {\n            var aliXML = aliXMLs[ai];\n            var ali = new DASAlignment(aliXML.getAttribute('alignType'));\n            var objXMLs = aliXML.getElementsByTagName('alignObject');\n            for (var oi = 0; oi < objXMLs.length; ++oi) {\n                var objXML = objXMLs[oi];\n                var obj = {\n                    id: objXML.getAttribute('intObjectId'),\n                    accession: objXML.getAttribute('dbAccessionId'),\n                    version: objXML.getAttribute('objectVersion'),\n                    dbSource: objXML.getAttribute('dbSource'),\n                    dbVersion: objXML.getAttribute('dbVersion')\n                };\n                ali.objects[obj.id] = obj;\n            }\n\n            var blockXMLs = aliXML.getElementsByTagName('block');\n            for (var bi = 0; bi < blockXMLs.length; ++bi) {\n                var blockXML = blockXMLs[bi];\n                var block = {\n                    order: blockXML.getAttribute('blockOrder'),\n                    segments: []\n                };\n                var segXMLs = blockXML.getElementsByTagName('segment');\n                for (var si = 0; si < segXMLs.length; ++si) {\n                    var segXML = segXMLs[si];\n                    var seg = {\n                        object: segXML.getAttribute('intObjectId'),\n                        min: segXML.getAttribute('start'),\n                        max: segXML.getAttribute('end'),\n                        strand: segXML.getAttribute('strand'),\n                        cigar: elementValue(segXML, 'cigar')\n                    };\n                    block.segments.push(seg);\n                }\n                ali.blocks.push(block);\n            }\n\n            alignments.push(ali);\n        }\n        callback(alignments);\n    });\n};\n\nfunction DASStylesheet() {\n    this.styles = [];\n}\n\nDASStylesheet.prototype.pushStyle = function (filters, zoom, style) {\n    if (!filters) {\n        filters = { type: 'default' };\n    }\n    var styleHolder = shallowCopy(filters);\n    if (zoom) {\n        styleHolder.zoom = zoom;\n    }\n    styleHolder.style = style;\n    this.styles.push(styleHolder);\n};\n\nfunction DASStyle() {}\n\nfunction parseGradient(grad) {\n    var steps = grad.getAttribute('steps');\n    if (steps) {\n        steps = steps | 0;\n    } else {\n        steps = 50;\n    }\n\n    var stops = [];\n    var colors = [];\n    var se = grad.getElementsByTagName('STOP');\n    for (var si = 0; si < se.length; ++si) {\n        var stop = se[si];\n        stops.push(1.0 * stop.getAttribute('score'));\n        colors.push(stop.firstChild.nodeValue);\n    }\n\n    return makeColourSteps(steps, stops, colors);\n}\n\nDASSource.prototype.stylesheet = function (successCB, failureCB) {\n    var dasURI,\n        creds = this.credentials;\n    if (this.stylesheet_uri) {\n        dasURI = this.stylesheet_uri;\n        creds = false;\n    } else {\n        dasURI = this.dasBaseURI + 'stylesheet';\n    }\n\n    this.getURI(dasURI).then(function (dasURI) {\n        doCrossDomainRequest(dasURI, function (responseXML) {\n            if (!responseXML) {\n                if (failureCB) {\n                    failureCB();\n                }\n                return;\n            }\n            var stylesheet = new DASStylesheet();\n            var typeXMLs = responseXML.getElementsByTagName('TYPE');\n            for (var i = 0; i < typeXMLs.length; ++i) {\n                var typeStyle = typeXMLs[i];\n\n                var filter = {};\n                filter.type = typeStyle.getAttribute('id'); // Am I right in thinking that this makes DASSTYLE XML invalid?  Ugh.\n                filter.label = typeStyle.getAttribute('label');\n                filter.method = typeStyle.getAttribute('method');\n                var glyphXMLs = typeStyle.getElementsByTagName('GLYPH');\n                for (var gi = 0; gi < glyphXMLs.length; ++gi) {\n                    var glyphXML = glyphXMLs[gi];\n                    var zoom = glyphXML.getAttribute('zoom');\n                    var glyph = childElementOf(glyphXML);\n                    var style = new DASStyle();\n                    style.glyph = glyph.localName;\n                    var child = glyph.firstChild;\n\n                    while (child) {\n                        if (child.nodeType == Node.ELEMENT_NODE) {\n                            if (child.localName == 'BGGRAD') {\n                                style[child.localName] = parseGradient(child);\n                            } else {\n                                style[child.localName] = child.firstChild.nodeValue;\n                            }\n                        }\n                        child = child.nextSibling;\n                    }\n                    stylesheet.pushStyle(filter, zoom, style);\n                }\n            }\n            successCB(stylesheet);\n        }, creds);\n    }).catch(function (err) {\n        console.log(err);\n        failureCB();\n    });\n};\n\n//\n// sources command\n// \n\nfunction DASRegistry(uri, opts) {\n    opts = opts || {};\n    this.uri = uri;\n    this.opts = opts;\n}\n\nDASRegistry.prototype.sources = function (callback, failure, opts) {\n    if (!opts) {\n        opts = {};\n    }\n\n    var filters = [];\n    if (opts.taxon) {\n        filters.push('organism=' + opts.taxon);\n    }\n    if (opts.auth) {\n        filters.push('authority=' + opts.auth);\n    }\n    if (opts.version) {\n        filters.push('version=' + opts.version);\n    }\n    var quri = this.uri;\n    if (filters.length > 0) {\n        quri = quri + '?' + filters.join('&'); // '&' as a separator to hack around dasregistry.org bug.\n    }\n\n    doCrossDomainRequest(quri, function (responseXML) {\n        if (!responseXML && failure) {\n            failure();\n            return;\n        }\n\n        var sources = [];\n        var sourceXMLs = responseXML.getElementsByTagName('SOURCE');\n        for (var si = 0; si < sourceXMLs.length; ++si) {\n            var sourceXML = sourceXMLs[si];\n            var versionXMLs = sourceXML.getElementsByTagName('VERSION');\n            if (versionXMLs.length < 1) {\n                continue;\n            }\n            var versionXML = versionXMLs[0];\n\n            var coordXMLs = versionXML.getElementsByTagName('COORDINATES');\n            var coords = [];\n            for (var ci = 0; ci < coordXMLs.length; ++ci) {\n                var coordXML = coordXMLs[ci];\n                var coord = new DASCoords();\n                coord.auth = coordXML.getAttribute('authority');\n                coord.taxon = coordXML.getAttribute('taxid');\n                coord.version = coordXML.getAttribute('version');\n                coords.push(coord);\n            }\n\n            var caps = [];\n            var capXMLs = versionXML.getElementsByTagName('CAPABILITY');\n            var uri;\n            for (var ci = 0; ci < capXMLs.length; ++ci) {\n                var capXML = capXMLs[ci];\n\n                caps.push(capXML.getAttribute('type'));\n\n                if (capXML.getAttribute('type') == 'das1:features') {\n                    var fep = capXML.getAttribute('query_uri');\n                    uri = fep.substring(0, fep.length - 'features'.length);\n                }\n            }\n\n            var props = {};\n            var propXMLs = versionXML.getElementsByTagName('PROP');\n            for (var pi = 0; pi < propXMLs.length; ++pi) {\n                pusho(props, propXMLs[pi].getAttribute('name'), propXMLs[pi].getAttribute('value'));\n            }\n\n            if (uri) {\n                var source = new DASSource(uri, {\n                    source_uri: sourceXML.getAttribute('uri'),\n                    name: sourceXML.getAttribute('title'),\n                    desc: sourceXML.getAttribute('description'),\n                    coords: coords,\n                    props: props,\n                    capabilities: caps\n                });\n                sources.push(source);\n            }\n        }\n\n        callback(sources);\n    });\n};\n\n//\n// Utility functions\n//\n\nfunction elementValue(element, tag) {\n    var children = element.getElementsByTagName(tag);\n    if (children.length > 0 && children[0].firstChild) {\n        var c = children[0];\n        if (c.childNodes.length == 1) {\n            return c.firstChild.nodeValue;\n        } else {\n            var s = '';\n            for (var ni = 0; ni < c.childNodes.length; ++ni) {\n                s += c.childNodes[ni].nodeValue;\n            }\n            return s;\n        }\n    } else {\n        return null;\n    }\n}\n\nfunction childElementOf(element) {\n    if (element.hasChildNodes()) {\n        var child = element.firstChild;\n        do {\n            if (child.nodeType == Node.ELEMENT_NODE) {\n                return child;\n            }\n            child = child.nextSibling;\n        } while (child != null);\n    }\n    return null;\n}\n\nfunction dasLinksOf(element) {\n    var links = new Array();\n    var maybeLinkChilden = element.getElementsByTagName('LINK');\n    for (var ci = 0; ci < maybeLinkChilden.length; ++ci) {\n        var linkXML = maybeLinkChilden[ci];\n        if (linkXML.parentNode == element) {\n            links.push(new DASLink(linkXML.firstChild ? linkXML.firstChild.nodeValue : 'Unknown', linkXML.getAttribute('href')));\n        }\n    }\n\n    return links;\n}\n\nfunction dasNotesOf(element) {\n    var notes = [];\n    var maybeNotes = element.getElementsByTagName('NOTE');\n    for (var ni = 0; ni < maybeNotes.length; ++ni) {\n        if (maybeNotes[ni].firstChild) {\n            notes.push(maybeNotes[ni].firstChild.nodeValue);\n        }\n    }\n    return notes;\n}\n\nfunction doCrossDomainRequest(url, handler, credentials, custAuth) {\n    // TODO: explicit error handlers?\n\n    if (window.XDomainRequest) {\n        var req = new XDomainRequest();\n        req.onload = function () {\n            var dom = new ActiveXObject(\"Microsoft.XMLDOM\");\n            dom.async = false;\n            dom.loadXML(req.responseText);\n            handler(dom);\n        };\n        req.open(\"get\", url);\n        req.send();\n    } else {\n        try {\n            var req = new XMLHttpRequest();\n            var timeout = setTimeout(function () {\n                console.log('timing out ' + url);\n                req.abort();\n                handler(null, req);\n            }, 5000);\n\n            req.ontimeout = function () {\n                console.log('timeout on ' + url);\n            };\n\n            req.onreadystatechange = function () {\n                if (req.readyState == 4) {\n                    clearTimeout(timeout);\n                    if (req.status >= 200 || req.status == 0) {\n                        handler(req.responseXML, req);\n                    }\n                }\n            };\n            req.open(\"get\", url, true);\n            // IE10/11 fix: The timeout property may be set only in the time interval between a call to the open method\n            //              and the first call to the send method.\n            req.timeout = 5000;\n            if (credentials) {\n                req.withCredentials = true;\n            }\n            if (custAuth) {\n                req.setRequestHeader('X-DAS-Authorisation', custAuth);\n            }\n            req.overrideMimeType('text/xml');\n            req.setRequestHeader('Accept', 'application/xml,*/*');\n            req.send();\n        } catch (e) {\n            handler(null, req, e);\n        }\n    }\n}\n\nDASSource.prototype.doCrossDomainRequest = function (url, handler, errHandler) {\n    var custAuth;\n    if (this.xUser) {\n        custAuth = 'Basic ' + btoa(this.xUser + ':' + this.xPass);\n    }\n\n    try {\n        return doCrossDomainRequest(url, handler, this.credentials, custAuth);\n    } catch (err) {\n        if (errHandler) {\n            errHandler(err);\n        } else {\n            throw err;\n        }\n    }\n};\n\nfunction isDasBooleanTrue(s) {\n    s = ('' + s).toLowerCase();\n    return s === 'yes' || s === 'true';\n}\n\nfunction isDasBooleanNotFalse(s) {\n    if (!s) return false;\n\n    s = ('' + s).toLowerCase();\n    return s !== 'no' || s !== 'false';\n}\n\nfunction copyStylesheet(ss) {\n    var nss = shallowCopy(ss);\n    nss.styles = [];\n    for (var si = 0; si < ss.styles.length; ++si) {\n        var sh = nss.styles[si] = shallowCopy(ss.styles[si]);\n        sh._methodRE = sh._labelRE = sh._typeRE = undefined;\n        sh.style = shallowCopy(sh.style);\n        sh.style.id = undefined;\n        sh.style._gradient = undefined;\n    }\n    return nss;\n}\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        DASGroup: DASGroup,\n        DASFeature: DASFeature,\n        DASStylesheet: DASStylesheet,\n        DASStyle: DASStyle,\n        DASSource: DASSource,\n        DASSegment: DASSegment,\n        DASRegistry: DASRegistry,\n        DASSequence: DASSequence,\n        DASLink: DASLink,\n\n        isDasBooleanTrue: isDasBooleanTrue,\n        isDasBooleanNotFalse: isDasBooleanNotFalse,\n        copyStylesheet: copyStylesheet,\n        coordsMatch: coordsMatch\n    };\n}\n\n},{\"./color\":9,\"./utils\":56}],11:[function(require,module,exports){\n/* jshint esversion: 6 */\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.paintQuant = exports.createQuantOverlay = exports.clearViewport = exports.drawUnmapped = exports.paint = exports.prepareViewport = exports.prepareSubtiers = exports.drawTier = exports.renderTier = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _featureDraw = require(\"./feature-draw.js\");\n\nvar _sequenceDraw = require(\"./sequence-draw.js\");\n\nvar _spans = require(\"./spans.js\");\n\nvar _utils = require(\"./utils.js\");\n\nvar _glyphs = require(\"./glyphs.js\");\n\nvar Glyphs = _interopRequireWildcard(_glyphs);\n\nvar _das = require(\"./das.js\");\n\nvar _color = require(\"./color.js\");\n\nvar _cigar = require(\"./cigar.js\");\n\nvar _numformats = require(\"./numformats\");\n\nvar _ramda = require(\"ramda\");\n\nvar R = _interopRequireWildcard(_ramda);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// The only functions that must be exported by a renderer are renderTier\n// and drawTier, the rest are exported for use in other renderers.\nexports.renderTier = renderTier;\nexports.drawTier = drawTier;\nexports.prepareSubtiers = prepareSubtiers;\nexports.prepareViewport = prepareViewport;\nexports.paint = paint;\nexports.drawUnmapped = drawUnmapped;\nexports.clearViewport = clearViewport;\nexports.createQuantOverlay = createQuantOverlay;\nexports.paintQuant = paintQuant;\n\n\nfunction renderTier(status, tier) {\n    drawTier(tier);\n    tier.updateStatus(status);\n}\n\nfunction drawTier(tier) {\n    var canvas = tier.viewport.getContext(\"2d\");\n    var retina = tier.browser.retina && window.devicePixelRatio > 1;\n\n    if (tier.sequenceSource) {\n        var sequence = tier.currentSequence;\n        (0, _sequenceDraw.drawSeqTier)(tier, sequence);\n    } else if (tier.currentFeatures) {\n        prepareSubtiers(tier, canvas);\n    } else {\n        console.log(\"No sequence or features in tier!\");\n    }\n\n    if (tier.subtiers) {\n        var vOffset = R.defaultTo(0, tier.dasSource.vOffset);\n\n        prepareViewport(tier, canvas, retina, true, vOffset); // NB calls canvas.save\n        paint(tier, canvas, vOffset);\n        canvas.restore();\n    }\n\n    tier.drawOverlay();\n    tier.paintQuant();\n\n    if (typeof tier.dasSource.drawCallback === \"function\") {\n        tier.dasSource.drawCallback(canvas, tier);\n    }\n\n    tier.originHaxx = 0;\n    tier.browser.arrangeTiers();\n}\n\nfunction glyphsForGroup(canvas, features, y, groupElement, tier) {\n    var gstyle = tier.styleForFeature(groupElement);\n    var label = void 0;\n    var labelWanted = false;\n\n    var glyphs = [];\n    var strand = null;\n\n    features.forEach(function (f) {\n        if (f.orientation && strand === null) {\n            strand = f.orientation;\n        }\n\n        if (!label && f.label) {\n            label = f.label;\n        }\n\n        var style = tier.styleForFeature(f);\n        if (style && !f.parts) {\n            if ((0, _das.isDasBooleanTrue)(style.LABEL)) labelWanted = true;\n\n            var glyph = glyphForFeature(canvas, f, y, style, tier, null, true);\n            if (glyph) glyphs.push(glyph);\n        }\n    });\n\n    if (glyphs.length === 0) return null;\n\n    var connector = 'flat';\n    if (gstyle && gstyle.glyph === 'LINE') {\n        // Stick with flat...\n    } else {\n        if (tier.dasSource.collapseSuperGroups && !tier.bumped) {\n            if (strand === '+' || strand === '-') {\n                connector = 'collapsed' + strand;\n            }\n        } else {\n            if (strand === '+' || strand === '-') {\n                connector = 'hat' + strand;\n            }\n        }\n    }\n\n    var labelText = null;\n    if (label && labelWanted || gstyle && ((0, _das.isDasBooleanTrue)(gstyle.LABEL) || (0, _das.isDasBooleanTrue)(gstyle.LABELS))) {\n        // HACK, LABELS should work.\n        labelText = groupElement.label || label;\n    }\n\n    glyphs.sort(function (g1, g2) {\n        return (g1.zindex || 0) - (g2.zindex || 0);\n    });\n\n    var groupGlyph = new Glyphs.GroupGlyph(glyphs, connector);\n    if (labelText) {\n        if (strand === '+') {\n            labelText = '>' + labelText;\n        } else if (strand === '-') {\n            labelText = '<' + labelText;\n        }\n        groupGlyph = new Glyphs.LabelledGlyph(canvas, groupGlyph, labelText, false);\n    }\n    groupGlyph.bump = true;\n    return groupGlyph;\n}\n\nfunction glyphForFeature(canvas, feature, y, style, tier, forceHeight, noLabel) {\n    var scale = tier.browser.scale;\n    var origin = tier.browser.viewStart;\n    var glyphType = style.glyph || 'BOX';\n\n    var min = feature.min;\n    var max = feature.max;\n    var strand = feature.orientation;\n    var score = feature.score;\n    var label = feature.label || feature.id;\n\n    // Hide glyphs that are smaller than a pixel in width.\n    if (tier.dasSource.hideSubpixelGlyphs && (max - min) * scale < 1) return null;\n\n    var minPos = (min - origin) * scale;\n    var rawMaxPos = (max - origin + 1) * scale;\n    var maxPos = Math.max(rawMaxPos, minPos + 1);\n\n    forceHeight = forceHeight * 1.0;\n    var height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n    height = height * 1.0;\n    var bump = style.BUMP && (0, _das.isDasBooleanTrue)(style.BUMP);\n\n    var glyph = void 0;\n    var quant = void 0;\n\n    // Create the glyph\n    if (glyphType === 'CROSS' || glyphType === 'EX' || glyphType === 'TRIANGLE' || glyphType === 'DOT' || glyphType === 'SQUARE' || glyphType === 'STAR' || glyphType === 'PLIMSOLL') {\n        var glyphHolder = featureToCrossLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight, noLabel);\n        if (glyphHolder) {\n            var _glyphHolder = _slicedToArray(glyphHolder, 2);\n\n            glyph = _glyphHolder[0];\n            quant = _glyphHolder[1];\n        }\n    } else if (glyphType === 'HISTOGRAM' || glyphType === 'GRADIENT' && score !== 'undefined') {\n        var _featureToGradientLik = featureToGradientLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight);\n\n        var _featureToGradientLik2 = _slicedToArray(_featureToGradientLik, 2);\n\n        glyph = _featureToGradientLik2[0];\n        quant = _featureToGradientLik2[1];\n    } else if (glyphType === 'HIDDEN') {\n        glyph = new Glyphs.PaddedGlyph(null, minPos, maxPos);\n        noLabel = true;\n    } else if (glyphType === 'ARROW') {\n        var color = style.FGCOLOR || 'purple';\n        var parallel = (0, _das.isDasBooleanTrue)(style.PARALLEL);\n        var sw = (0, _das.isDasBooleanTrue)(style.SOUTHWEST);\n        var ne = (0, _das.isDasBooleanTrue)(style.NORTHEAST);\n        glyph = new Glyphs.ArrowGlyph(minPos, maxPos, height, color, parallel, sw, ne);\n    } else if (glyphType === 'ANCHORED_ARROW') {\n        var stroke = style.FGCOLOR || 'none';\n        var fill = style.BGCOLOR || 'green';\n        glyph = new Glyphs.AArrowGlyph(minPos, maxPos, height, fill, stroke, strand);\n        glyph.bump = true;\n    } else if (glyphType === 'SPAN') {\n        var _stroke = style.FGCOLOR || 'black';\n        glyph = new Glyphs.SpanGlyph(minPos, maxPos, height, _stroke);\n    } else if (glyphType === 'LINE') {\n        var _stroke2 = style.FGCOLOR || 'black';\n        var lineStyle = style.STYLE || 'solid';\n        glyph = new Glyphs.LineGlyph(minPos, maxPos, height, lineStyle, strand, _stroke2);\n    } else if (glyphType === 'PRIMERS') {\n        var _stroke3 = style.FGCOLOR || 'black';\n        var _fill = style.BGCOLOR || 'red';\n        glyph = new Glyphs.PrimersGlyph(minPos, maxPos, height, _fill, _stroke3);\n    } else if (glyphType === 'TEXT') {\n        var string = style.STRING || 'text';\n        var _fill2 = style.FGCOLOR || 'black';\n        glyph = new Glyphs.TextGlyph(canvas, minPos, maxPos, height, _fill2, string);\n    } else if (glyphType === 'TOOMANY') {\n        var _stroke4 = style.FGCOLOR || 'gray';\n        var _fill3 = style.BGCOLOR || 'orange';\n        glyph = new Glyphs.TooManyGlyph(minPos, maxPos, height, _fill3, _stroke4);\n    } else if (glyphType === 'POINT') {\n        var _featureToPointGlyph = featureToPointGlyph(tier, feature, style);\n\n        var _featureToPointGlyph2 = _slicedToArray(_featureToPointGlyph, 2);\n\n        glyph = _featureToPointGlyph2[0];\n        quant = _featureToPointGlyph2[1];\n    } else if (glyphType === '__SEQUENCE') {\n        glyph = sequenceGlyph(canvas, tier, feature, style, forceHeight);\n    } else if (glyphType === '__INSERTION') {\n        var insertionLabels = true;\n        if (style.__INSERTIONS !== undefined) insertionLabels = (0, _das.isDasBooleanNotFalse)(style.__INSERTIONS);\n        glyph = new Glyphs.TriangleGlyph(minPos, 5, 'S', 5, tier.browser.baseColors['I']);\n        if (insertionLabels) glyph = new Glyphs.LabelledGlyph(canvas, glyph, feature.insertion || feature.altAlleles[0], false, 'center', 'above', '7px sans-serif');\n\n        if (maxPos - minPos > 1) {\n            var _stroke5 = style.FGCOLOR || 'red';\n            var _fill4 = style.BGCOLOR || style.COLOR1 || 'green';\n            var bg = new Glyphs.BoxGlyph(minPos, 5, maxPos - minPos, height, _fill4, _stroke5);\n            glyph = new Glyphs.GroupGlyph([bg, glyph]);\n        }\n    } else if (glyphType === '__NONE') {\n        return null;\n    } else if (glyphType === 'BOX') {\n        var _stroke6 = style.FGCOLOR || null;\n        var _fill5 = style.BGCOLOR || style.COLOR1 || 'green';\n        if (style.BGITEM && feature.itemRgb) _fill5 = feature.itemRgb;\n        var _scale = (maxPos - minPos) / (max - min);\n        if (feature.type == 'translation' && (feature.method == 'protein_coding' || feature.readframeExplicit) && (!feature.tags || feature.tags.indexOf('cds_start_NF') < 0 || feature.readframeExplicit) && (!tier.dasSource.collapseSuperGroups || tier.bumped) && _scale >= 0.5) {\n            var refSeq = getRefSeq(tier, min, max);\n            glyph = new Glyphs.AminoAcidGlyph(minPos, maxPos, height, _fill5, refSeq, feature.orientation, feature.readframe);\n        } else {\n            glyph = new Glyphs.BoxGlyph(minPos, 0, maxPos - minPos, height, _fill5, _stroke6);\n        }\n    }\n\n    if (!glyph) return;\n\n    if (((0, _das.isDasBooleanTrue)(style.LABEL) || feature.forceLabel) && label && !noLabel) {\n        glyph = new Glyphs.LabelledGlyph(canvas, glyph, label, false);\n    }\n\n    if (bump) {\n        glyph.bump = true;\n    }\n\n    glyph.feature = feature;\n\n    if ((0, _das.isDasBooleanTrue)(style[\"HIDEAXISLABEL\"])) quant = null;\n\n    if (quant) {\n        glyph.quant = quant;\n    }\n\n    if (style.ZINDEX) {\n        glyph.zindex = style.ZINDEX | 0;\n    }\n\n    return glyph;\n}\n\nfunction groupFeatures(tier, canvas, y) {\n    var glyphs = [];\n    var gbsFeatures = {};\n    var gbsStyles = {};\n    var stackedFeatures = [];\n\n    R.map(function (features) {\n        features.forEach(function (feature) {\n            var style = tier.styleForFeature(feature);\n\n            if (feature.parts || !style) return;\n\n            if (style.glyph === 'LINEPLOT') {\n                (0, _utils.pusho)(gbsFeatures, style.id, feature);\n                gbsStyles[style.id] = style;\n            } else if (style.glyph === 'STACKED') {\n                stackedFeatures.push(feature);\n            } else {\n                var glyph = glyphForFeature(canvas, feature, y, style, tier);\n                if (glyph) glyphs.push(glyph);\n            }\n        });\n    }, tier.ungroupedFeatures);\n\n    if (stackedFeatures.length > 0) {\n        glyphs = glyphs.concat(makeStackedBars(stackedFeatures, tier));\n    }\n\n    for (var gbs in gbsFeatures) {\n        var gf = gbsFeatures[gbs];\n        var style = gbsStyles[gbs];\n        if (style.glyph === 'LINEPLOT') {\n            var lineGraphGlyphs = makeLinePlot(gf, style, tier, y);\n            lineGraphGlyphs.forEach(function (g) {\n                return glyphs.push(g);\n            });\n        }\n    }\n\n    return glyphs;\n}\n\nfunction glyphifyGroups(tier, canvas, glyphs, y) {\n    var groupIds = Object.keys(tier.groupedFeatures);\n    var groupGlyphs = {};\n\n    groupIds.sort(function (g1, g2) {\n        return tier.groupedFeatures[g2][0].score - tier.groupedFeatures[g1][0].score;\n    });\n\n    groupIds.forEach(function (gId) {\n        var glyphs = glyphsForGroup(canvas, tier.groupedFeatures[gId], y, tier.groups[gId], tier, tier.dasSource.collapseSuperGroups && !tier.bumped ? 'collapsed_gene' : 'tent');\n\n        if (glyphs) {\n            glyphs.group = tier.groups[gId];\n            groupGlyphs[gId] = glyphs;\n        }\n    });\n\n    return groupGlyphs;\n}\n\nfunction bumpSubtiers(tier, glyphs, grid, gridOffset, gridSpacing) {\n    var subtierMax = tier.subtierMax || tier.dasSource.subtierMax || tier.browser.defaultSubtierMax;\n\n    var subtiersExceeded = false;\n\n    var unbumpedST = new _featureDraw.SubTier();\n    var bumpedSTs = [];\n\n    // We want to add each glyph to either the subtier\n    // containing unbumped subtiers, or to the first bumped subtier.\n    glyphs.forEach(function (glyph) {\n        // if the glyph is to be bumped...\n        if (glyph.bump && (tier.bumped || tier.dasSource.collapseSuperGroups)) {\n\n            var glyphTier = bumpedSTs.find(function (st) {\n                return st.hasSpaceFor(glyph);\n            });\n\n            if (glyphTier) {\n                glyphTier.add(glyph);\n            } else if (bumpedSTs.length >= subtierMax) {\n                subtiersExceeded = true;\n            } else {\n                var subtier = new _featureDraw.SubTier();\n                subtier.add(glyph);\n                bumpedSTs.push(subtier);\n            }\n        } else {\n            unbumpedST.add(glyph);\n        }\n    });\n\n    if (unbumpedST.glyphs.length > 0) {\n        bumpedSTs = [unbumpedST].concat(bumpedSTs);\n    }\n\n    // Simple hack to make the horizontal grid in bumped subtiers (e.g. lineplots)\n    // optional and configurable.\n    if (grid) {\n        bumpedSTs.forEach(function (subtier) {\n            if (subtier.quant) {\n                subtier.glyphs.unshift(new Glyphs.GridGlyph(subtier.height, gridOffset, gridSpacing));\n            }\n        });\n    }\n\n    bumpedSTs.forEach(function (subtier) {\n        subtier.glyphs.sort(function (g1, g2) {\n            return (g1.zindex || 0) - (g2.zindex || 0);\n        });\n    });\n\n    return [bumpedSTs, subtiersExceeded];\n}\n\n// The whole tier is translated downward on its canvas by y pixels\nfunction prepareSubtiers(tier, canvas) {\n    var y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n    var grid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n\n    var MIN_PADDING = 3;\n    tier.padding = typeof tier.dasSource.padding === 'number' ? tier.dasSource.padding : MIN_PADDING;\n\n    tier.scaleVertical = typeof tier.dasSource.scaleVertical === 'boolean' ? tier.dasSource.scaleVertical : false;\n\n    var glyphs = groupFeatures(tier, canvas, y);\n\n    // Merge supergroups\n    if (tier.dasSource.collapseSuperGroups && !tier.bumped) {\n        var _loop = function _loop(sgId) {\n            var sgGroup = tier.superGroups[sgId];\n            tier.groups[sgId] = (0, _utils.shallowCopy)(tier.groups[sgId]);\n            var group = tier.groups[sgId];\n            group.isSuperGroup = true;\n            var featuresByType = {};\n\n            var sgMin = 10000000000,\n                sgMax = -10000000000;\n            var sgSeg = null;\n\n            sgGroup.forEach(function (g, i) {\n                var groupedFeature = tier.groupedFeatures[sgGroup[i]];\n                if (!groupedFeature) return;\n\n                groupedFeature.forEach(function (feature) {\n                    (0, _utils.pusho)(featuresByType, feature.type, feature);\n                    sgMin = Math.min(feature.min, sgMin);\n                    sgMax = Math.max(feature.max, sgMax);\n                    if (feature.segment && !sgSeg) sgSeg = feature.segment;\n                });\n\n                if (group && !group.links || group.links.length === 0) {\n                    group.links = tier.groups[sgGroup[0]].links;\n                }\n\n                delete tier.groupedFeatures[sgGroup[i]];\n            });\n\n            tier.groups[sgId].max = sgMax;\n            tier.groups[sgId].min = sgMin;\n            tier.groups[sgId].segment = sgSeg;\n\n            R.map(function (features) {\n\n                var template = features[0];\n                var loc = null;\n\n                features.forEach(function (feature) {\n                    var fl = new _spans.Range(feature.min, feature.max);\n                    loc = loc ? (0, _spans.union)(loc, fl) : fl;\n                });\n\n                var mergedRanges = loc.ranges();\n\n                mergedRanges.forEach(function (range) {\n                    var posCoverage = ((range.max() | 0) - (range.min() | 0) + 1) * sgGroup.length;\n                    var actCoverage = 0;\n\n                    features.forEach(function (feature) {\n                        var fmin = feature.min || 0;\n                        var fmax = feature.max || 0;\n                        if (fmin <= range.max() && fmax >= range.min()) {\n\n                            actCoverage += Math.min(fmax, range.max()) - Math.max(fmin, range.min()) + 1;\n                        }\n                    });\n\n                    var newFeature = new _das.DASFeature();\n                    for (var key in template) {\n                        newFeature[key] = template[key];\n                    }\n\n                    newFeature.min = range.min();\n                    newFeature.max = range.max();\n                    if (newFeature.label && sgGroup.length > 1) {\n                        newFeature.label += ' (' + sgGroup.length + ' vars)';\n                    }\n\n                    newFeature.visualWeight = 1.0 * actCoverage / posCoverage;\n\n                    (0, _utils.pusho)(tier.groupedFeatures, sgId, newFeature);\n                });\n            }, featuresByType);\n\n            delete tier.superGroups[sgId]; // Do we want this?\n        };\n\n        for (var sgId in tier.superGroups) {\n            _loop(sgId);\n        }\n    }\n\n    // Glyphify groups.\n    var groupGlyphs = glyphifyGroups(tier, canvas, glyphs, y);\n\n    R.map(function (superGroup) {\n        var sgGlyphs = [];\n        var sgMin = 10000000000;\n        var sgMax = -10000000000;\n\n        superGroup.forEach(function (glyphs) {\n            var gGlyphs = groupGlyphs[glyphs];\n            if (gGlyphs) {\n                sgGlyphs.push(gGlyphs);\n                sgMin = Math.min(sgMin, gGlyphs.min());\n                sgMax = Math.max(sgMax, gGlyphs.max());\n            }\n        });\n\n        sgGlyphs.forEach(function (glyph) {\n            glyphs.push(new Glyphs.PaddedGlyph(glyph, sgMin, sgMax));\n        });\n    }, tier.superGroups);\n\n    R.map(function (glyph) {\n        return glyphs.push(glyph);\n    }, groupGlyphs);\n\n    var _bumpSubtiers = bumpSubtiers(tier, glyphs, grid, y),\n        _bumpSubtiers2 = _slicedToArray(_bumpSubtiers, 2),\n        subtiers = _bumpSubtiers2[0],\n        subtiersExceeded = _bumpSubtiers2[1];\n\n    tier.glyphCacheOrigin = tier.browser.viewStart;\n\n    if (subtiersExceeded) tier.updateStatus('Bumping limit exceeded, use the track editor to see more features');else tier.updateStatus();\n\n    tier.subtiers = subtiers;\n}\n\n// Fills out areas that haven't been fetched as gray blocks\nfunction drawUnmapped(tier, canvas, padding) {\n    var drawStart = tier.browser.viewStart - 1000.0 / tier.browser.scale;\n    var drawEnd = tier.browser.viewEnd + 1000.0 / tier.browser.scale;\n    var unmappedBlocks = [];\n    if (tier.knownCoverage) {\n        var knownRanges = tier.knownCoverage.ranges();\n        knownRanges.forEach(function (range, index) {\n            if (index === 0) {\n                if (range.min() > drawStart) unmappedBlocks.push({ min: drawStart, max: range.min() - 1 });\n            } else {\n                unmappedBlocks.push({ min: knownRanges[index - 1].max() + 1, max: range.min() - 1 });\n            }\n\n            if (index == knownRanges.length - 1 && range.max() < drawEnd) {\n                unmappedBlocks.push({ min: range.max() + 1, max: drawEnd });\n            }\n        });\n    }\n    if (unmappedBlocks.length > 0) {\n        canvas.fillStyle = 'gray';\n        unmappedBlocks.forEach(function (block) {\n            var min = (block.min - tier.browser.viewStart) * tier.browser.scale + 1000;\n            var max = (block.max - tier.browser.viewStart) * tier.browser.scale + 1000;\n            canvas.fillRect(min, 0, max - min, padding);\n        });\n    }\n}\n\nfunction clearViewport(canvas, width, height) {\n    canvas.clearRect(0, 0, width, height);\n}\n\n// Make the viewport & canvas the correct size for the tier\nfunction prepareViewport(tier, canvas, retina) {\n    var clear = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n    var vOffset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n\n    var desiredWidth = tier.browser.featurePanelWidth + 2000;\n    if (retina) {\n        desiredWidth *= 2;\n    }\n\n    var fpw = tier.viewport.width | 0;\n    if (fpw < desiredWidth - 50) {\n        tier.viewport.width = fpw = desiredWidth;\n    }\n\n    var lh = tier.padding + vOffset;\n\n    tier.subtiers.forEach(function (s) {\n        return lh += s.height + tier.padding;\n    });\n\n    lh += 6;\n    lh = Math.max(lh, tier.browser.minTierHeight);\n\n    var canvasHeight = lh;\n    if (retina) {\n        canvasHeight *= 2;\n    }\n\n    if (canvasHeight != tier.viewport.height) {\n        tier.viewport.height = canvasHeight;\n    }\n\n    tier.viewportHolder.style.left = '-1000px';\n    tier.viewport.style.width = retina ? '' + fpw / 2 + 'px' : '' + fpw + 'px';\n    tier.viewport.style.height = '' + lh + 'px';\n    tier.layoutHeight = Math.max(lh, tier.browser.minTierHeight);\n\n    tier.updateHeight();\n    tier.norigin = tier.browser.viewStart;\n\n    canvas.save();\n    if (retina) {\n        canvas.scale(2, 2);\n    }\n\n    if (clear) {\n        clearViewport(canvas, fpw, canvasHeight);\n    }\n\n    drawUnmapped(tier, canvas, lh);\n}\n\nfunction paint(tier, canvas) {\n    var vOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n    var overlayLabelCanvas = new Glyphs.OverlayLabelCanvas();\n    var offset = (tier.glyphCacheOrigin - tier.browser.viewStart) * tier.browser.scale + 1000;\n    canvas.translate(offset, vOffset + tier.padding);\n    overlayLabelCanvas.translate(0, tier.padding);\n\n    tier.paintToContext(canvas, overlayLabelCanvas, offset);\n\n    if (overlayLabelCanvas.glyphs.length > 0) tier.overlayLabelCanvas = overlayLabelCanvas;else tier.overlayLabelCanvas = null;\n\n    canvas.restore();\n}\n\nfunction getScoreMinMax(tier, style) {\n    var smin = tier.quantMin(style);\n    var smax = tier.quantMax(style);\n\n    if (!smax) {\n        if (smin < 0) {\n            smax = 0;\n        } else {\n            smax = 10;\n        }\n    }\n    if (!smin) {\n        smin = 0;\n    }\n    return [smin, smax];\n}\n\nfunction relScoreOrigin(score, smin, smax) {\n    var relScore = (1.0 * score - smin) / (smax - smin);\n    var relOrigin = -1.0 * smin / (smax - smin);\n\n    return [relScore, relOrigin];\n}\n\nfunction getRefSeq(tier, min, max) {\n    var refSeq = null;\n    if (tier.currentSequence) {\n        var csStart = tier.currentSequence.start | 0;\n        var csEnd = tier.currentSequence.end | 0;\n        if (csStart <= max && csEnd >= min) {\n            var sfMin = Math.max(min, csStart);\n            var sfMax = Math.min(max, csEnd);\n\n            refSeq = tier.currentSequence.seq.substr(sfMin - csStart, sfMax - sfMin + 1);\n            while (min < sfMin) {\n                refSeq = 'N' + refSeq;\n                sfMin--;\n            }\n            while (max > sfMax) {\n                refSeq = refSeq + 'N';\n                sfMax++;\n            }\n        }\n    }\n    return refSeq;\n}\n\nfunction featureToCrossLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight, noLabel) {\n    var scale = tier.browser.scale;\n    var origin = tier.browser.viewStart;\n\n    var score = feature.score;\n    var label = feature.label || feature.id;\n\n    var minPos = (feature.min - origin) * scale;\n    var maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n    var height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n    var requiredHeight = height;\n\n    var glyph = null;\n    var quant = null;\n\n    var stroke = style.FGCOLOR || 'black';\n    var fill = style.BGCOLOR || 'none';\n    var outline = style.STROKECOLOR;\n\n    if (style.BGITEM && feature.itemRgb) {\n        stroke = feature.itemRgb;\n    } else if ((0, _das.isDasBooleanTrue)(style.COLOR_BY_SCORE2)) {\n        var grad = style.BGGRAD || style._gradient;\n        if (!grad) {\n            grad = (0, _color.makeGradient)(50, style.COLOR1, style.COLOR2, style.COLOR3);\n            style._gradient = grad;\n        }\n\n        var score2 = feature.score2;\n        if (score2 !== undefined || !stroke) {\n            score2 = score2 || 0;\n\n            var smin2 = style.MIN2 ? 1.0 * style.MIN2 : 0.0;\n            var smax2 = style.MAX2 ? 1.0 * style.MAX2 : 1.0;\n            var relScore2 = (1.0 * score2 - smin2) / (smax2 - smin2);\n\n            var step = relScore2 * grad.length | 0;\n            R.clamp(0, step, grad.length - 1);\n            stroke = grad[step];\n        }\n    }\n\n    var size = style.SIZE || height;\n    if (style.RSIZE) {\n        size = 1.0 * style.RSIZE * height;\n    }\n\n    if (style.STROKETHRESHOLD) {\n        if (size < 1.0 * style.STROKETHRESHOLD) outline = null;\n    }\n\n    var mid = (minPos + maxPos) / 2;\n\n    if (glyphType === 'EX') {\n        glyph = new Glyphs.ExGlyph(mid, size, stroke);\n    } else if (glyphType === 'TRIANGLE') {\n        var dir = style.DIRECTION || 'N';\n        var width = style.LINEWIDTH || size;\n        glyph = new Glyphs.TriangleGlyph(mid, size, dir, width, stroke, outline);\n    } else if (glyphType === 'DOT') {\n        glyph = new Glyphs.DotGlyph(mid, size, stroke, outline);\n    } else if (glyphType === 'PLIMSOLL') {\n        glyph = new Glyphs.PlimsollGlyph(mid, size, 0.2 * size, stroke, outline);\n    } else if (glyphType === 'SQUARE') {\n        glyph = new Glyphs.BoxGlyph(mid - size / 2, 0, size, size, stroke, outline);\n    } else if (glyphType === 'STAR') {\n        var points = style.POINTS || 5;\n        glyph = new Glyphs.StarGlyph(mid, size / 2, points, stroke, outline);\n    } else {\n        glyph = new Glyphs.CrossGlyph(mid, size, stroke);\n    }\n\n    if (fill && fill !== 'none' && maxPos - minPos > 5) {\n        var boxGlyph = new Glyphs.BoxGlyph(minPos, 0, maxPos - minPos, size, fill);\n        glyph = new Glyphs.GroupGlyph([boxGlyph, glyph]);\n    }\n\n    if ((0, _das.isDasBooleanTrue)(style.SCATTER)) {\n        var _getScoreMinMax = getScoreMinMax(tier, style),\n            _getScoreMinMax2 = _slicedToArray(_getScoreMinMax, 2),\n            smin = _getScoreMinMax2[0],\n            smax = _getScoreMinMax2[1];\n\n        var _relScoreOrigin = relScoreOrigin(score, smin, smax),\n            _relScoreOrigin2 = _slicedToArray(_relScoreOrigin, 2),\n            relScore = _relScoreOrigin2[0],\n            relOrigin = _relScoreOrigin2[1];\n\n        if (relScore < 0.0 || relScore > 1.0) {\n            // Glyph is out of bounds.\n            // Should we allow for \"partially showing\" glyphs?\n\n            return null;\n        } else {\n            var originShift = function originShift(x) {\n                return (x - relOrigin) * requiredHeight;\n            };\n            height = Math.max(1, originShift(relScore));\n            y = y + originShift(1);\n\n            if (relScore >= relOrigin) y = y - height;\n\n            quant = { min: smin, max: smax };\n\n            var heightFudge = 0;\n            var featureLabel = R.defaultTo(style.LABEL, feature.forceLabel);\n\n            if ((0, _das.isDasBooleanNotFalse)(featureLabel) && label && !noLabel) {\n                glyph = new Glyphs.LabelledGlyph(canvas, glyph, label, true, null, featureLabel == 'above' ? 'above' : 'below');\n                if (featureLabel === 'above') {\n                    heightFudge = glyph.textHeight + 2;\n                }\n                noLabel = true;\n            }\n            glyph = new Glyphs.TranslatedGlyph(glyph, 0, y - size / 2 - heightFudge, requiredHeight);\n        }\n    }\n\n    return [glyph, quant];\n}\n\nfunction featureToGradientLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight) {\n    var scale = tier.browser.scale;\n    var origin = tier.browser.viewStart;\n\n    var score = feature.score;\n\n    var minPos = (feature.min - origin) * scale;\n    var maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n    var height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n    var requiredHeight = height * 1.0;\n\n    var glyph = null;\n    var quant = null;\n\n    var centerOnAxis = (0, _das.isDasBooleanTrue)(style[\"AXISCENTER\"]);\n\n    var _getScoreMinMax3 = getScoreMinMax(tier, style),\n        _getScoreMinMax4 = _slicedToArray(_getScoreMinMax3, 2),\n        smin = _getScoreMinMax4[0],\n        smax = _getScoreMinMax4[1];\n\n    // AUTOMIN & AUTOMAX respectively set the lower and upper bounds\n\n\n    if ((0, _das.isDasBooleanTrue)(style.AUTOMIN)) {\n        smin = tier.currentFeaturesMinScore * 0.95;\n        console.log(\"smin:\\t\" + smin);\n    }\n    if ((0, _das.isDasBooleanTrue)(style.AUTOMAX)) {\n        smax = tier.currentFeaturesMaxScore * 1.05;\n        console.log(\"smax:\\t\" + smax);\n    }\n\n    if (1.0 * score < 1.0 * smin) {\n        score = smin;\n    }\n    if (1.0 * score > 1.0 * smax) {\n        score = smax;\n    }\n\n    // Shift smin/smax in case we want to center the histogram\n    // on the horizontal axis\n    if (centerOnAxis) {\n        var tmin = tier.quantMin(style);\n        var tmax = tier.quantMax(style);\n\n        if ((0, _das.isDasBooleanTrue)(style.AUTOMIN)) {\n            tmin = tier.currentFeaturesMinScore * 0.95;\n        }\n        if ((0, _das.isDasBooleanTrue)(style.AUTOMAX)) {\n            tmax = tier.currentFeaturesMaxScore * 1.05;\n        }\n\n        smin = tmin - (tmax - tmin) / 2;\n        smax = tmax - (tmax - tmin) / 2;\n    }\n\n    var _relScoreOrigin3 = relScoreOrigin(score, smin, smax),\n        _relScoreOrigin4 = _slicedToArray(_relScoreOrigin3, 2),\n        relScore = _relScoreOrigin4[0],\n        relOrigin = _relScoreOrigin4[1];\n\n    if (glyphType === 'HISTOGRAM') {\n        var originShift = function originShift(x) {\n            return x - Math.max(0, relOrigin);\n        };\n        height = Math.abs(originShift(relScore)) * requiredHeight;\n        y = y + originShift(1.0) * requiredHeight;\n\n        if (relScore >= relOrigin) y -= height;\n\n        if (centerOnAxis) y += height / 2;\n\n        if ((0, _das.isDasBooleanTrue)(style[\"HIDEAXISLABEL\"])) quant = null;else quant = { min: smin, max: smax };\n    }\n\n    var stroke = style.FGCOLOR || null;\n    var fill = style.BGCOLOR || style.COLOR1 || 'green';\n    if (style.BGITEM && feature.itemRgb) fill = feature.itemRgb;\n    var alpha = style.ALPHA ? 1.0 * style.ALPHA : null;\n\n    if (style.BGGRAD) {\n        var grad = style.BGGRAD;\n        var step = relScore * grad.length | 0;\n        step = R.clamp(0, step, grad.length - 1);\n        fill = grad[step];\n    }\n\n    if (style.COLOR2) {\n        var _grad = style._gradient;\n        if (!_grad) {\n            _grad = (0, _color.makeGradient)(50, style.COLOR1, style.COLOR2, style.COLOR3);\n            style._gradient = _grad;\n        }\n\n        var _step = relScore * _grad.length | 0;\n        _step = R.clamp(0, _step, _grad.length - 1);\n        fill = _grad[_step];\n    }\n\n    var tempGlyph = new Glyphs.BoxGlyph(minPos, y, maxPos - minPos, height, fill, stroke, alpha);\n    glyph = new Glyphs.TranslatedGlyph(tempGlyph, 0, 0, requiredHeight);\n\n    return [glyph, quant];\n}\n\nfunction featureToPointGlyph(tier, feature, style) {\n    var scale = tier.browser.scale;\n    var origin = tier.browser.viewStart;\n\n    var score = feature.score;\n\n    var minPos = (feature.min - origin) * scale;\n    var maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n    var height = tier.forceHeight || style.HEIGHT || 30;\n\n    var glyph = null;\n    var quant = null;\n\n    var _getScoreMinMax5 = getScoreMinMax(tier, style),\n        _getScoreMinMax6 = _slicedToArray(_getScoreMinMax5, 2),\n        smin = _getScoreMinMax6[0],\n        smax = _getScoreMinMax6[1];\n\n    var yscale = 1.0 * height / (smax - smin);\n    var relScore = (1.0 * score - smin) / (smax - smin);\n    var sc = (score - 1.0 * smin) * yscale | 0;\n    quant = { min: smin, max: smax };\n\n    var fill = style.FGCOLOR || style.COLOR1 || 'black';\n    if (style.COLOR2) {\n        var grad = style._gradient;\n        if (!grad) {\n            grad = (0, _color.makeGradient)(50, style.COLOR1, style.COLOR2, style.COLOR3);\n            style._gradient = grad;\n        }\n\n        var step = relScore * grad.length | 0;\n        step = R.clamp(0, step, grad.length - 1);\n        fill = grad[step];\n    }\n\n    glyph = new Glyphs.PointGlyph((minPos + maxPos) / 2, height - sc, height, fill);\n\n    return [glyph, quant];\n}\n\nfunction sequenceGlyph(canvas, tier, feature, style, forceHeight) {\n    var scale = tier.browser.scale;\n    var origin = tier.browser.viewStart;\n\n    var min = feature.min;\n    var max = feature.max;\n    var minPos = (feature.min - origin) * scale;\n    var maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n    var height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n\n    var glyph = null;\n\n    var rawseq = feature.seq;\n    var seq = rawseq;\n    var rawquals = feature.quals;\n    var quals = rawquals;\n    var insertionLabels = (0, _das.isDasBooleanTrue)(style.__INSERTIONS);\n\n    var indels = [];\n    if (feature.cigar) {\n        var ops = (0, _cigar.parseCigar)(feature.cigar);\n        seq = '';\n        quals = '';\n        var cursor = 0;\n\n        ops.forEach(function (co) {\n            if (co.op === 'M') {\n                seq += rawseq.substr(cursor, co.cnt);\n                quals += rawquals.substr(cursor, co.cnt);\n                cursor += co.cnt;\n            } else if (co.op === 'D') {\n                seq += \"-\".repeat(co.cnt);\n                quals += \"Z\".repeat(co.cnt);\n            } else if (co.op === 'I') {\n                var inseq = rawseq.substr(cursor, co.cnt);\n                var ig = new Glyphs.TranslatedGlyph(new Glyphs.TriangleGlyph(minPos + seq.length * scale, 6, 'S', 5, tier.browser.baseColors['I']), 0, -2, 0);\n                if (insertionLabels) ig = new Glyphs.LabelledGlyph(canvas, ig, inseq, false, 'center', 'above', '7px sans-serif');\n                ig.feature = { label: 'Insertion: ' + inseq, type: 'insertion', method: 'insertion' };\n                indels.push(ig);\n\n                cursor += co.cnt;\n            } else if (co.op === 'S') {\n                cursor += co.cnt;\n            } else {\n                console.log('unknown cigop' + co.op);\n            }\n        });\n    }\n\n    var refSeq = getRefSeq(tier, min, max);\n    if (seq && refSeq && (style.__SEQCOLOR === 'mismatch' || style.__SEQCOLOR === 'mismatch-all')) {\n        var mismatchSeq = [];\n        var match = feature.orientation === '-' ? ',' : '.';\n        for (var i = 0; i < seq.length; ++i) {\n            mismatchSeq.push(seq[i] == refSeq[i] ? match : seq[i]);\n        }\n        seq = mismatchSeq.join('');\n    }\n\n    var strandColor = feature.orientation === '-' ? style._minusColor || 'lightskyblue' : style._plusColor || 'lightsalmon';\n\n    if (style.__disableQuals) quals = false;\n\n    glyph = new Glyphs.SequenceGlyph(tier.browser.baseColors, strandColor, minPos, maxPos, height, seq, refSeq, style.__SEQCOLOR, quals, !(0, _das.isDasBooleanTrue)(style.__CLEARBG), tier.scaleVertical);\n\n    if (insertionLabels) glyph = new Glyphs.TranslatedGlyph(glyph, 0, 7);\n\n    if (indels.length > 0) {\n        indels.splice(0, 0, glyph);\n        glyph = new Glyphs.GroupGlyph(indels);\n    }\n\n    return glyph;\n}\n\nfunction makeLinePlot(features, style, tier, yshift) {\n    yshift = yshift || 0;\n\n    var origin = tier.browser.viewStart,\n        scale = tier.browser.scale;\n    var height = tier.forceHeight || style.HEIGHT || 30;\n    var min = tier.quantMin(style);\n    var max = tier.quantMax(style);\n\n    // AUTOMIN & AUTOMAX respectively set the lower and upper bounds\n    if ((0, _das.isDasBooleanTrue)(style.AUTOMIN)) {\n        // add some basically arbitrary padding\n        min = tier.currentFeaturesMinScore * 0.95;\n    }\n    if ((0, _das.isDasBooleanTrue)(style.AUTOMAX)) {\n        max = tier.currentFeaturesMaxScore * 1.05;\n    }\n\n    var yscale = 1.0 * height / (max - min);\n    var color = style.FGCOLOR || style.COLOR1 || 'black';\n\n    var prevSign = 1;\n    var curSign = null;\n\n    var curGlyphPoints = [];\n    var glyphSequences = [];\n\n    var prevPoint = null;\n\n    features.forEach(function (f) {\n        var px = (((f.min | 0) + (f.max | 0)) / 2 - origin) * scale;\n        var sc = (f.score - 1.0 * min) * yscale | 0;\n\n        // Additive tracks are always above the x-axis, and are colored\n        // depending on whether the score is positive or negative.\n        if ((0, _das.isDasBooleanTrue)(style.ADDITIVE)) {\n            curSign = f.score < 0 ? -1 : 1;\n\n            if (curSign !== prevSign) {\n                glyphSequences.push({\n                    points: curGlyphPoints,\n                    color: prevSign === 1 ? style.POSCOLOR : style.NEGCOLOR\n                });\n                curGlyphPoints = [];\n                // Need to add the previous point to this sequence,\n                // otherwise there is a gap in the resulting plot\n                curGlyphPoints.push(prevPoint);\n            }\n            prevSign = curSign;\n        } else {\n            curSign = 1;\n        }\n\n        var py = height - sc * curSign + yshift;\n        prevPoint = { x: px, y: py };\n        curGlyphPoints.push(prevPoint);\n    });\n\n    // Need to add the final sequence of points as well.\n    if ((0, _das.isDasBooleanTrue)(style.ADDITIVE)) {\n        color = curSign === 1 ? style.POSCOLOR : style.NEGCOLOR;\n    }\n    glyphSequences.push({\n        points: curGlyphPoints,\n        color: color\n    });\n\n    var lggs = glyphSequences.map(function (gs) {\n        var lgg = new Glyphs.LineGraphGlyph(gs.points, gs.color, height);\n        lgg.quant = { min: min, max: max };\n\n        if (style.ZINDEX) lgg.zindex = style.ZINDEX | 0;\n\n        return lgg;\n    });\n\n    return lggs;\n}\n\nfunction makeStackedBars(features, tier) {\n    var glyphs = [];\n\n    var posStacks = [],\n        negStacks = [];\n\n    var scale = tier.browser.scale,\n        origin = tier.browser.viewStart;\n    for (var fi = 0; fi < features.length; ++fi) {\n        var feature = features[fi];\n        var style = tier.styleForFeature(feature);\n        var score = feature.score * 1.0;\n\n        var height = tier.forceHeight || style.HEIGHT || 12;\n        var requiredHeight = height = 1.0 * height;\n\n        var min = feature.min;\n        var max = feature.max;\n\n        var minPos = (min - origin) * scale;\n        var rawMaxPos = (max - origin + 1) * scale;\n        var maxPos = Math.max(rawMaxPos, minPos + 1);\n\n        // This should somewhat match the 'HISTOGRAM' path.\n\n        var smin = tier.quantMin(style);\n        var smax = tier.quantMax(style);\n\n        if (!smax) {\n            if (smin < 0) {\n                smax = 0;\n            } else {\n                smax = 10;\n            }\n        } else {\n            smax = smax * 1.0;\n        }\n\n        if (!smin) {\n            smin = 0;\n        } else {\n            smin = smin * 1.0;\n        }\n\n        var stackOrigin;\n        if (score >= 0) {\n            stackOrigin = posStacks[min] || 0;\n            posStacks[min] = stackOrigin + score;\n        } else {\n            stackOrigin = negStacks[min] || 0;\n            negStacks[min] = stackOrigin + score;\n        }\n\n        if (stackOrigin > smax || stackOrigin < smin) {\n            // Stack has extended outside of range.\n            continue;\n        }\n\n        if (stackOrigin + score < smin) {\n            score = smin - stackOrigin;\n        }\n        if (stackOrigin + score > smax) {\n            score = smax - stackOrigin;\n        }\n\n        var relScoreEnd = (score + stackOrigin - smin) / (smax - smin);\n        var relScoreStart = (stackOrigin - smin) / (smax - smin);\n        var relScoreMax = Math.max(relScoreStart, relScoreEnd);\n        var relScoreMin = Math.min(relScoreStart, relScoreEnd);\n\n        height = (relScoreMax - relScoreMin) * requiredHeight;\n        var y = (1.0 - relScoreMax) * requiredHeight;\n\n        var stroke = style.FGCOLOR || null;\n        var fill = style.BGCOLOR || style.COLOR1 || 'green';\n        if (style.BGITEM && feature.itemRgb) fill = feature.itemRgb;\n        var alpha = style.ALPHA ? 1.0 * style.ALPHA : null;\n\n        var gg = new Glyphs.BoxGlyph(minPos, y, maxPos - minPos, height, fill, stroke, alpha);\n        gg = new Glyphs.TranslatedGlyph(gg, 0, 0, requiredHeight);\n        gg.feature = feature;\n        gg.quant = {\n            min: smin, max: smax\n        };\n        if (style.ZINDEX) {\n            gg.zindex = style.ZINDEX | 0;\n        }\n        glyphs.push(gg);\n    }\n    return glyphs;\n}\n\n// height is subtier height\nfunction createQuantOverlay(tier, height) {\n    var retina = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n    var width = 50;\n\n    tier.quantOverlay.height = height;\n    tier.quantOverlay.width = retina ? width * 2 : width;\n    tier.quantOverlay.style.height = '' + (retina ? height / 2 : height) + 'px';\n    tier.quantOverlay.style.width = '' + width + 'px';\n    tier.quantOverlay.style.display = 'block';\n\n    var canvas = tier.quantOverlay.getContext('2d');\n\n    if (retina) {\n        canvas.scale(2, 2);\n    }\n\n    return canvas;\n}\n\nfunction paintQuant(canvas, tier, quant, tics) {\n    canvas.save();\n\n    var h = tier.quantOverlay.height;\n    var w = 100;\n\n    var ticSpacing = (h + tier.padding * 2) / tics;\n    var ticInterval = (quant.max - quant.min) / tics;\n\n    canvas.fillStyle = 'white';\n    canvas.globalAlpha = 0.6;\n    if (tier.browser.rulerLocation == 'right') {\n        canvas.fillRect(w - 30, 0, 30, h + tier.padding * 2);\n    } else {\n        canvas.fillRect(0, 0, 30, h + tier.padding * 2);\n    }\n    canvas.globalAlpha = 1.0;\n\n    canvas.strokeStyle = 'black';\n    canvas.lineWidth = 1;\n    canvas.beginPath();\n    if (tier.browser.rulerLocation == 'right') {\n        canvas.moveTo(w - 8, tier.padding);\n        canvas.lineTo(w, tier.padding);\n        canvas.lineTo(w, h + tier.padding);\n        canvas.lineTo(w - 8, h + tier.padding);\n\n        for (var t = 1; t < tics - 1; t++) {\n            var ty = t * ticSpacing;\n            canvas.moveTo(w, ty);\n            canvas.lineTo(w - 5, ty);\n        }\n    } else {\n        canvas.moveTo(8, tier.padding);\n        canvas.lineTo(0, tier.padding);\n        canvas.lineTo(0, h + tier.padding);\n        canvas.lineTo(8, h + tier.padding);\n\n        for (var _t = 1; _t < tics - 1; _t++) {\n            var _ty = _t * ticSpacing;\n            canvas.moveTo(0, _ty);\n            canvas.lineTo(5, _ty);\n        }\n    }\n    canvas.stroke();\n\n    canvas.fillStyle = 'black';\n\n    if (tier.browser.rulerLocation == 'right') {\n        canvas.textAlign = 'right';\n        canvas.fillText((0, _numformats.formatQuantLabel)(quant.max), w - 9, 8);\n        canvas.fillText((0, _numformats.formatQuantLabel)(quant.min), w - 9, h + tier.padding);\n\n        for (var _t2 = 1; _t2 < tics - 1; _t2++) {\n            var _ty2 = _t2 * ticSpacing;\n            canvas.fillText((0, _numformats.formatQuantLabel)(1.0 * quant.max - _t2 * ticInterval), w - 9, _ty2 + 3);\n        }\n    } else {\n        canvas.textAlign = 'left';\n        canvas.fillText((0, _numformats.formatQuantLabel)(quant.max), 9, 8);\n        canvas.fillText((0, _numformats.formatQuantLabel)(quant.min), 9, h + tier.padding);\n\n        for (var _t3 = 1; _t3 < tics - 1; _t3++) {\n            var _ty3 = _t3 * ticSpacing;\n            canvas.fillText((0, _numformats.formatQuantLabel)(1.0 * quant.max - _t3 * ticInterval), 9, _ty3 + 3);\n        }\n    }\n\n    canvas.restore();\n}\n\n},{\"./cigar.js\":8,\"./color.js\":9,\"./das.js\":10,\"./feature-draw.js\":20,\"./glyphs.js\":23,\"./numformats\":30,\"./sequence-draw.js\":36,\"./spans.js\":41,\"./utils.js\":56,\"ramda\":387}],12:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// domui.js: SVG UI components\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var browser = require('./cbrowser');\n    var Browser = browser.Browser;\n\n    var utils = require('./utils');\n    var makeElement = utils.makeElement;\n    var removeChildren = utils.removeChildren;\n}\n\nBrowser.prototype.removeAllPopups = function () {\n    removeChildren(this.hPopupHolder);\n    removeChildren(this.popupHolder);\n};\n\nBrowser.prototype.makeTooltip = function (ele, text) {\n    var isin = false;\n    var thisB = this;\n    var timer = null;\n    var _outlistener;\n    _outlistener = function outlistener(ev) {\n        isin = false;\n        if (timer) {\n            clearTimeout(timer);\n            timer = null;\n        }\n        ele.removeEventListener('mouseout', _outlistener, false);\n    };\n\n    var setup = function setup(ev) {\n        var mx = ev.clientX + window.scrollX,\n            my = ev.clientY + window.scrollY;\n        if (!timer) {\n            timer = setTimeout(function () {\n                var ttt;\n                if (typeof text === 'function') {\n                    ttt = text();\n                } else {\n                    ttt = text;\n                }\n\n                var popup = makeElement('div', [makeElement('div', null, { className: 'tooltip-arrow' }), makeElement('div', ttt, { className: 'tooltip-inner' })], { className: 'tooltip bottom in' }, {\n                    display: 'block',\n                    top: '' + (my + 20) + 'px',\n                    left: '' + Math.max(mx - 30, 20) + 'px'\n                });\n                thisB.hPopupHolder.appendChild(popup);\n                var _moveHandler;\n                _moveHandler = function moveHandler(ev) {\n                    try {\n                        thisB.hPopupHolder.removeChild(popup);\n                    } catch (e) {\n                        // May have been removed by other code which clears the popup layer.\n                    }\n                    window.removeEventListener('mousemove', _moveHandler, false);\n                    if (isin) {\n                        if (ele.offsetParent == null) {} else {\n                            setup(ev);\n                        }\n                    }\n                };\n                window.addEventListener('mousemove', _moveHandler, false);\n                timer = null;\n            }, 1000);\n        }\n    };\n\n    ele.addEventListener('mouseover', function (ev) {\n        isin = true;\n        ele.addEventListener('mouseout', _outlistener, false);\n        setup(ev);\n    }, false);\n    ele.addEventListener('DOMNodeRemovedFromDocument', function (ev) {\n        isin = false;\n        if (timer) {\n            clearTimeout(timer);\n            timer = null;\n        }\n    }, false);\n};\n\nBrowser.prototype.popit = function (ev, name, ele, opts) {\n    var thisB = this;\n    if (!opts) opts = {};\n    if (!ev) ev = {};\n\n    var width = opts.width || 200;\n\n    var mx, my;\n\n    if (ev.clientX) {\n        var mx = ev.clientX,\n            my = ev.clientY;\n    } else {\n        mx = 500;my = 50;\n    }\n    mx += document.documentElement.scrollLeft || document.body.scrollLeft;\n    my += document.documentElement.scrollTop || document.body.scrollTop;\n    var winWidth = window.innerWidth;\n\n    var top = my;\n    var left = Math.min(mx - width / 2 - 4, winWidth - width - 30);\n\n    var popup = makeElement('div');\n    popup.className = 'popover fade ' + (ev.clientX ? 'bottom ' : '') + 'in';\n    popup.style.display = 'block';\n    popup.style.position = 'absolute';\n    popup.style.top = '' + top + 'px';\n    popup.style.left = '' + left + 'px';\n    popup.style.width = width + 'px';\n    if (width > 276) {\n        // HACK Bootstrappification...\n        popup.style.maxWidth = width + 'px';\n    }\n\n    popup.appendChild(makeElement('div', null, { className: 'arrow' }));\n\n    if (name) {\n        var closeButton = makeElement('button', '', { className: 'close' });\n        closeButton.innerHTML = '×';\n\n        closeButton.addEventListener('mouseover', function (ev) {\n            closeButton.style.color = 'red';\n        }, false);\n        closeButton.addEventListener('mouseout', function (ev) {\n            closeButton.style.color = 'black';\n        }, false);\n        closeButton.addEventListener('click', function (ev) {\n            ev.preventDefault();ev.stopPropagation();\n            thisB.removeAllPopups();\n        }, false);\n        var tbar = makeElement('h4', [makeElement('span', name, null, { maxWidth: '200px' }), closeButton], {/*className: 'popover-title' */}, { paddingLeft: '10px', paddingRight: '10px' });\n\n        var dragOX, dragOY;\n        var moveHandler, _upHandler;\n        moveHandler = function moveHandler(ev) {\n            ev.stopPropagation();ev.preventDefault();\n            left = left + (ev.clientX - dragOX);\n            if (left < 8) {\n                left = 8;\n            }if (left > winWidth - width - 32) {\n                left = winWidth - width - 26;\n            }\n            top = top + (ev.clientY - dragOY);\n            top = Math.max(10, top);\n            popup.style.top = '' + top + 'px';\n            popup.style.left = '' + Math.min(left, winWidth - width - 10) + 'px';\n            dragOX = ev.clientX;dragOY = ev.clientY;\n        };\n        _upHandler = function upHandler(ev) {\n            ev.stopPropagation();ev.preventDefault();\n            window.removeEventListener('mousemove', moveHandler, false);\n            window.removeEventListener('mouseup', _upHandler, false);\n        };\n        tbar.addEventListener('mousedown', function (ev) {\n            ev.preventDefault();ev.stopPropagation();\n            dragOX = ev.clientX;dragOY = ev.clientY;\n            window.addEventListener('mousemove', moveHandler, false);\n            window.addEventListener('mouseup', _upHandler, false);\n        }, false);\n\n        popup.appendChild(tbar);\n    }\n\n    popup.appendChild(makeElement('div', ele, { className: 'popover-content' }, {\n        padding: '0px'\n    }));\n    this.hPopupHolder.appendChild(popup);\n\n    var popupHandle = {\n        node: popup,\n        displayed: true\n    };\n    popup.addEventListener('DOMNodeRemoved', function (ev) {\n        if (ev.target == popup) {\n            popupHandle.displayed = false;\n        }\n    }, false);\n    return popupHandle;\n};\n\nfunction makeTreeTableSection(title, content, visible) {\n    var ttButton = makeElement('i');\n    function update() {\n        if (visible) {\n            ttButton.className = 'fa fa-caret-down';\n            content.style.display = 'table';\n        } else {\n            ttButton.className = 'fa fa-caret-right';\n            content.style.display = 'none';\n        }\n    }\n    update();\n\n    ttButton.addEventListener('click', function (ev) {\n        ev.preventDefault();ev.stopPropagation();\n        visible = !visible;\n        update();\n    }, false);\n\n    var heading = makeElement('h6', [ttButton, ' ', title], {}, { display: 'block', background: 'gray', color: 'white', width: '100%', padding: '5px 2px', margin: '0px' });\n    return makeElement('div', [heading, content], {});\n}\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        makeTreeTableSection: makeTreeTableSection\n    };\n}\n\n},{\"./cbrowser\":6,\"./utils\":56}],13:[function(require,module,exports){\n/* jshint esversion: 6 */\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.drawTier = exports.renderTier = undefined;\n\nvar _defaultRenderer = require(\"./default-renderer\");\n\nvar DefaultRenderer = _interopRequireWildcard(_defaultRenderer);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nexports.renderTier = renderTier;\nexports.drawTier = drawTier;\n\n\nfunction renderTier(status, tier) {\n    drawTier(tier);\n    tier.updateStatus(status);\n}\n\nfunction drawTier(tier) {\n    var canvas = tier.viewport.getContext(\"2d\");\n    var retina = tier.browser.retina && window.devicePixelRatio > 1;\n    if (retina) {\n        canvas.scale(2, 2);\n    }\n\n    var features = tier.currentFeatures;\n    var sequence = tier.currentSequence;\n    if (tier.sequenceSource) {\n        DefaultRenderer.drawSeqTier(tier, sequence);\n    } else if (features) {\n        DefaultRenderer.prepareSubtiers(tier, canvas);\n    } else {\n        console.log(\"No sequence or features in tier!\");\n    }\n\n    if (tier.subtiers) {\n        DefaultRenderer.prepareViewport(tier, canvas, retina, true);\n    }\n\n    tier.drawOverlay();\n    tier.paintQuant();\n\n    if (typeof tier.dasSource.drawCallback === \"function\") {\n        tier.dasSource.drawCallback(canvas, tier);\n    }\n\n    tier.originHaxx = 0;\n    tier.browser.arrangeTiers();\n}\n\n},{\"./default-renderer\":11}],14:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// encode.js: interface for ENCODE DCC services\n//\n\n\"use strict\";\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\nif (typeof require !== 'undefined') {\n    var Promise = require('es6-promise').Promise;\n}\n\nfunction lookupEncodeURI(uri, json) {\n    if (uri.indexOf('?') < 0) uri = uri + '?soft=true';\n\n    return new Promise(function (accept, reject) {\n        var req = new XMLHttpRequest();\n        req.onreadystatechange = function () {\n            if (req.readyState == 4) {\n                if (req.status >= 300) {\n                    reject('Error code ' + req.status);\n                } else {\n                    var resp = JSON.parse(req.response);\n                    accept(json ? resp : resp.location);\n                }\n            }\n        };\n\n        req.open('GET', uri, true);\n        req.setRequestHeader('Accept', 'application/json');\n        req.responseType = 'text';\n        req.send();\n    });\n}\n\nfunction EncodeURLHolder(url) {\n    this.rawurl = url;\n}\n\nEncodeURLHolder.prototype.getURLPromise = function () {\n    if (this.urlPromise && this.urlPromiseValidity > Date.now()) {\n        return this.urlPromise;\n    } else {\n        this.urlPromise = lookupEncodeURI(this.rawurl, true).then(function (resp) {\n            return resp.location;\n        });\n        this.urlPromiseValidity = Date.now() + 12 * 3600 * 1000;\n        return this.urlPromise;\n    }\n};\n\nfunction EncodeFetchable(url, start, end, opts) {\n    if (!opts) {\n        if ((typeof start === 'undefined' ? 'undefined' : _typeof(start)) === 'object') {\n            opts = start;\n            start = undefined;\n        } else {\n            opts = {};\n        }\n    }\n\n    this.url = typeof url === 'string' ? new EncodeURLHolder(url) : url;\n    this.start = start || 0;\n    if (end) {\n        this.end = end;\n    }\n    this.opts = opts;\n}\n\nEncodeFetchable.prototype.slice = function (s, l) {\n    if (s < 0) {\n        throw 'Bad slice ' + s;\n    }\n\n    var ns = this.start,\n        ne = this.end;\n    if (ns && s) {\n        ns = ns + s;\n    } else {\n        ns = s || ns;\n    }\n    if (l && ns) {\n        ne = ns + l - 1;\n    } else {\n        ne = ne || l - 1;\n    }\n    return new EncodeFetchable(this.url, ns, ne, this.opts);\n};\n\nEncodeFetchable.prototype.fetchAsText = function (callback) {\n    var self = this;\n    var req = new XMLHttpRequest();\n    var length;\n    self.url.getURLPromise().then(function (url) {\n        req.open('GET', url, true);\n\n        if (self.end) {\n            if (self.end - self.start > 100000000) {\n                throw 'Monster fetch!';\n            }\n            req.setRequestHeader('Range', 'bytes=' + self.start + '-' + self.end);\n            length = self.end - self.start + 1;\n        }\n\n        req.onreadystatechange = function () {\n            if (req.readyState == 4) {\n                if (req.status == 200 || req.status == 206) {\n                    return callback(req.responseText);\n                } else {\n                    return callback(null);\n                }\n            }\n        };\n        if (self.opts.credentials) {\n            req.withCredentials = true;\n        }\n        req.send();\n    }).catch(function (err) {\n        console.log(err);\n        return callback(null);\n    });\n};\n\nEncodeFetchable.prototype.salted = function () {\n    return this;\n};\n\nEncodeFetchable.prototype.fetch = function (callback, attempt, truncatedLength) {\n    var self = this;\n\n    attempt = attempt || 1;\n    if (attempt > 3) {\n        return callback(null);\n    }\n\n    self.url.getURLPromise().then(function (url) {\n        var req = new XMLHttpRequest();\n        var length;\n        req.open('GET', url, true);\n        req.overrideMimeType('text/plain; charset=x-user-defined');\n        if (self.end) {\n            if (self.end - self.start > 100000000) {\n                throw 'Monster fetch!';\n            }\n            req.setRequestHeader('Range', 'bytes=' + self.start + '-' + self.end);\n            length = self.end - self.start + 1;\n        }\n        req.responseType = 'arraybuffer';\n        req.onreadystatechange = function () {\n            if (req.readyState == 4) {\n                if (req.status == 200 || req.status == 206) {\n                    if (req.response) {\n                        var bl = req.response.byteLength;\n                        if (length && length != bl && (!truncatedLength || bl != truncatedLength)) {\n                            return self.fetch(callback, attempt + 1, bl);\n                        } else {\n                            return callback(req.response);\n                        }\n                    } else if (req.mozResponseArrayBuffer) {\n                        return callback(req.mozResponseArrayBuffer);\n                    } else {\n                        var r = req.responseText;\n                        if (length && length != r.length && (!truncatedLength || r.length != truncatedLength)) {\n                            return self.fetch(callback, attempt + 1, r.length);\n                        } else {\n                            return callback(bstringToBuffer(req.responseText));\n                        }\n                    }\n                } else {\n                    return self.fetch(callback, attempt + 1);\n                }\n            }\n        };\n        if (self.opts.credentials) {\n            req.withCredentials = true;\n        }\n        req.send();\n    }).catch(function (err) {\n        console.log(err);\n    });\n};\n\nfunction bstringToBuffer(result) {\n    if (!result) {\n        return null;\n    }\n\n    var ba = new Uint8Array(result.length);\n    for (var i = 0; i < ba.length; ++i) {\n        ba[i] = result.charCodeAt(i);\n    }\n    return ba.buffer;\n}\n\nif (typeof module !== 'undefined') {\n    module.exports = {\n        lookupEncodeURI: lookupEncodeURI,\n        EncodeFetchable: EncodeFetchable\n    };\n}\n\n},{\"es6-promise\":384}],15:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// ensembljson.js -- query the Ensembl REST API.\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n    var sa = require('./sourceadapters');\n    var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n    var FeatureSourceBase = sa.FeatureSourceBase;\n\n    var das = require('./das');\n    var DASStylesheet = das.DASStylesheet;\n    var DASStyle = das.DASStyle;\n    var DASFeature = das.DASFeature;\n    var DASGroup = das.DASGroup;\n}\n\nfunction EnsemblFeatureSource(source) {\n    FeatureSourceBase.call(this);\n    this.source = source;\n    this.base = source.uri || '//rest.ensembl.org';\n    if (this.base.indexOf('//') === 0) {\n        var proto = window.location.protocol;\n        if (proto == 'http:' || proto == 'https:') {\n            // Protocol-relative URLs okay.\n        } else {\n            this.base = 'http:' + this.base;\n        }\n    }\n    this.species = source.species || 'human';\n\n    if (typeof source.type === 'string') {\n        this.type = [source.type];\n    } else {\n        this.type = source.type || ['regulatory'];\n    }\n}\n\nEnsemblFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\nEnsemblFeatureSource.prototype.constructor = EnsemblFeatureSource;\n\nEnsemblFeatureSource.prototype.getStyleSheet = function (callback) {\n    var stylesheet = new DASStylesheet();\n\n    var tsStyle = new DASStyle();\n    tsStyle.glyph = '__NONE';\n    if (this.type.indexOf('exon') >= 0) stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n    if (this.type.indexOf('exon') >= 0 || this.type.indexOf('transcript') >= 0) stylesheet.pushStyle({ type: 'gene' }, null, tsStyle);\n\n    var cdsStyle = new DASStyle();\n    cdsStyle.glyph = 'BOX';\n    cdsStyle.FGCOLOR = 'black';\n    cdsStyle.BGCOLOR = 'red';\n    cdsStyle.HEIGHT = 8;\n    cdsStyle.BUMP = true;\n    cdsStyle.LABEL = true;\n    cdsStyle.ZINDEX = 10;\n    stylesheet.pushStyle({ type: 'cds' }, null, cdsStyle);\n\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'SQUARE';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        // varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'blue';\n        stylesheet.pushStyle({ type: 'variation', method: '.+_UTR_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'TRIANGLE';\n        varStyle.DIRECTION = 'S';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        // varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'blue';\n        stylesheet.pushStyle({ type: 'variation', method: 'missense_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'TRIANGLE';\n        varStyle.DIRECTION = 'N';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        // varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'blue';\n        stylesheet.pushStyle({ type: 'variation', method: 'splice_.+_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'STAR';\n        varStyle.POINTS = 6;\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        // varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'blue';\n        stylesheet.pushStyle({ type: 'variation', method: 'regulatory_region_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'PLIMSOLL';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        // varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'rgb(50,80,255)';\n        varStyle.STROKECOLOR = 'black';\n        stylesheet.pushStyle({ type: 'variation' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'SQUARE';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'red';\n        stylesheet.pushStyle({ type: 'indel', method: '.+_UTR_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'TRIANGLE';\n        varStyle.DIRECTION = 'S';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'red';\n        stylesheet.pushStyle({ type: 'indel', method: 'missense_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'TRIANGLE';\n        varStyle.DIRECTION = 'N';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'red';\n        stylesheet.pushStyle({ type: 'indel', method: 'splice_.+_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'STAR';\n        varStyle.POINTS = 6;\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'red';\n        stylesheet.pushStyle({ type: 'indel', method: 'regulatory_region_variant' }, null, varStyle);\n    }\n    {\n        var varStyle = new DASStyle();\n        varStyle.glyph = 'PLIMSOLL';\n        varStyle.BUMP = 'yes';\n        varStyle.LABEL = 'no';\n        varStyle.BGCOLOR = '#888888';\n        varStyle.FGCOLOR = 'red';\n        varStyle.STROKECOLOR = 'black';\n        stylesheet.pushStyle({ type: 'indel' }, null, varStyle);\n    }\n\n    var wigStyle = new DASStyle();\n    wigStyle.glyph = 'BOX';\n    wigStyle.FGCOLOR = 'black';\n    wigStyle.BGCOLOR = 'orange';\n    wigStyle.HEIGHT = 8;\n    wigStyle.BUMP = true;\n    wigStyle.LABEL = true;\n    wigStyle.ZINDEX = 20;\n    stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n    return callback(stylesheet);\n};\n\nEnsemblFeatureSource.prototype.getScales = function () {\n    return [];\n};\n\nEnsemblFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n    var thisB = this;\n    var url = this.base + '/overlap/region/' + this.species + '/' + chr + ':' + min + '-' + max;\n\n    var filters = [];\n    for (var ti = 0; ti < this.type.length; ++ti) {\n        filters.push('feature=' + this.type[ti]);\n    }\n    filters.push('content-type=application/json');\n    url = url + '?' + filters.join(';');\n\n    var req = new XMLHttpRequest();\n    req.onreadystatechange = function () {\n        if (req.readyState == 4) {\n            thisB.busy--;\n            thisB.notifyActivity();\n\n            if (req.status >= 300) {\n                var err = 'Error code ' + req.status;\n                try {\n                    var jr = JSON.parse(req.response);\n                    if (jr.error) {\n                        err = jr.error;\n                    }\n                } catch (ex) {};\n\n                callback(err, null);\n            } else {\n                var jf = JSON.parse(req.response);\n                var features = [];\n                for (var fi = 0; fi < jf.length; ++fi) {\n                    var j = jf[fi];\n\n                    var notes = [];\n                    var f = new DASFeature();\n                    f.segment = chr;\n                    f.min = j['start'] | 0;\n                    f.max = j['end'] | 0;\n                    f.type = j.feature_type || 'unknown';\n                    f.id = j.ID;\n\n                    if (j.Parent) {\n                        var grp = new DASGroup();\n                        grp.id = j.Parent;\n                        f.groups = [grp];\n                    }\n\n                    if (j.strand) {\n                        if (j.strand < 0) f.orientation = '-';else if (j.strand > 0) f.orientation = '+';\n                    }\n\n                    if (j.consequence_type) f.method = j.consequence_type;\n\n                    if (j.alt_alleles) {\n                        notes.push('Alleles=' + j.alt_alleles.join('/'));\n                        if (j.alt_alleles.length > 1) {\n                            if (j.alt_alleles[1].length != j.alt_alleles[0].length || j.alt_alleles[1] == '-') {\n                                f.type = 'indel';\n                            }\n                        }\n                    }\n\n                    if (notes.length > 0) {\n                        f.notes = notes;\n                    }\n                    features.push(f);\n                }\n                callback(null, features);\n            }\n        }\n    };\n\n    thisB.busy++;\n    thisB.notifyActivity();\n\n    req.open('GET', url, true);\n    req.responseType = 'text';\n    req.send();\n};\n\nEnsemblFeatureSource.prototype.capabilities = function () {\n    var caps = {};\n    if (this.type && this.type.indexOf('transcript') >= 0) {\n        caps.search = ['gene'];\n    }\n    return caps;\n};\n\nEnsemblFeatureSource.prototype.search = function (query, callback) {\n    var url = this.base + '/lookup/symbol/' + this.species + '/' + query + '?content-type=application/json';\n    var req = new XMLHttpRequest();\n    req.onreadystatechange = function () {\n        if (req.readyState == 4) if (req.status >= 300 || req.status < 200) {\n            var err = 'Error code ' + req.status;\n            try {\n                var jr = JSON.parse(req.response);\n                if (jr.error) {\n                    err = jr.error;\n                }\n            } catch (ex) {};\n\n            if (req.status == 400) // E! returns an error if the lookup fails.  Who knows?\n                return callback([]);else return callback(null, err);\n        } else {\n            var resp = JSON.parse(req.response);\n            var result = [];\n\n            if (resp && resp.seq_region_name) {\n                result.push({\n                    segment: resp.seq_region_name,\n                    min: resp.start,\n                    max: resp.end\n                });\n            }\n\n            return callback(result);\n        }\n    };\n\n    req.open('GET', url, true);\n    req.responseType = 'text';\n    req.send();\n};\n\ndalliance_registerSourceAdapterFactory('ensembl', function (source) {\n    return { features: new EnsemblFeatureSource(source) };\n});\n\n},{\"./das\":10,\"./sourceadapters\":39}],16:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-config.js\n//\n\nif (typeof require !== 'undefined') {\n    var browser = require('./cbrowser');\n    var Browser = browser.Browser;\n\n    var utils = require('./utils');\n    var shallowCopy = utils.shallowCopy;\n\n    var sha1 = require('./sha1');\n    var hex_sha1 = sha1.hex_sha1;\n\n    var das = require('./das');\n    var copyStylesheet = das.copyStylesheet;\n}\n\nBrowser.prototype.exportFullConfig = function (opts) {\n    opts = opts || {};\n\n    var config = {\n        chr: this.chr,\n        viewStart: this.viewStart | 0,\n        viewEnd: this.viewEnd | 0,\n        cookieKey: 'dalliance_' + hex_sha1(Date.now()),\n\n        coordSystem: this.coordSystem,\n\n        sources: this.exportSourceConfig(),\n\n        chains: this.exportChains()\n    };\n\n    if (this.prefix) config.prefix = this.prefix;\n\n    return config;\n};\n\nBrowser.prototype.exportChains = function () {\n    var cc = {};\n    var cs = this.chains || {};\n    for (var k in cs) {\n        cc[k] = cs[k].exportConfig();\n    }\n    return cc;\n};\n\nBrowser.prototype.exportSourceConfig = function (opts) {\n    opts = opts || {};\n\n    var sourceConfig = [];\n    for (var ti = 0; ti < this.tiers.length; ++ti) {\n        var tier = this.tiers[ti];\n        var source = shallowCopy(tier.dasSource);\n\n        if (source.noPersist) continue;\n\n        source.coords = undefined;\n        source.props = undefined;\n        if (!source.disabled) source.disabled = undefined;\n\n        if (tier.config.stylesheet) {\n            source.style = copyStylesheet(tier.config.stylesheet).styles;\n            source.stylesheet_uri = undefined;\n        } else if (source.style) {\n            source.style = copyStylesheet({ styles: source.style }).styles;\n        }\n\n        if (typeof tier.config.name === 'string') {\n            source.name = tier.config.name;\n        }\n\n        if (tier.config.height !== undefined) {\n            source.forceHeight = tier.config.height;\n        }\n        if (tier.config.forceMin !== undefined) {\n            source.forceMin = tier.config.forceMin;\n        }\n        if (tier.config.forceMinDynamic) source.forceMinDynamic = tier.config.forceMinDynamic;\n        if (tier.config.forceMax !== undefined) {\n            source.forceMax = tier.config.forceMax;\n        }\n        if (tier.config.bumped !== undefined) {\n            source.bumped = tier.config.bumped;\n        }\n        if (tier.config.forceMaxDynamic) source.forceMaxDynamic = tier.config.forceMaxDynamic;\n\n        sourceConfig.push(source);\n    }\n\n    return sourceConfig;\n};\n\nBrowser.prototype.exportPageTemplate = function (opts) {\n    opts = opts || {};\n    var template = '\\n' + '  \\n' + '    \\n' + '    \\n' + '  \\n' + '  \\n' + '    
Dalliance goes here
\\n' + ' \\n' + '\\n';\n\n return template;\n};\n\n},{\"./cbrowser\":6,\"./das\":10,\"./sha1\":38,\"./utils\":56}],17:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-image.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var g = require('./glyphs');\n var OverlayLabelCanvas = g.OverlayLabelCanvas;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n var formatLongInt = nf.formatLongInt;\n\n var VERSION = require('./version');\n\n var drawSeqTierGC = require('./sequence-draw').drawSeqTierGC;\n}\n\nfunction fillTextRightJustified(g, text, x, y) {\n g.fillText(text, x - g.measureText(text).width, y);\n}\n\nBrowser.prototype.exportImage = function (opts) {\n opts = opts || {};\n\n var fpw = opts.width || this.featurePanelWidth;\n var padding = 3;\n var ypos = 0;\n if (opts.banner || opts.region) {\n ypos = 40;\n }\n\n var backupFPW = this.featurePanelWidth;\n var backupScale = this.scale;\n this.featurePanelWidth = fpw;\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n\n var totHeight = ypos;\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (ti > 0) totHeight += padding;\n var tier = this.tiers[ti];\n\n tier.backupSubtiers = tier.subtiers;\n tier.backupOriginHaxx = tier.originHaxx;\n tier.backupLayoutHeight = tier.layoutHeight;\n\n if (tier.subtiers) {\n var renderer = this.getTierRenderer(tier);\n if (renderer && renderer.prepareSubtiers) {\n renderer.prepareSubtiers(tier, tier.viewport.getContext('2d'));\n }\n\n if (tier.subtiers) {\n var lh = tier.padding;\n for (var s = 0; s < tier.subtiers.length; ++s) {\n lh = lh + tier.subtiers[s].height + tier.padding;\n }\n lh += 6;\n tier.layoutHeight = Math.max(lh, this.minTierHeight);\n }\n }\n\n if (tier.layoutHeight !== undefined) totHeight += tier.layoutHeight;\n }\n var mult = opts.resolutionMultiplier || 1.0;\n var margin = 200;\n\n var cw = (fpw + margin) * mult | 0;\n var ch = totHeight * mult | 0;\n var c = makeElement('canvas', null, { width: cw, height: ch });\n var g = c.getContext('2d');\n g.fillStyle = 'white';\n g.fillRect(0, 0, cw, ch);\n\n g.scale(mult, mult);\n\n if (opts.region) {\n g.save();\n g.fillStyle = 'black';\n g.font = '12pt sans-serif';\n g.fillText(this.chr + ':' + formatLongInt(this.viewStart) + '..' + formatLongInt(this.viewEnd), margin + 100, 28);\n g.restore();\n }\n\n if (opts.banner) {\n g.save();\n g.fillStyle = 'black';\n g.font = '12pt sans-serif';\n fillTextRightJustified(g, 'Graphics from Biodalliance ' + VERSION, margin + fpw - 100, 28);\n g.restore();\n }\n\n g.font = '10px sans-serif';\n\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var tier = this.tiers[ti];\n var offset = (tier.glyphCacheOrigin - this.viewStart) * this.scale;\n\n var oc = new OverlayLabelCanvas();\n g.save(); // 1\n g.translate(0, ypos);\n\n g.save(); // 2\n g.beginPath();\n g.moveTo(margin, 0);\n g.lineTo(margin + fpw, 0);\n g.lineTo(margin + fpw, tier.layoutHeight);\n g.lineTo(margin, tier.layoutHeight);\n g.closePath();\n g.clip();\n g.translate(margin, 0);\n\n g.save(); // 3\n g.translate(offset, 0);\n if (tier.subtiers) {\n tier.paintToContext(g, oc, offset + 1000);\n } else {\n drawSeqTierGC(tier, tier.currentSequence, g);\n }\n g.restore(); // 2\n\n g.save(); // 3\n g.translate(offset, 0);\n oc.draw(g, -offset, fpw - offset);\n g.restore(); // 2\n g.restore(); // 1\n\n var hasQuant = false;\n var pos = 0;\n var subtiers = tier.subtiers || [];\n for (var sti = 0; sti < subtiers.length; ++sti) {\n var subtier = subtiers[sti];\n\n if (subtier.quant) {\n hasQuant = true;\n var q = subtier.quant;\n var h = subtier.height;\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + (h / 20 | 0);\n }\n var ticSpacing = h / (numTics - 1);\n var ticInterval = (q.max - q.min) / (numTics - 1);\n\n g.beginPath();\n g.moveTo(margin + 5, pos);\n g.lineTo(margin, pos);\n g.lineTo(margin, pos + subtier.height);\n g.lineTo(margin + 5, pos + subtier.height);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n g.moveTo(margin, pos + ty);\n g.lineTo(margin + 3, pos + ty);\n }\n g.strokeStyle = 'black';\n g.strokeWidth = 2;\n g.stroke();\n\n g.fillStyle = 'black';\n fillTextRightJustified(g, formatQuantLabel(q.max), margin - 3, pos + 7);\n fillTextRightJustified(g, formatQuantLabel(q.min), margin - 3, pos + subtier.height);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n fillTextRightJustified(g, formatQuantLabel(1.0 * q.max - t * ticInterval), margin - 3, pos + ty + 3);\n }\n }\n\n pos += subtier.height + padding;\n }\n\n var labelName;\n if (typeof tier.config.name === 'string') labelName = tier.config.name;else labelName = tier.dasSource.name;\n var labelWidth = g.measureText(labelName).width;\n g.fillStyle = 'black';\n g.fillText(labelName, margin - (hasQuant ? 28 : 12) - labelWidth, (tier.layoutHeight + 3) / 2);\n\n g.restore(); // 0\n\n ypos += tier.layoutHeight + padding;\n\n tier.subtiers = tier.backupSubtiers;\n tier.originHaxx = tier.backupOriginHaxx;\n tier.layoutHeight = tier.backupLayoutHeight;\n }\n\n if (opts.highlights) {\n g.save();\n\n g.beginPath();\n g.moveTo(margin, 0);\n g.lineTo(margin + fpw, 0);\n g.lineTo(margin + fpw, ypos);\n g.lineTo(margin, ypos);\n g.closePath();\n g.clip();\n\n g.translate(margin + offset, 0);\n var origin = this.viewStart;\n var visStart = this.viewStart;\n var visEnd = this.viewEnd;\n\n for (var hi = 0; hi < this.highlights.length; ++hi) {\n var h = this.highlights[hi];\n if ((h.chr === this.chr || h.chr === 'chr' + this.chr) && h.min < visEnd && h.max > visStart) {\n g.globalAlpha = this.defaultHighlightAlpha;\n g.fillStyle = this.defaultHighlightFill;\n g.fillRect((h.min - origin) * this.scale, 0, (h.max - h.min) * this.scale, ypos);\n }\n }\n g.restore();\n }\n\n var rulerPos = -1;\n if (opts.ruler == 'center') {\n rulerPos = margin + (this.viewEnd - this.viewStart + 1) * this.scale / 2;\n } else if (opts.ruler == 'left') {\n rulerPos = margin;\n } else if (opts.ruler == 'right') {\n rulerPos = margin + (this.viewEnd - this.viewStart + 1) * this.scale;\n }\n if (rulerPos >= 0) {\n g.strokeStyle = 'blue';\n g.beginPath();\n g.moveTo(rulerPos, 0);\n g.lineTo(rulerPos, ypos);\n g.stroke();\n }\n\n this.featurePanelWidth = backupFPW;\n this.scale = backupScale;\n\n return c.toDataURL('image/png');\n};\n\n},{\"./cbrowser\":6,\"./glyphs\":23,\"./numformats\":30,\"./sequence-draw\":36,\"./version\":58}],18:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-ui.js\n//\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n}\n\nBrowser.prototype.openExportPanel = function () {\n var b = this;\n if (this.uiMode === 'export') {\n this.hideToolPanel();\n this.setUiMode('none');\n } else {\n var exportForm = makeElement('div', null, { className: 'export-form' });\n var exportSelect = makeElement('select');\n exportSelect.appendChild(makeElement('option', 'SVG', { value: 'svg' }));\n exportSelect.appendChild(makeElement('option', 'Image', { value: 'png' }));\n exportSelect.appendChild(makeElement('option', 'Dalliance config', { value: 'config' }));\n exportSelect.appendChild(makeElement('option', 'Dalliance sources', { value: 'sources' }));\n exportSelect.appendChild(makeElement('option', 'Dalliance page', { value: 'page' }));\n exportSelect.value = 'svg';\n\n exportSelect.addEventListener('change', function (ev) {\n removeChildren(exportContent);\n setupEOT();\n }, false);\n exportForm.appendChild(makeElement('p', ['Export as: ', exportSelect]));\n\n var exportHighlightsToggle = makeElement('input', null, { type: 'checkbox', checked: this.exportHighlights });\n exportHighlightsToggle.addEventListener('change', function (ev) {\n b.exportHighlights = exportHighlightsToggle.checked;\n b.storeStatus();\n }, false);\n var exportRulerToggle = makeElement('input', null, { type: 'checkbox', checked: this.exportRuler });\n exportRulerToggle.addEventListener('change', function (ev) {\n b.exportRuler = exportRulerToggle.checked;\n b.storeStatus();\n }, false);\n var exportRegionToggle = makeElement('input', null, { type: 'checkbox', checked: this.exportRegion });\n exportRegionToggle.addEventListener('change', function (ev) {\n b.exportRegion = exportRegionToggle.checked;\n b.storeStatus();\n }, false);\n var exportBannerToggle = makeElement('input', null, { type: 'checkbox', checked: this.exportBanner });\n exportBannerToggle.addEventListener('change', function (ev) {\n b.exportBanner = exportBannerToggle.checked;\n b.storeStatus();\n }, false);\n var exportScale = makeElement('input', null, { type: 'text', value: '1.0' });\n var exportWidth = makeElement('input', null, { type: 'text', value: '800' });\n\n var exportButton = makeElement('button', 'Export', { className: 'btn btn-primary' });\n exportButton.addEventListener('click', function (ev) {\n removeChildren(exportContent);\n\n var blobURL;\n var note, type, name;\n if (exportSelect.value === 'svg') {\n blobURL = URL.createObjectURL(b.makeSVG({ highlights: exportHighlightsToggle.checked,\n banner: b.exportBanner,\n region: b.exportRegion,\n ruler: exportRulerToggle.checked ? b.rulerLocation : 'none',\n width: parseInt(exportWidth.value) || 800 }));\n note = 'SVG';\n type = 'image/svg';\n name = 'dalliance-view.svg';\n } else if (exportSelect.value === 'png') {\n var mult = parseFloat(exportScale.value);\n if (mult < 0.1 || mult > 10) {\n alert('bad scale ' + mult);\n return;\n }\n\n blobURL = b.exportImage({ highlights: exportHighlightsToggle.checked,\n banner: b.exportBanner,\n region: b.exportRegion,\n ruler: exportRulerToggle.checked ? b.rulerLocation : 'none',\n resolutionMultiplier: mult,\n width: parseInt(exportWidth.value) || 800 });\n note = 'Image';\n type = 'image/png';\n name = 'dalliance-view.png';\n } else if (exportSelect.value === 'config') {\n var config = JSON.stringify(b.exportFullConfig(), null, 2);\n var blob = new Blob([config], { type: 'text/plain' });\n blobURL = URL.createObjectURL(blob);\n note = 'Configuration';\n type = 'text/plain';\n name = 'dalliance-config.json';\n } else if (exportSelect.value === 'sources') {\n var config = JSON.stringify(b.exportSourceConfig(), null, 2);\n var blob = new Blob([config], { type: 'text/plain' });\n blobURL = URL.createObjectURL(blob);\n note = 'Source array';\n type = 'text/plain';\n name = 'dalliance-sources.json';\n } else if (exportSelect.value === 'page') {\n var page = b.exportPageTemplate();\n var type = 'text/html';\n var blob = new Blob([page], { type: type });\n blobURL = URL.createObjectURL(blob);\n note = 'Page template';\n name = 'dalliance-view.html';\n }\n\n if (blobURL) {\n var downloadLink = makeElement('a', '[Download]', {\n href: blobURL,\n download: name,\n type: type\n });\n\n var previewLink = makeElement('a', '[Preview in browser]', {\n href: blobURL,\n type: type,\n target: '_new'\n });\n\n exportContent.appendChild(makeElement('p', ['' + note + ' created: ', downloadLink, previewLink]));\n }\n }, false);\n\n b.addViewListener(function () {\n removeChildren(exportContent);\n });\n b.addTierListener(function () {\n removeChildren(exportContent);\n });\n\n var exportContent = makeElement('p', '');\n\n var eotHighlights = makeElement('tr', [makeElement('th', 'Include highlights', {}, { width: '400px', textAlign: 'right' }), makeElement('td', exportHighlightsToggle)]);\n var eotGuideline = makeElement('tr', [makeElement('th', 'Include vertical guideline', {}, { textAlign: 'right' }), makeElement('td', exportRulerToggle)]);\n var eotScale = makeElement('tr', [makeElement('th', 'Scale multiplier', {}, { textAlign: 'right' }), makeElement('td', exportScale)]);\n var eotWidth = makeElement('tr', [makeElement('th', 'Width (logical px)', {}, { textAlign: 'right' }), makeElement('td', exportWidth)]);\n var eotRegion = makeElement('tr', [makeElement('th', 'Label with genomic coordinates', {}, { textAlign: 'right' }), makeElement('td', exportRegionToggle)]);\n var eotBanner = makeElement('tr', [makeElement('th', 'Include banner', {}, { textAlign: 'right' }), makeElement('td', exportBannerToggle)]);\n\n var exportOptsTable = makeElement('table', [eotHighlights, eotGuideline, eotWidth, eotScale, eotRegion], null, { width: '500px' });\n var setupEOT = function setupEOT() {\n var es = exportSelect.value;\n eotHighlights.style.display = es == 'svg' || es == 'png' ? 'table-row' : 'none';\n eotGuideline.style.display = es == 'svg' || es == 'png' ? 'table-row' : 'none';\n eotScale.style.display = es == 'png' ? 'table-row' : 'none';\n eotWidth.style.display = es == 'svg' || es == 'png' ? 'table-row' : 'none';\n eotRegion.style.display = es == 'svg' || es == 'png' ? 'table-row' : 'none';\n eotBanner.style.display = es == 'svg' || es == 'png' ? 'table-row' : 'none';\n };\n setupEOT();\n\n exportForm.appendChild(exportOptsTable);\n exportForm.appendChild(exportButton);\n exportForm.appendChild(exportContent);\n\n if (this.uiMode !== 'none') this.hideToolPanel();\n this.browserHolder.insertBefore(exportForm, this.svgHolder);\n this.activeToolPanel = exportForm;\n\n this.setUiMode('export');\n }\n};\n\n},{\"./cbrowser\":6,\"./utils\":56}],19:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// exports.js: shim to export symbols into global namespace for ease of embedding\n//\n\nrequire('babel-polyfill');\nvar browser = require('./cbrowser');\nvar chainset = require('./chainset');\nvar sa = require('./sourceadapters');\nvar utils = require('./utils');\nvar das = require('./das');\nvar sc = require('./sourcecompare');\n\nwindow.Browser = browser.Browser;\nwindow.sourcesAreEqual = sc.sourcesAreEqual;\nwindow.Chainset = chainset.Chainset; // Pre-0.12 configurations need this.\n\n// Useful for info plugins. Should be reconsidered in the future.\nwindow.makeElement = utils.makeElement;\n\n// Allow source plugins to be loaded separately.\nwindow.dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\nwindow.dalliance_registerParserFactory = sa.registerParserFactory;\nwindow.dalliance_makeParser = sa.makeParser;\n\n// DAS* objects for some plugins -- remove when plugin API changes...\n\nwindow.DASSequence = das.DASSequence;\nwindow.DASFeature = das.DASFeature;\nwindow.DASGroup = das.DASGroup;\nwindow.DASStylesheet = das.DASStylesheet;\nwindow.DASStyle = das.DASStyle;\nwindow.DASSource = das.DASSource; // Pre-0.8 configurations used this. Still some around...\n\nvar ruler = require(\"./rulers\");\nwindow.Ruler = ruler.Ruler;\nwindow.rulerDrawCallback = ruler.rulerDrawCallback;\n\n},{\"./cbrowser\":6,\"./chainset\":7,\"./das\":10,\"./rulers\":33,\"./sourceadapters\":39,\"./sourcecompare\":40,\"./utils\":56,\"babel-polyfill\":60}],20:[function(require,module,exports){\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// feature-draw.js: new feature-tier renderer\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var tier = require('./tier');\n var DasTier = tier.DasTier;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n}\n\nfunction SubTier() {\n this.glyphs = [];\n this.height = 0;\n this.quant = null;\n}\n\nSubTier.prototype.indexFor = function (glyph) {\n var gmin = glyph.min();\n var lb = 0,\n ub = this.glyphs.length;\n while (ub > lb) {\n var mid = (lb + ub) / 2 | 0;\n if (mid >= this.glyphs.length) return this.glyphs.length;\n var mg = this.glyphs[mid];\n if (gmin < mg.min()) {\n ub = mid;\n } else {\n lb = mid + 1;\n }\n }\n return ub;\n};\n\nSubTier.prototype.add = function (glyph) {\n var ind = this.indexFor(glyph);\n this.glyphs.splice(ind, 0, glyph);\n this.height = Math.max(this.height, glyph.height());\n if (glyph.quant && this.quant == null) {\n this.quant = glyph.quant;\n }\n};\n\nSubTier.prototype.hasSpaceFor = function (glyph) {\n var ind = this.indexFor(glyph);\n if (ind > 0 && this.glyphs[ind - 1].max() >= glyph.min()) return false;\n if (ind < this.glyphs.length && this.glyphs[ind].min() <= glyph.max()) return false;\n\n return true;\n};\n\nDasTier.prototype.paintToContext = function (gc, oc, offset) {\n var subtiers = this.subtiers;\n var fpw = this.viewport.width | 0;\n\n gc.save();\n for (var s = 0; s < subtiers.length; ++s) {\n var quant = null;\n var glyphs = subtiers[s].glyphs;\n for (var i = 0; i < glyphs.length; ++i) {\n var glyph = glyphs[i];\n if (glyph.min() < fpw - offset && glyph.max() > -offset) {\n var glyph = glyphs[i];\n glyph.draw(gc, oc);\n if (glyph.quant) {\n quant = glyph.quant;\n }\n }\n }\n\n if (quant && quant.min < 0 && quant.max > 0 && this.dasSource.zeroLine) {\n var ry = subtiers[0].height * (quant.max / (quant.max - quant.min));\n gc.save();\n gc.strokeStyle = this.dasSource.zeroLine;\n gc.lineWidth = 0.5;\n gc.beginPath();\n gc.moveTo(-1000, ry);\n gc.lineTo(fpw + 1000, ry);\n gc.stroke();\n gc.restore();\n }\n\n if (this.scaleVertical) {\n var scale = this.browser.scale;\n gc.translate(0, scale + this.padding);\n oc.translate(0, scale + this.padding);\n } else {\n gc.translate(0, subtiers[s].height + this.padding);\n oc.translate(0, subtiers[s].height + this.padding);\n }\n }\n gc.restore();\n\n if (quant && this.quantLeapThreshold && this.featureSource && this.browser.sourceAdapterIsCapable(this.featureSource, 'quantLeap')) {\n var ry = subtiers[0].height * (1.0 - (this.quantLeapThreshold - quant.min) / (quant.max - quant.min));\n\n gc.save();\n gc.strokeStyle = 'red';\n gc.lineWidth = 0.3;\n gc.beginPath();\n gc.moveTo(-1000, ry);\n gc.lineTo(fpw + 1000, ry);\n gc.stroke();\n gc.restore();\n }\n};\n\nDasTier.prototype.paintQuant = function () {\n if (!this.quantOverlay) return;\n\n var retina = this.browser.retina && window.devicePixelRatio > 1;\n\n var quant;\n if (this.subtiers && this.subtiers.length > 0) quant = this.subtiers[0].quant;\n\n if (quant) {\n var h = this.subtiers[0].height;\n var w = 50;\n this.quantOverlay.height = this.viewport.height;\n this.quantOverlay.width = retina ? w * 2 : w;\n this.quantOverlay.style.height = '' + (retina ? this.quantOverlay.height / 2 : this.quantOverlay.height) + 'px';\n this.quantOverlay.style.width = '' + w + 'px';\n this.quantOverlay.style.display = 'block';\n var ctx = this.quantOverlay.getContext('2d');\n if (retina) ctx.scale(2, 2);\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + (h / 20 | 0);\n }\n var ticSpacing = (h + this.padding * 2) / (numTics - 1);\n var ticInterval = (quant.max - quant.min) / (numTics - 1);\n\n ctx.fillStyle = 'white';\n ctx.globalAlpha = 0.6;\n if (this.browser.rulerLocation == 'right') {\n ctx.fillRect(w - 30, 0, 30, h + this.padding * 2);\n } else {\n ctx.fillRect(0, 0, 30, h + this.padding * 2);\n }\n ctx.globalAlpha = 1.0;\n\n ctx.strokeStyle = 'black';\n ctx.lineWidth = 1;\n ctx.beginPath();\n\n if (this.browser.rulerLocation == 'right') {\n ctx.moveTo(w - 8, this.padding);\n ctx.lineTo(w, this.padding);\n ctx.lineTo(w, h + this.padding);\n ctx.lineTo(w - 8, h + this.padding);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n ctx.moveTo(w, ty);\n ctx.lineTo(w - 5, ty);\n }\n } else {\n ctx.moveTo(8, this.padding);\n ctx.lineTo(0, this.padding);\n ctx.lineTo(0, h + this.padding);\n ctx.lineTo(8, h + this.padding);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n ctx.moveTo(0, ty);\n ctx.lineTo(5, ty);\n }\n }\n ctx.stroke();\n\n ctx.fillStyle = 'black';\n\n if (this.browser.rulerLocation == 'right') {\n ctx.textAlign = 'right';\n ctx.fillText(formatQuantLabel(quant.max), w - 9, 8);\n ctx.fillText(formatQuantLabel(quant.min), w - 9, h + this.padding);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n ctx.fillText(formatQuantLabel(1.0 * quant.max - t * ticInterval), w - 9, ty + 3);\n }\n } else {\n ctx.textAlign = 'left';\n ctx.fillText(formatQuantLabel(quant.max), 9, 8);\n ctx.fillText(formatQuantLabel(quant.min), 9, h + this.padding);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n ctx.fillText(formatQuantLabel(1.0 * quant.max - t * ticInterval), 9, ty + 3);\n }\n }\n } else {\n this.quantOverlay.style.display = 'none';\n }\n};\n\nDasTier.prototype.styleForFeature = function (f) {\n var ssScale = this.browser.zoomForCurrentScale();\n\n if (!this.stylesheet) {\n return null;\n }\n\n var maybe = null;\n var ss = this.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n\n if (sh.orientation) {\n if (sh.orientation != f.orientation) {\n continue;\n }\n }\n\n var labelRE = sh._labelRE;\n if (!labelRE || !labelRE.test) {\n labelRE = new RegExp('^' + sh.label + '$');\n sh._labelRE = labelRE;\n }\n if (sh.label && !labelRE.test(f.label)) {\n continue;\n }\n var methodRE = sh._methodRE;\n if (!methodRE || !methodRE.test) {\n methodRE = new RegExp('^' + sh.method + '$');\n sh._methodRE = methodRE;\n }\n if (sh.method && !methodRE.test(f.method)) {\n continue;\n }\n if (sh.type) {\n if (sh.type == 'default') {\n if (!maybe) {\n maybe = sh.style;\n }\n continue;\n } else {\n var typeRE = sh._typeRE;\n if (!typeRE || !typeRE.test) {\n typeRE = new RegExp('^' + sh.type + '$');\n sh._typeRE = typeRE;\n }\n if (!typeRE.test(f.type)) continue;\n }\n }\n return sh.style;\n }\n return maybe;\n};\n\nDasTier.prototype.quantMin = function (style) {\n if (this.forceMinDynamic) {\n return this.currentFeaturesMinScore || 0;\n } else if (typeof this.forceMin === 'number') {\n return this.forceMin;\n } else {\n var softMin = typeof style.SOFTMIN !== 'undefined' ? style.SOFTMIN : Number.MAX_VALUE;\n return style.MIN || Math.min(softMin, this.currentFeaturesMinScore || 0);\n }\n};\n\nDasTier.prototype.quantMax = function (style) {\n if (this.forceMaxDynamic) {\n return this.currentFeaturesMaxScore || 0;\n } else if (typeof this.forceMax === 'number') {\n return this.forceMax;\n } else {\n var softMax = typeof style.SOFTMAX !== 'undefined' ? style.SOFTMAX : Number.MIN_VALUE;\n return style.MAX || Math.max(softMax, this.currentFeaturesMaxScore || 0);\n }\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n SubTier: SubTier\n };\n}\n\n},{\"./numformats\":30,\"./tier\":52}],21:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// feature-popup.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var pick = utils.pick;\n var pushnew = utils.pushnew;\n var makeElement = utils.makeElement;\n}\n\nvar TAGVAL_NOTE_RE = new RegExp('^([A-Za-z_-]+)=(.+)');\n\nBrowser.prototype.addFeatureInfoPlugin = function (handler) {\n if (!this.featureInfoPlugins) {\n this.featureInfoPlugins = [];\n }\n this.featureInfoPlugins.push(handler);\n};\n\nfunction FeatureInfo(hit, feature, group) {\n var name = pick(group.type, feature.type);\n var fid = pick(group.label, feature.label, group.id, feature.id);\n if (!hit[0].molgenis && fid && fid.indexOf('__dazzle') != 0) {\n name = name + ': ' + fid;\n }\n\n this.hit = hit;\n this.feature = feature;\n this.group = group;\n this.title = hit[0].molgenis ? feature.id : name;\n this.sections = [];\n}\n\nFeatureInfo.prototype.setTitle = function (t) {\n this.title = t;\n};\n\nFeatureInfo.prototype.add = function (label, info) {\n if (typeof info === 'string') {\n info = makeElement('span', info);\n }\n this.sections.push({ label: label, info: info });\n};\n\nBrowser.prototype.featurePopup = function (ev, __ignored_feature, hit, tier) {\n var hi = hit.length;\n var feature = --hi >= 0 ? hit[hi] : {};\n var group = --hi >= 0 ? hit[hi] : {};\n\n var featureInfo = new FeatureInfo(hit, feature, group);\n featureInfo.tier = tier;\n var fips = this.featureInfoPlugins || [];\n for (var fipi = 0; fipi < fips.length; ++fipi) {\n try {\n fips[fipi](feature, featureInfo);\n } catch (e) {\n console.log(e.stack || e);\n }\n }\n fips = tier.featureInfoPlugins || [];\n for (fipi = 0; fipi < fips.length; ++fipi) {\n try {\n fips[fipi](feature, featureInfo);\n } catch (e) {\n console.log(e.stack || e);\n }\n }\n\n this.removeAllPopups();\n\n var table = makeElement('table', null, { className: 'table table-striped table-condensed' });\n table.style.width = '100%';\n table.style.margin = '0px';\n\n var idx = 0;\n if (feature.method && !tier.dasSource.suppressMethod) {\n var row = makeElement('tr', [makeElement('th', 'Method'), makeElement('td', feature.method)]);\n table.appendChild(row);\n ++idx;\n }\n {\n var loc;\n if (group.segment) {\n loc = group;\n } else {\n loc = feature;\n }\n var row = makeElement('tr', [makeElement('th', 'Location'), makeElement('td', loc.segment + ':' + loc.min + '-' + loc.max, {}, { minWidth: '200px' })]);\n table.appendChild(row);\n ++idx;\n }\n if (feature.score !== undefined && feature.score !== null && feature.score != '-' && !feature.suppressScore && !tier.dasSource.suppressScore) {\n var row = makeElement('tr', [makeElement('th', 'Score'), makeElement('td', '' + feature.score)]);\n table.appendChild(row);\n ++idx;\n }\n {\n var links = maybeConcat(group.links, feature.links);\n if (links && links.length > 0) {\n var row = makeElement('tr', [makeElement('th', 'Links'), makeElement('td', links.map(function (l) {\n return makeElement('div', makeElement('a', l.desc, { href: l.uri, target: '_new' }));\n }))]);\n table.appendChild(row);\n ++idx;\n }\n }\n {\n var notes = maybeConcat(group.notes, feature.notes);\n for (var ni = 0; ni < notes.length; ++ni) {\n var k = 'Note';\n var v = notes[ni];\n //---START MOLGENIS CUSTOM CODE---\n //params: do not rename, because this will make merging with dalliance changes harder\n //v is note\n //m is splitted note into array [key,value]\n //k is key\n //v is value\n if (hit[0].molgenis) {\n var m = v.split(\"=\");\n if (m.length === 2) {\n k = m[0];\n v = m[1];\n }\n }\n //---END MOLGENIS CUSTOM CODE---\n\n var row = makeElement('tr', [makeElement('th', k), makeElement('td', v)]);\n table.appendChild(row);\n ++idx;\n }\n }\n\n for (var fisi = 0; fisi < featureInfo.sections.length; ++fisi) {\n var section = featureInfo.sections[fisi];\n table.appendChild(makeElement('tr', [makeElement('th', section.label), makeElement('td', section.info)]));\n }\n //---START MOLGENIS CUSTOM CODE---\n if (hit[0].molgenis) {\n if (feature.actions) {\n var _loop = function _loop() {\n var action = feature.actions[index];\n var actionItem = makeElement('a', action.label);\n\n actionItem.addEventListener('click', function (ev) {\n eval(action.run);\n }, false);\n\n table.appendChild(makeElement('tr', [makeElement('th', \"\"), makeElement('td', actionItem)]));\n };\n\n for (var index = 0; index < feature.actions.length; ++index) {\n _loop();\n }\n }\n }\n //---END MOLGENIS CUSTOM CODE---\n this.popit(ev, featureInfo.title || 'Feature', table, { width: 450 });\n};\n\nfunction maybeConcat(a, b) {\n var l = [];\n if (a) {\n for (var i = 0; i < a.length; ++i) {\n pushnew(l, a[i]);\n }\n }\n if (b) {\n for (var i = 0; i < b.length; ++i) {\n pushnew(l, b[i]);\n }\n }\n return l;\n}\n\n},{\"./cbrowser\":6,\"./utils\":56}],22:[function(require,module,exports){\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var pusho = utils.pusho;\n var pushnewo = utils.pushnewo;\n}\n\nfunction sortFeatures(tier) {\n var dmin = tier.browser.drawnStart,\n dmax = tier.browser.drawnEnd;\n var ungroupedFeatures = {};\n var groupedFeatures = {};\n var drawnGroupedFeatures = {};\n var groupMins = {},\n groupMaxes = {};\n var groups = {};\n var superGroups = {};\n var groupsToSupers = {};\n var nonPositional = [];\n var minScore, maxScore;\n var fbid;\n\n var init_fbid = function init_fbid() {\n fbid = {};\n for (var fi = 0; fi < tier.currentFeatures.length; ++fi) {\n var f = tier.currentFeatures[fi];\n if (f.id) {\n fbid[f.id] = f;\n }\n }\n };\n\n var superParentsOf = function superParentsOf(f) {\n // FIXME: should recur.\n var spids = [];\n if (f.parents) {\n for (var pi = 0; pi < f.parents.length; ++pi) {\n var pid = f.parents[pi];\n var p = fbid[pid];\n if (!p) {\n continue;\n }\n // alert(p.type + ':' + p.typeCv);\n if (p.typeCv == 'SO:0000704') {\n pushnew(spids, pid);\n }\n }\n }\n return spids;\n };\n\n for (var fi = 0; fi < tier.currentFeatures.length; ++fi) {\n var f = tier.currentFeatures[fi];\n if (f.parts) {\n continue;\n }\n\n var drawn = f.min <= dmax && f.max >= dmin;\n\n if (!f.min || !f.max) {\n nonPositional.push(f);\n continue;\n }\n\n if (f.score && f.score != '.' && f.score != '-') {\n var sc = 1.0 * f.score;\n if (!minScore || sc < minScore) {\n minScore = sc;\n }\n if (!maxScore || sc > maxScore) {\n maxScore = sc;\n }\n }\n\n var fGroups = [];\n var fSuperGroup = null;\n if (f.groups) {\n for (var gi = 0; gi < f.groups.length; ++gi) {\n var g = f.groups[gi];\n var gid = g.id;\n if (g.type == 'gene') {\n // Like a super-grouper...\n fSuperGroup = gid;\n groups[gid] = g;\n } else if (g.type == 'translation') {\n // have to ignore this to get sensible results from bj-e :-(.\n } else {\n pusho(groupedFeatures, gid, f);\n groups[gid] = g;\n fGroups.push(gid);\n\n var ogm = groupMins[gid];\n if (!ogm || f.min < ogm) groupMins[gid] = f.min;\n\n ogm = groupMaxes[gid];\n if (!ogm || f.max > ogm) groupMaxes[gid] = f.max;\n }\n }\n }\n\n if (f.parents) {\n if (!fbid) {\n init_fbid();\n }\n for (var pi = 0; pi < f.parents.length; ++pi) {\n var pid = f.parents[pi];\n var p = fbid[pid];\n if (!p) {\n // alert(\"couldn't find \" + pid);\n continue;\n }\n if (!p.parts) {\n p.parts = [f];\n }\n pushnewo(groupedFeatures, pid, p);\n pusho(groupedFeatures, pid, f);\n\n if (!groups[pid]) {\n groups[pid] = {\n type: p.type,\n id: p.id,\n label: p.label || p.id\n };\n }\n fGroups.push(pid);\n\n var ogm = groupMins[pid];\n if (!ogm || f.min < ogm) groupMins[pid] = f.min;\n\n ogm = groupMaxes[pid];\n if (!ogm || f.max > ogm) groupMaxes[pid] = f.max;\n\n var sgs = superParentsOf(p);\n if (sgs.length > 0) {\n fSuperGroup = sgs[0];\n var sp = fbid[sgs[0]];\n groups[sgs[0]] = {\n type: sp.type,\n id: sp.id,\n label: sp.label || sp.id\n };\n if (!tier.dasSource.collapseSuperGroups) {\n tier.dasSource.collapseSuperGroups = true;\n }\n }\n }\n }\n\n if (fGroups.length == 0) {\n if (drawn) pusho(ungroupedFeatures, f.type, f);\n } else if (fSuperGroup) {\n for (var g = 0; g < fGroups.length; ++g) {\n var gid = fGroups[g];\n pushnewo(superGroups, fSuperGroup, gid);\n groupsToSupers[gid] = fSuperGroup;\n }\n }\n }\n\n for (var gid in groupedFeatures) {\n var group = groups[gid];\n if (typeof group.min !== 'number') group.min = groupMins[gid];\n if (typeof group.max !== 'number') group.max = groupMaxes[gid];\n\n if (groupMaxes[gid] >= dmin && groupMins[gid] <= dmax) drawnGroupedFeatures[gid] = groupedFeatures[gid];\n }\n\n tier.ungroupedFeatures = ungroupedFeatures;\n tier.groupedFeatures = drawnGroupedFeatures;\n tier.groups = groups;\n tier.superGroups = superGroups;\n tier.groupsToSupers = groupsToSupers;\n\n if (minScore) {\n if (minScore > 0) {\n minScore = 0;\n } else if (maxScore < 0) {\n maxScore = 0;\n }\n tier.currentFeaturesMinScore = minScore;\n tier.currentFeaturesMaxScore = maxScore;\n }\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n sortFeatures: sortFeatures\n };\n}\n\n},{\"./utils\":56}],23:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// glyphs.js: components which know how to draw themselves\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var spans = require('./spans');\n var union = spans.union;\n var Range = spans.Range;\n\n var utils = require('./utils');\n var makeElementNS = utils.makeElementNS;\n var AMINO_ACID_TRANSLATION = utils.AMINO_ACID_TRANSLATION;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n}\n\nfunction PathGlyphBase(stroke, fill) {\n this._stroke = stroke;\n this._fill = fill;\n}\n\nPathGlyphBase.prototype.draw = function (g) {\n g.beginPath();\n this.drawPath(g);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n};\n\nPathGlyphBase.prototype.toSVG = function () {\n var g = new SVGPath();\n this.drawPath(g);\n\n return makeElementNS(NS_SVG, 'path', null, { d: g.toPathData(),\n fill: this._fill || 'none',\n stroke: this._stroke || 'none' });\n};\n\nPathGlyphBase.prototype.drawPath = function (g) {\n throw 'drawPath method on PathGlyphBase must be overridden';\n};\n\nfunction BoxGlyph(x, y, width, height, fill, stroke, alpha, radius) {\n this.x = x;\n this.y = y;\n this._width = width;\n this._height = height;\n this.fill = fill;\n this.stroke = stroke;\n this._alpha = alpha;\n this._radius = radius || 0;\n}\n\nBoxGlyph.prototype.draw = function (g) {\n var r = this._radius;\n\n if (r > 0) {\n g.beginPath();\n g.moveTo(this.x + r, this.y);\n g.lineTo(this.x + this._width - r, this.y);\n g.arcTo(this.x + this._width, this.y, this.x + this._width, this.y + r, r);\n g.lineTo(this.x + this._width, this.y + this._height - r);\n g.arcTo(this.x + this._width, this.y + this._height, this.x + this._width - r, this.y + this._height, r);\n g.lineTo(this.x + r, this.y + this._height);\n g.arcTo(this.x, this.y + this._height, this.x, this.y + this._height - r, r);\n g.lineTo(this.x, this.y + r);\n g.arcTo(this.x, this.y, this.x + r, this.y, r);\n g.closePath();\n\n if (this._alpha != null) {\n g.save();\n g.globalAlpha = this._alpha;\n }\n\n if (this.fill) {\n g.fillStyle = this.fill;\n g.fill();\n }\n if (this.stroke) {\n g.strokeStyle = this.stroke;\n g.lineWidth = 0.5;\n g.stroke();\n }\n\n if (this._alpha != null) {\n g.restore();\n }\n } else {\n if (this._alpha != null) {\n g.save();\n g.globalAlpha = this._alpha;\n }\n\n if (this.fill) {\n g.fillStyle = this.fill;\n g.fillRect(this.x, this.y, this._width, this._height);\n }\n\n if (this.stroke) {\n g.strokeStyle = this.stroke;\n g.lineWidth = 0.5;\n g.strokeRect(this.x, this.y, this._width, this._height);\n }\n\n if (this._alpha != null) {\n g.restore();\n }\n }\n};\n\nBoxGlyph.prototype.toSVG = function () {\n var s = makeElementNS(NS_SVG, 'rect', null, { x: this.x,\n y: this.y,\n width: this._width,\n height: this._height,\n stroke: this.stroke || 'none',\n strokeWidth: 0.5,\n fill: this.fill || 'none' });\n if (this._alpha != null) {\n s.setAttribute('opacity', this._alpha);\n }\n\n return s;\n};\n\nBoxGlyph.prototype.min = function () {\n return this.x;\n};\n\nBoxGlyph.prototype.max = function () {\n return this.x + this._width;\n};\n\nBoxGlyph.prototype.height = function () {\n return this.y + this._height;\n};\n\nfunction GroupGlyph(glyphs, connector) {\n this.glyphs = glyphs;\n this.connector = connector;\n this.h = glyphs[0].height();\n\n var covList = [];\n for (var g = 0; g < glyphs.length; ++g) {\n var gg = glyphs[g];\n covList.push(new Range(gg.min(), gg.max()));\n this.h = Math.max(this.h, gg.height());\n }\n this.coverage = union(covList);\n}\n\nGroupGlyph.prototype.drawConnectors = function (g) {\n var ranges = this.coverage.ranges();\n for (var r = 1; r < ranges.length; ++r) {\n var gl = ranges[r];\n var last = ranges[r - 1];\n if (last && gl.min() > last.max()) {\n var start = last.max();\n var end = gl.min();\n var mid = (start + end) / 2;\n\n if (this.connector === 'hat+') {\n g.moveTo(start, this.h / 2);\n g.lineTo(mid, 0);\n g.lineTo(end, this.h / 2);\n } else if (this.connector === 'hat-') {\n g.moveTo(start, this.h / 2);\n g.lineTo(mid, this.h);\n g.lineTo(end, this.h / 2);\n } else if (this.connector === 'collapsed+') {\n g.moveTo(start, this.h / 2);\n g.lineTo(end, this.h / 2);\n if (end - start > 4) {\n g.moveTo(mid - 2, this.h / 2 - 3);\n g.lineTo(mid + 2, this.h / 2);\n g.lineTo(mid - 2, this.h / 2 + 3);\n }\n } else if (this.connector === 'collapsed-') {\n g.moveTo(start, this.h / 2);\n g.lineTo(end, this.h / 2);\n if (end - start > 4) {\n g.moveTo(mid + 2, this.h / 2 - 3);\n g.lineTo(mid - 2, this.h / 2);\n g.lineTo(mid + 2, this.h / 2 + 3);\n }\n } else {\n g.moveTo(start, this.h / 2);\n g.lineTo(end, this.h / 2);\n }\n }\n last = gl;\n }\n};\n\nGroupGlyph.prototype.draw = function (g, oc) {\n for (var i = 0; i < this.glyphs.length; ++i) {\n var gl = this.glyphs[i];\n gl.draw(g, oc);\n }\n\n g.strokeStyle = 'black';\n g.beginPath();\n this.drawConnectors(g);\n g.stroke();\n};\n\nGroupGlyph.prototype.toSVG = function () {\n var g = makeElementNS(NS_SVG, 'g');\n for (var i = 0; i < this.glyphs.length; ++i) {\n g.appendChild(this.glyphs[i].toSVG());\n }\n\n var p = new SVGPath();\n this.drawConnectors(p);\n\n var pathData = p.toPathData();\n if (pathData.length > 0) {\n var path = makeElementNS(NS_SVG, 'path', null, { d: p.toPathData(),\n fill: 'none',\n stroke: 'black',\n strokeWidth: 0.5 });\n g.appendChild(path);\n }\n\n return g;\n};\n\nGroupGlyph.prototype.min = function () {\n return this.coverage.min();\n};\n\nGroupGlyph.prototype.max = function () {\n return this.coverage.max();\n};\n\nGroupGlyph.prototype.height = function () {\n return this.h;\n};\n\nfunction LineGraphGlyph(points, color, height) {\n this.points = points;\n this.color = color;\n this._height = height || 50;\n}\n\nLineGraphGlyph.prototype.min = function () {\n return this.points[0].x;\n // return this.points[0];\n};\n\nLineGraphGlyph.prototype.max = function () {\n return this.points[this.points.length - 1].x;\n // return this.points[this.points.length - 2];\n};\n\nLineGraphGlyph.prototype.height = function () {\n return this._height;\n};\n\nLineGraphGlyph.prototype.draw = function (g) {\n g.save();\n g.strokeStyle = this.color;\n g.lineWidth = 2;\n g.beginPath();\n this.points.forEach(function (p, i) {\n if (i === 0) g.moveTo(p.x, p.y);else g.lineTo(p.x, p.y);\n });\n g.stroke();\n g.restore();\n};\n\nLineGraphGlyph.prototype.toSVG = function () {\n var p = new SVGPath();\n for (var i = 0; i < this.points.length; ++i) {\n var x = this.points[i].x;\n var y = this.points[i].y;\n if (i == 0) {\n p.moveTo(x, y);\n } else {\n p.lineTo(x, y);\n }\n }\n\n return makeElementNS(NS_SVG, 'path', null, { d: p.toPathData(),\n fill: 'none',\n stroke: this.color,\n strokeWidth: '2px' });\n};\n\nfunction LabelledGlyph(GLOBAL_GC, glyph, text, unmeasured, anchor, align, font) {\n this.glyph = glyph;\n this.text = text;\n this.anchor = anchor || 'left';\n this.align = align || 'below';\n if (font) {\n this.font = font;\n }\n if (this.font) {\n GLOBAL_GC.save();\n GLOBAL_GC.font = this.font;\n }\n var metrics = GLOBAL_GC.measureText(text);\n if (this.font) {\n GLOBAL_GC.restore();\n }\n this.textLen = metrics.width;\n this.textHeight = 5;\n this.bump = glyph.bump;\n this.measured = !unmeasured;\n}\n\nLabelledGlyph.prototype.toSVG = function () {\n var child = this.glyph.toSVG();\n var opts = {};\n\n if (this.align == 'above') {\n child = makeElementNS(NS_SVG, 'g', child, { transform: \"translate(0, \" + (this.textHeight | 0 + 2) + \")\" });\n opts.y = this.textHeight;\n } else {\n opts.y = this.glyph.height() + 15;\n }\n\n if (this.font) {\n opts.fontSize = 7;\n }\n\n if ('center' == this.anchor) {\n opts.x = (this.glyph.min() + this.glyph.max() - this.textLen) / 2;\n } else {\n opts.x = this.glyph.min();\n }\n\n return makeElementNS(NS_SVG, 'g', [child, makeElementNS(NS_SVG, 'text', this.text, opts)]);\n};\n\nLabelledGlyph.prototype.min = function () {\n return this.glyph.min();\n};\n\nLabelledGlyph.prototype.max = function () {\n if (this.measured) return Math.max(this.glyph.max(), 1.0 * this.glyph.min() + this.textLen + 10);else return this.glyph.max();\n};\n\nLabelledGlyph.prototype.height = function () {\n var h = this.glyph.height();\n if (this.measured) {\n if (this.align == 'above') {\n h += this.textHeight + 2;\n } else {\n h += 20;\n }\n }\n return h;\n};\n\nLabelledGlyph.prototype.draw = function (g, oc) {\n if (this.align == 'above') {\n g.save();\n g.translate(0, this.textHeight + 2);\n }\n this.glyph.draw(g);\n if (this.align == 'above') {\n g.restore();\n }\n\n oc.registerGlyph(this);\n};\n\nLabelledGlyph.prototype.drawOverlay = function (g, minVisible, maxVisible) {\n g.fillStyle = 'black';\n if (this.font) {\n g.save();\n g.font = this.font;\n }\n var p;\n if ('center' == this.anchor) {\n p = (this.glyph.min() + this.glyph.max() - this.textLen) / 2;\n } else {\n p = this.glyph.min();\n if (p < minVisible) {\n p = Math.min(minVisible, this.glyph.max() - this.textLen);\n }\n }\n g.fillText(this.text, p, this.align == 'above' ? this.textHeight : this.glyph.height() + 15);\n if (this.font) {\n g.restore();\n }\n};\n\nfunction CrossGlyph(x, height, stroke) {\n this._x = x;\n this._height = height;\n this._stroke = stroke;\n}\n\nCrossGlyph.prototype.draw = function (g) {\n var hh = this._height / 2;\n\n g.beginPath();\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n g.moveTo(this._x - hh, hh);\n g.lineTo(this._x + hh, hh);\n\n g.strokeStyle = this._stroke;\n g.lineWidth = 1;\n\n g.stroke();\n};\n\nCrossGlyph.prototype.toSVG = function () {\n var hh = this._height / 2;\n\n var g = new SVGPath();\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n g.moveTo(this._x - hh, hh);\n g.lineTo(this._x + hh, hh);\n\n return makeElementNS(NS_SVG, 'path', null, { d: g.toPathData(),\n fill: 'none',\n stroke: this._stroke,\n strokeWidth: '1px' });\n};\n\nCrossGlyph.prototype.min = function () {\n return this._x - this._height / 2;\n};\n\nCrossGlyph.prototype.max = function () {\n return this._x + this._height / 2;\n};\n\nCrossGlyph.prototype.height = function () {\n return this._height;\n};\n\nfunction ExGlyph(x, height, stroke) {\n this._x = x;\n this._height = height;\n this._stroke = stroke;\n}\n\nExGlyph.prototype.draw = function (g) {\n var hh = this._height / 2;\n\n g.beginPath();\n g.moveTo(this._x - hh, 0);\n g.lineTo(this._x + hh, this._height);\n g.moveTo(this._x - hh, this._height);\n g.lineTo(this._x + hh, 0);\n\n g.strokeStyle = this._stroke;\n g.lineWidth = 1;\n\n g.stroke();\n};\n\nExGlyph.prototype.toSVG = function () {\n var hh = this._height / 2;\n\n var g = new SVGPath();\n g.moveTo(this._x - hh, 0);\n g.lineTo(this._x + hh, this._height);\n g.moveTo(this._x - hh, this._height);\n g.lineTo(this._x + hh, 0);\n\n return makeElementNS(NS_SVG, 'path', null, { d: g.toPathData(),\n fill: 'none',\n stroke: this._stroke,\n strokeWidth: '1px' });\n};\n\nExGlyph.prototype.min = function () {\n return this._x - this._height / 2;\n};\n\nExGlyph.prototype.max = function () {\n return this._x + this._height / 2;\n};\n\nExGlyph.prototype.height = function () {\n return this._height;\n};\n\nfunction TriangleGlyph(x, height, dir, width, fill, stroke) {\n PathGlyphBase.call(this, stroke, fill);\n\n this._x = x;\n this._height = height;\n this._dir = dir;\n this._width = width;\n}\n\nTriangleGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nTriangleGlyph.prototype.drawPath = function (g) {\n var hh = this._height / 2;\n var hw = this._width / 2;\n\n if (this._dir === 'S') {\n g.moveTo(this._x, this._height);\n g.lineTo(this._x - hw, 0);\n g.lineTo(this._x + hw, 0);\n } else if (this._dir === 'W') {\n g.moveTo(this._x + hw, hh);\n g.lineTo(this._x - hw, 0);\n g.lineTo(this._x - hw, this._height);\n } else if (this._dir === 'E') {\n g.moveTo(this._x - hw, hh);\n g.lineTo(this._x + hw, 0);\n g.lineTo(this._x + hw, this._height);\n } else {\n g.moveTo(this._x, 0);\n g.lineTo(this._x + hw, this._height);\n g.lineTo(this._x - hw, this._height);\n }\n\n g.closePath();\n};\n\nTriangleGlyph.prototype.min = function () {\n return this._x - this._height / 2;\n};\n\nTriangleGlyph.prototype.max = function () {\n return this._x + this._height / 2;\n};\n\nTriangleGlyph.prototype.height = function () {\n return this._height;\n};\n\nfunction DotGlyph(x, height, fill, stroke) {\n this._x = x;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nDotGlyph.prototype.draw = function (g) {\n var hh = this._height / 2;\n g.fillStyle = this._stroke;\n g.beginPath();\n g.arc(this._x, hh, hh, 0, 6.29);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n};\n\nDotGlyph.prototype.toSVG = function () {\n var hh = this._height / 2;\n return makeElementNS(NS_SVG, 'circle', null, { cx: this._x, cy: hh, r: hh,\n fill: this._fill || 'none',\n stroke: this._stroke || 'none',\n strokeWidth: '1px' });\n};\n\nDotGlyph.prototype.min = function () {\n return this._x - this._height / 2;\n};\n\nDotGlyph.prototype.max = function () {\n return this._x + this._height / 2;\n};\n\nDotGlyph.prototype.height = function () {\n return this._height;\n};\n\nfunction PaddedGlyph(glyph, minp, maxp) {\n this.glyph = glyph;\n this._min = minp;\n this._max = maxp;\n if (glyph) {\n this.bump = glyph.bump;\n }\n}\n\nPaddedGlyph.prototype.draw = function (g, oc) {\n if (this.glyph) this.glyph.draw(g, oc);\n};\n\nPaddedGlyph.prototype.toSVG = function () {\n if (this.glyph) {\n return this.glyph.toSVG();\n } else {\n return makeElementNS(NS_SVG, 'g');\n }\n};\n\nPaddedGlyph.prototype.min = function () {\n return this._min;\n};\n\nPaddedGlyph.prototype.max = function () {\n return this._max;\n};\n\nPaddedGlyph.prototype.height = function () {\n if (this.glyph) {\n return this.glyph.height();\n } else {\n return 1;\n }\n};\n\nfunction AArrowGlyph(min, max, height, fill, stroke, ori) {\n PathGlyphBase.call(this, stroke, fill);\n this._min = min;\n this._max = max;\n this._height = height;\n this._ori = ori;\n}\n\nAArrowGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nAArrowGlyph.prototype.min = function () {\n return this._min;\n};\n\nAArrowGlyph.prototype.max = function () {\n return this._max;\n};\n\nAArrowGlyph.prototype.height = function () {\n return this._height;\n};\n\nAArrowGlyph.prototype.drawPath = function (g) {\n var maxPos = this._max;\n var minPos = this._min;\n var height = this._height;\n var lInset = 0;\n var rInset = 0;\n var minLength = this._height + 2;\n var instep = 0.333333 * this._height;\n var y = 0;\n\n if (this._ori) {\n if (this._ori === '+') {\n rInset = 0.5 * this._height;\n } else if (this._ori === '-') {\n lInset = 0.5 * this._height;\n }\n }\n\n if (maxPos - minPos < minLength) {\n minPos = (maxPos + minPos - minLength) / 2;\n maxPos = minPos + minLength;\n }\n\n g.moveTo(minPos + lInset, y + instep);\n g.lineTo(maxPos - rInset, y + instep);\n g.lineTo(maxPos - rInset, y);\n g.lineTo(maxPos, y + this._height / 2);\n g.lineTo(maxPos - rInset, y + height);\n g.lineTo(maxPos - rInset, y + instep + instep);\n g.lineTo(minPos + lInset, y + instep + instep);\n g.lineTo(minPos + lInset, y + height);\n g.lineTo(minPos, y + height / 2);\n g.lineTo(minPos + lInset, y);\n g.lineTo(minPos + lInset, y + instep);\n};\n\nfunction SpanGlyph(min, max, height, stroke) {\n PathGlyphBase.call(this, stroke, null);\n this._min = min;\n this._max = max;\n this._height = height;\n}\n\nSpanGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nSpanGlyph.prototype.min = function () {\n return this._min;\n};\nSpanGlyph.prototype.max = function () {\n return this._max;\n};\nSpanGlyph.prototype.height = function () {\n return this._height;\n};\n\nSpanGlyph.prototype.drawPath = function (g) {\n var minPos = this._min,\n maxPos = this._max;\n var height = this._height,\n hh = height / 2;\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n g.moveTo(minPos, 0);\n g.lineTo(minPos, height);\n g.moveTo(maxPos, 0);\n g.lineTo(maxPos, height);\n};\n\nfunction LineGlyph(min, max, height, style, strand, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._style = style;\n this._strand = strand;\n this._stroke = stroke;\n}\n\nLineGlyph.prototype.min = function () {\n return this._min;\n};\nLineGlyph.prototype.max = function () {\n return this._max;\n};\nLineGlyph.prototype.height = function () {\n return this._height;\n};\n\nLineGlyph.prototype.drawPath = function (g) {\n var minPos = this._min,\n maxPos = this._max;\n var height = this._height,\n hh = height / 2;\n\n if (this._style === 'hat') {\n g.moveTo(minPos, hh);\n g.lineTo((minPos + maxPos) / 2, this._strand === '-' ? height : 0);\n g.lineTo(maxPos, hh);\n } else {\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n }\n};\n\nLineGlyph.prototype.draw = function (g) {\n g.beginPath();\n this.drawPath(g);\n g.strokeStyle = this._stroke;\n if (this._style === 'dashed' && g.setLineDash) {\n g.save();\n g.setLineDash([3]);\n g.stroke();\n g.restore();\n } else {\n g.stroke();\n }\n};\n\nLineGlyph.prototype.toSVG = function () {\n var g = new SVGPath();\n this.drawPath(g);\n\n var opts = { d: g.toPathData(),\n stroke: this._stroke || 'none' };\n if (this._style === 'dashed') {\n opts['strokeDasharray'] = '3';\n }\n\n return makeElementNS(NS_SVG, 'path', null, opts);\n};\n\nfunction PrimersGlyph(min, max, height, fill, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nPrimersGlyph.prototype.min = function () {\n return this._min;\n};\nPrimersGlyph.prototype.max = function () {\n return this._max;\n};\nPrimersGlyph.prototype.height = function () {\n return this._height;\n};\n\nPrimersGlyph.prototype.drawStemPath = function (g) {\n var minPos = this._min,\n maxPos = this._max;\n var height = this._height,\n hh = height / 2;\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n};\n\nPrimersGlyph.prototype.drawTrigsPath = function (g) {\n var minPos = this._min,\n maxPos = this._max;\n var height = this._height,\n hh = height / 2;\n g.moveTo(minPos, 0);\n g.lineTo(minPos + height, hh);\n g.lineTo(minPos, height);\n g.lineTo(minPos, 0);\n g.moveTo(maxPos, 0);\n g.lineTo(maxPos - height, hh);\n g.lineTo(maxPos, height);\n g.lineTo(maxPos, 0);\n};\n\nPrimersGlyph.prototype.draw = function (g) {\n g.beginPath();\n this.drawStemPath(g);\n g.strokeStyle = this._stroke;\n g.stroke();\n g.beginPath();\n this.drawTrigsPath(g);\n g.fillStyle = this._fill;\n g.fill();\n};\n\nPrimersGlyph.prototype.toSVG = function () {\n var s = new SVGPath();\n this.drawStemPath(s);\n var t = new SVGPath();\n this.drawTrigsPath(t);\n\n return makeElementNS(NS_SVG, 'g', [makeElementNS(NS_SVG, 'path', null, { d: s.toPathData(),\n stroke: this._stroke || 'none' }), makeElementNS(NS_SVG, 'path', null, { d: t.toPathData(),\n fill: this._fill || 'none' })]);\n};\n\nfunction ArrowGlyph(min, max, height, color, parallel, sw, ne) {\n PathGlyphBase.call(this, null, color);\n this._min = min;\n this._max = max;\n this._height = height;\n this._color = color;\n this._parallel = parallel;\n this._sw = sw;\n this._ne = ne;\n}\n\nArrowGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nArrowGlyph.prototype.min = function () {\n return this._min;\n};\nArrowGlyph.prototype.max = function () {\n return this._max;\n};\nArrowGlyph.prototype.height = function () {\n return this._height;\n};\n\nArrowGlyph.prototype.drawPath = function (g) {\n var min = this._min,\n max = this._max,\n height = this._height;\n\n if (this._parallel) {\n var hh = height / 2;\n var instep = 0.4 * height;\n if (this._sw) {\n g.moveTo(min + hh, height - instep);\n g.lineTo(min + hh, height);\n g.lineTo(min, hh);\n g.lineTo(min + hh, 0);\n g.lineTo(min + hh, instep);\n } else {\n g.moveTo(min, height - instep);\n g.lineTo(min, instep);\n }\n if (this._ne) {\n g.lineTo(max - hh, instep);\n g.lineTo(max - hh, 0);\n g.lineTo(max, hh);\n g.lineTo(max - hh, height);\n g.lineTo(max - hh, height - instep);\n } else {\n g.lineTo(max, instep);\n g.lineTo(max, height - instep);\n }\n g.closePath();\n } else {\n var mid = (min + max) / 2;\n var instep = 0.4 * (max - min);\n var th = height / 3;\n\n if (this._ne) {\n g.moveTo(min + instep, th);\n g.lineTo(min, th);\n g.lineTo(mid, 0);\n g.lineTo(max, th);\n g.lineTo(max - instep, th);\n } else {\n g.moveTo(min + instep, 0);\n g.lineTo(max - instep, 0);\n }\n if (this._sw) {\n g.lineTo(max - instep, height - th);\n g.lineTo(max, height - th);\n g.lineTo(mid, height);\n g.lineTo(min, height - th);\n g.lineTo(min + instep, height - th);\n } else {\n g.lineTo(max - instep, height);\n g.lineTo(min + instep, height);\n }\n g.closePath();\n }\n};\n\nfunction TooManyGlyph(min, max, height, fill, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nTooManyGlyph.prototype.min = function () {\n return this._min;\n};\nTooManyGlyph.prototype.max = function () {\n return this._max;\n};\nTooManyGlyph.prototype.height = function () {\n return this._height;\n};\n\nTooManyGlyph.prototype.toSVG = function () {\n return makeElementNS(NS_SVG, 'rect', null, { x: this._min,\n y: 0,\n width: this._max - this._min,\n height: this._height,\n stroke: this._stroke || 'none',\n fill: this._fill || 'none' });\n};\n\nTooManyGlyph.prototype.draw = function (g) {\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fillRect(this._min, 0, this._max - this._min, this._height);\n }\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.strokeRect(this._min, 0, this._max - this._min, this._height);\n g.beginPath();\n for (var n = 2; n < this._height; n += 3) {\n g.moveTo(this._min, n);\n g.lineTo(this._max, n);\n }\n g.stroke();\n }\n};\n\nfunction TextGlyph(GLOBAL_GC, min, max, height, fill, string) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._string = string;\n this._textLen = GLOBAL_GC.measureText(string).width;\n}\n\nTextGlyph.prototype.min = function () {\n return this._min;\n};\nTextGlyph.prototype.max = function () {\n return Math.max(this._max, this._min + this._textLen);\n};\nTextGlyph.prototype.height = function () {\n return this._height;\n};\n\nTextGlyph.prototype.draw = function (g) {\n g.fillStyle = this._fill;\n g.fillText(this._string, this._min, this._height - 4);\n};\n\nTextGlyph.prototype.toSVG = function () {\n return makeElementNS(NS_SVG, 'text', this._string, { x: this._min, y: this._height - 4 });\n};\n\nfunction aminoTileColor(aa, start, color) {\n var ALTERNATE_COLOR = {\n 'red': 'darkred',\n 'purple': 'mediumpurple',\n 'blue': 'darkblue',\n 'green': 'darkgreen'\n };\n var color2 = ALTERNATE_COLOR[color.toLowerCase()];\n var tileColors;\n if (!color2) tileColors = ['rgb(73, 68, 149)', 'rgb(9, 0, 103)'];\n // default to UCSC colors\n else tileColors = [color, color2];\n\n if (aa == '?') return 'black';else if (aa == 'M') return 'greenyellow';else if (aa == '*') return 'crimson';else return tileColors[start % 2];\n}\n\nfunction reverseComplement(sequence) {\n var seq_dict = { 'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G' };\n var rev_seq = sequence.split('').reverse().join('');\n var rev_compl_seq = [];\n for (var b = 0; b < rev_seq.length; ++b) {\n var base = rev_seq.substr(b, 1).toUpperCase();\n rev_compl_seq.push(base in seq_dict ? seq_dict[base] : 'N');\n }\n return rev_compl_seq.join('');\n}\n\nfunction AminoAcidGlyph(min, max, height, fill, seq, orientation, readframe) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._seq = seq;\n this._orientation = orientation;\n this._readframe = readframe;\n}\n\nAminoAcidGlyph.prototype.min = function () {\n return this._min;\n};\nAminoAcidGlyph.prototype.max = function () {\n return this._max;\n};\nAminoAcidGlyph.prototype.height = function () {\n return this._height;\n};\n\nAminoAcidGlyph.prototype.draw = function (gc) {\n var seq = this._seq;\n var color = this._fill;\n\n if (!seq) return;\n\n var scale = (this._max - this._min + 1) / seq.length;\n\n var prevOverhang = (3 - this._readframe) % 3;\n var nextOverhang = (seq.length - prevOverhang) % 3;\n var leftOverhang = this._orientation == '+' ? prevOverhang : nextOverhang;\n\n if (leftOverhang > 0) {\n gc.fillStyle = color;\n gc.fillRect(this._min, 0, scale * leftOverhang, this._height);\n }\n\n for (var p = leftOverhang; p < seq.length; p += 3) {\n var codon = seq.substr(p, 3).toUpperCase();\n if (this._orientation == '-') codon = reverseComplement(codon);\n var aa = codon in AMINO_ACID_TRANSLATION ? AMINO_ACID_TRANSLATION[codon] : '?';\n color = codon.length == 3 ? aminoTileColor(aa, p, this._fill) : this._fill;\n gc.fillStyle = color;\n gc.fillRect(this._min + p * scale, 0, scale * codon.length, this._height);\n\n if (scale >= 8 && codon.length == 3) {\n gc.fillStyle = 'white';\n gc.fillText(aa, this._min + (p + 1) * scale, this._height);\n }\n }\n};\n\nAminoAcidGlyph.prototype.toSVG = function () {\n var g = makeElementNS(NS_SVG, 'g');\n var seq = this._seq;\n var color = this._fill;\n\n if (!seq) return g;\n\n var scale = (this._max - this._min + 1) / seq.length;\n\n var prevOverhang = (3 - this._readframe) % 3;\n var nextOverhang = (seq.length - prevOverhang) % 3;\n var leftOverhang = this._orientation == '+' ? prevOverhang : nextOverhang;\n\n if (leftOverhang > 0) {\n g.appendChild(makeElementNS(NS_SVG, 'rect', null, {\n x: this._min,\n y: 0,\n width: scale * leftOverhang,\n height: this._height,\n fill: color }));\n }\n for (var p = leftOverhang; p < seq.length; p += 3) {\n var codon = seq.substr(p, 3).toUpperCase();\n if (this._orientation == '-') codon = reverseComplement(codon);\n var aa = codon in AMINO_ACID_TRANSLATION ? AMINO_ACID_TRANSLATION[codon] : '?';\n color = codon.length == 3 ? aminoTileColor(aa, p, this._fill) : this._fill;\n g.appendChild(makeElementNS(NS_SVG, 'rect', null, {\n x: this._min + p * scale,\n y: 0,\n width: scale * codon.length,\n height: this._height,\n fill: color }));\n\n if (scale >= 8 && codon.length == 3) {\n g.appendChild(makeElementNS(NS_SVG, 'text', aa, {\n x: this._min + (p + 1) * scale,\n y: this._height,\n fill: 'white' }));\n }\n }\n return g;\n};\n\nvar isRetina = typeof window !== 'undefined' && window.devicePixelRatio > 1;\nvar __dalliance_SequenceGlyphCache = {};\nvar altPattern = new RegExp('^[ACGT-]$');\nvar isCloseUp = function isCloseUp(scale) {\n return scale >= 8;\n};\n\nfunction SequenceGlyph(baseColors, strandColor, min, max, height, seq, ref, scheme, quals, fillbg, scaleVertical) {\n this.baseColors = baseColors;\n this._strandColor = strandColor;\n this._min = min;\n this._max = max;\n this._height = height;\n this._seq = seq;\n this._ref = ref;\n this._scheme = scheme;\n this._quals = quals;\n this._fillbg = fillbg;\n this._scaleVertical = scaleVertical;\n}\n\nSequenceGlyph.prototype.min = function () {\n return this._min;\n};\nSequenceGlyph.prototype.max = function () {\n return this._max;\n};\nSequenceGlyph.prototype.height = function () {\n return this._height;\n};\n\nSequenceGlyph.prototype.alphaForQual = function (qual) {\n return 0.1 + 0.9 * Math.max(0.0, Math.min(1.0 * qual / 30.0, 1.0));\n};\n\nSequenceGlyph.prototype.draw = function (gc) {\n var seq = this._seq;\n var ref = this._ref;\n var mismatch = this._scheme === 'mismatch' || this._scheme === 'mismatch-all';\n var all = this._scheme === 'mismatch-all';\n\n var seqLength = seq ? seq.length : this._max - this._min + 1;\n var scale = (this._max - this._min + 1) / seqLength;\n\n if (mismatch && !isCloseUp(scale)) {\n gc.fillStyle = this._strandColor;\n if (this._scaleVertical) gc.fillRect(this._min, scale, this._max - this._min, scale);else gc.fillRect(this._min, this._height / 4, this._max - this._min, this._height / 2);\n }\n\n for (var p = 0; p < seqLength; ++p) {\n var base = seq ? seq.substr(p, 1).toUpperCase() : 'N';\n\n if (!altPattern.test(base) && !isCloseUp(scale)) continue;\n\n var color = this.baseColors[base];\n\n if (this._quals) {\n var qc = this._quals.charCodeAt(p) - 33;\n var oldAlpha = gc.globalAlpha; // NB hoisted!\n gc.globalAlpha = this.alphaForQual(qc);\n }\n\n if (!color) {\n var refBase = ref ? ref.substr(p, 1).toUpperCase() : 'N';\n if (base == 'N' || refBase == 'N') color = 'gray';else color = this._strandColor;\n\n if (all) base = refBase;\n }\n\n gc.fillStyle = color;\n\n var alt = altPattern.test(base);\n if (this._fillbg || !isCloseUp(scale) || !alt) {\n if (this._scaleVertical) gc.fillRect(this._min + p * scale, scale, scale, scale);else gc.fillRect(this._min + p * scale, 0, scale, this._height);\n }\n if (isCloseUp(scale) && alt) {\n var key = color + '_' + base;\n var img = __dalliance_SequenceGlyphCache[key];\n if (!img) {\n img = document.createElement('canvas');\n if (isRetina) {\n img.width = 16;\n img.height = 20;\n } else {\n img.width = 8;\n img.height = 10;\n }\n var imgGc = img.getContext('2d');\n if (isRetina) {\n imgGc.scale(2, 2);\n }\n imgGc.fillStyle = this._fillbg ? 'black' : color;\n var w = imgGc.measureText(base).width;\n imgGc.fillText(base, 0.5 * (8.0 - w), 8);\n __dalliance_SequenceGlyphCache[key] = img;\n }\n var dy = this._scaleVertical ? scale : 0;\n if (isRetina) gc.drawImage(img, this._min + p * scale + 0.5 * (scale - 8), dy, 8, 10);else gc.drawImage(img, this._min + p * scale + 0.5 * (scale - 8), dy);\n }\n\n if (this._quals) {\n gc.globalAlpha = oldAlpha;\n }\n }\n};\n\nSequenceGlyph.prototype.toSVG = function () {\n var seq = this._seq;\n var ref = this._ref;\n var mismatch = this._scheme === 'mismatch' || this._scheme === 'mismatch-all';\n var all = this._scheme === 'mismatch-all';\n var scale = (this._max - this._min + 1) / this._seq.length;\n var g = makeElementNS(NS_SVG, 'g');\n\n for (var p = 0; p < seq.length; ++p) {\n var base = seq ? seq.substr(p, 1).toUpperCase() : 'N';\n var color = this.baseColors[base];\n\n if (!color) {\n var refBase = ref ? ref.substr(p, 1).toUpperCase() : 'N';\n if (base == 'N' || refBase == 'N') color = 'gray';else color = this._strandColor;\n\n if (all) base = refBase;\n }\n\n var alpha = 1.0;\n if (this._quals) {\n var qc = this._quals.charCodeAt(p) - 33;\n alpha = this.alphaForQual(qc);\n }\n\n var alt = altPattern.test(base);\n if (this._fillbg || !isCloseUp(scale) || !alt) {\n g.appendChild(makeElementNS(NS_SVG, 'rect', null, {\n x: this._min + p * scale,\n y: 0,\n width: scale,\n height: this._height,\n fill: color,\n fillOpacity: alpha }));\n }\n\n if (isCloseUp(scale) && alt) {\n g.appendChild(makeElementNS(NS_SVG, 'text', base, {\n x: this._min + (0.5 + p) * scale,\n y: 8,\n textAnchor: 'middle',\n fill: this._fillbg ? 'black' : color,\n fillOpacity: alpha }));\n }\n }\n\n return g;\n};\n\nfunction TranslatedGlyph(glyph, x, y, height) {\n this.glyph = glyph;\n this._height = height;\n this._x = x;\n this._y = y;\n}\n\nTranslatedGlyph.prototype.height = function () {\n if (this._height) {\n return this._height;\n } else {\n return this.glyph.height() + this._y;\n }\n};\n\nTranslatedGlyph.prototype.min = function () {\n return this.glyph.min() + this._x;\n};\n\nTranslatedGlyph.prototype.max = function () {\n return this.glyph.max() + this._x;\n};\n\nTranslatedGlyph.prototype.minY = function () {\n return this._y;\n};\n\nTranslatedGlyph.prototype.maxY = function () {\n return this._y + this.glyph.height();\n};\n\nTranslatedGlyph.prototype.draw = function (g, o) {\n g.save();\n g.translate(this._x, this._y);\n this.glyph.draw(g, o);\n g.restore();\n};\n\nTranslatedGlyph.prototype.toSVG = function () {\n var s = this.glyph.toSVG();\n s.setAttribute('transform', 'translate(' + this._x + ',' + this._y + ')');\n return s;\n};\n\nfunction PointGlyph(x, y, height, fill) {\n this._x = x;\n this._y = y;\n this._height = height;\n this._fill = fill;\n}\n\nPointGlyph.prototype.min = function () {\n return this._x - 2;\n};\n\nPointGlyph.prototype.max = function () {\n return this._x + 2;\n};\n\nPointGlyph.prototype.height = function () {\n return this._height;\n};\n\nPointGlyph.prototype.draw = function (g) {\n g.save();\n g.globalAlpha = 0.3;\n g.fillStyle = this._fill;\n g.beginPath();\n g.arc(this._x, this._y, 1.5, 0, 6.29);\n g.fill();\n g.restore();\n};\n\nPointGlyph.prototype.toSVG = function () {\n return makeElementNS(NS_SVG, 'circle', null, { cx: this._x, cy: this._y, r: 2,\n fill: this._fill,\n stroke: 'none' });\n};\n\nfunction GridGlyph(height, yOffset, spacing) {\n this._height = height || 50;\n this.yOffset = yOffset || 0;\n this.spacing = spacing || 10;\n}\n\nGridGlyph.prototype.notSelectable = true;\n\nGridGlyph.prototype.min = function () {\n return -100000;\n};\n\nGridGlyph.prototype.max = function () {\n return 100000;\n};\n\nGridGlyph.prototype.height = function () {\n return this._height;\n};\n\nGridGlyph.prototype.draw = function (g) {\n g.save();\n g.strokeStyle = 'black';\n g.lineWidth = 0.1;\n\n g.beginPath();\n for (var y = this.yOffset; y <= this._height + this.yOffset; y += this.spacing) {\n // for (var y = 0; y <= this._height; y += 10) {\n g.moveTo(-5000, y);\n g.lineTo(5000, y);\n }\n g.stroke();\n g.restore();\n};\n\nGridGlyph.prototype.toSVG = function () {\n var p = new SVGPath();\n for (var y = 0; y <= this._height; y += 10) {\n p.moveTo(-5000, y);\n p.lineTo(5000, y);\n }\n\n return makeElementNS(NS_SVG, 'path', null, { d: p.toPathData(),\n fill: 'none',\n stroke: 'black',\n strokeWidth: '0.1px' });\n};\n\nfunction StarGlyph(x, r, points, fill, stroke) {\n PathGlyphBase.call(this, stroke, fill);\n this._x = x;\n this._r = r;\n this._points = points;\n}\n\nStarGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nStarGlyph.prototype.min = function () {\n return this._x - this._r;\n};\n\nStarGlyph.prototype.max = function () {\n return this._x + this._r;\n};\n\nStarGlyph.prototype.height = function () {\n return 2 * this._r;\n};\n\nStarGlyph.prototype.drawPath = function (g) {\n var midX = this._x,\n midY = this._r,\n r = this._r;\n for (var p = 0; p < this._points; ++p) {\n var theta = p * 6.28 / this._points;\n var px = midX + r * Math.sin(theta);\n var py = midY - r * Math.cos(theta);\n if (p == 0) {\n g.moveTo(px, py);\n } else {\n g.lineTo(px, py);\n }\n theta = (p + 0.5) * 6.28 / this._points;\n px = midX + 0.4 * r * Math.sin(theta);\n py = midY - 0.4 * r * Math.cos(theta);\n g.lineTo(px, py);\n }\n g.closePath();\n};\n\nfunction PlimsollGlyph(x, height, overhang, fill, stroke) {\n this._x = x;\n this._height = height;\n this._overhang = overhang;\n this._fill = fill;\n this._stroke = stroke;\n this._hh = height / 2;\n}\n\nPlimsollGlyph.prototype.draw = function (g) {\n var hh = this._height / 2;\n g.fillStyle = this._stroke;\n g.beginPath();\n g.arc(this._x, hh, hh - this._overhang, 0, 6.29);\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n};\n\nPlimsollGlyph.prototype.toSVG = function () {\n var hh = this._hh;\n return makeElementNS(NS_SVG, 'g', [makeElementNS(NS_SVG, 'circle', null, { cx: this._x, cy: hh, r: hh - this._overhang }), makeElementNS(NS_SVG, 'line', null, { x1: this._x, y1: 0, x2: this._x, y2: this._height })], { fill: this._fill || 'none',\n stroke: this._stroke || 'none',\n strokeWidth: '1px' });\n};\n\nPlimsollGlyph.prototype.min = function () {\n return this._x - this._hh;\n};\n\nPlimsollGlyph.prototype.max = function () {\n return this._x + this._hh;\n};\n\nPlimsollGlyph.prototype.height = function () {\n return this._height;\n};\n\nfunction OverlayLabelCanvas() {\n this.ox = 0;\n this.oy = 0;\n this.glyphs = [];\n}\n\nOverlayLabelCanvas.prototype.translate = function (x, y) {\n this.ox += x;\n this.oy += y;\n};\n\nOverlayLabelCanvas.prototype.registerGlyph = function (g) {\n this.glyphs.push({\n x: this.ox,\n y: this.oy,\n glyph: g\n });\n};\n\nOverlayLabelCanvas.prototype.draw = function (g, minVisible, maxVisible) {\n for (var gi = 0; gi < this.glyphs.length; ++gi) {\n var gg = this.glyphs[gi];\n g.save();\n g.translate(gg.x, gg.y);\n gg.glyph.drawOverlay(g, minVisible, maxVisible);\n g.restore();\n }\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n BoxGlyph: BoxGlyph,\n GroupGlyph: GroupGlyph,\n LineGraphGlyph: LineGraphGlyph,\n LabelledGlyph: LabelledGlyph,\n CrossGlyph: CrossGlyph,\n ExGlyph: ExGlyph,\n TriangleGlyph: TriangleGlyph,\n DotGlyph: DotGlyph,\n PaddedGlyph: PaddedGlyph,\n AArrowGlyph: AArrowGlyph,\n SpanGlyph: SpanGlyph,\n LineGlyph: LineGlyph,\n PrimersGlyph: PrimersGlyph,\n ArrowGlyph: ArrowGlyph,\n TooManyGlyph: TooManyGlyph,\n TextGlyph: TextGlyph,\n SequenceGlyph: SequenceGlyph,\n AminoAcidGlyph: AminoAcidGlyph,\n TranslatedGlyph: TranslatedGlyph,\n GridGlyph: GridGlyph,\n StarGlyph: StarGlyph,\n PointGlyph: PointGlyph,\n PlimsollGlyph: PlimsollGlyph,\n\n OverlayLabelCanvas: OverlayLabelCanvas\n };\n}\n\n},{\"./spans\":41,\"./svg-utils\":45,\"./utils\":56}],24:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// jbjson.js -- query JBrowse-style REST data stores\n//\n\nif (typeof require !== 'undefined') {\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n}\n\nfunction JBrowseStore(base, query) {\n this.base = base;\n this.query = query;\n}\n\nfunction jbori(strand) {\n if (strand > 0) return '+';else if (strand < 0) return '-';\n}\n\nJBrowseStore.prototype.features = function (segment, opts, callback) {\n opts = opts || {};\n\n url = this.base + '/features/' + segment.name;\n\n var filters = [];\n if (this.query) {\n filters.push(this.query);\n }\n if (segment.isBounded) {\n filters.push('start=' + segment.start);\n filters.push('end=' + segment.end);\n }\n if (filters.length > 0) {\n url = url + '?' + filters.join('&');\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n if (req.status >= 300) {\n callback(null, 'Error code ' + req.status);\n } else {\n var jf = JSON.parse(req.response)['features'];\n var features = [];\n for (fi = 0; fi < jf.length; ++fi) {\n var j = jf[fi];\n\n var f = new DASFeature();\n f.segment = segment.name;\n f.min = (j['start'] | 0) + 1;\n f.max = j['end'] | 0;\n if (j.name) {\n f.label = j.name;\n }\n if (j.strand) f.orientation = jbori(j.strand);\n f.type = j.type || 'unknown';\n\n if (j.subfeatures && j.subfeatures.length > 0) {\n f.id = j.uniqueID;\n\n var blocks = [];\n var cds = [];\n var all = [];\n\n for (var si = 0; si < j.subfeatures.length; ++si) {\n var sj = j.subfeatures[si];\n var sf = shallowCopy(f);\n sf.min = sj.start + 1;\n sf.max = sj.end;\n sf.groups = [f];\n\n all.push(sf);\n blocks.push(new Range(sf.min, sf.max));\n if (sj.type === 'CDS') cds.push(sf);\n }\n\n if (cds.length > 0) {\n spans = union(blocks);\n var txGroup = shallowCopy(f);\n txGroup.type = 'transcript';\n spans.ranges().forEach(function (exon) {\n features.push({\n segment: segment.name,\n min: exon.min(),\n max: exon.max(),\n orientation: f.orientation,\n groups: [txGroup],\n type: 'transcript'\n });\n });\n\n var tlGroup = shallowCopy(f);\n cds.forEach(function (cdsExon) {\n cdsExon.type = 'translation';\n cdsExon.groups = [tlGroup];\n features.push(cdsExon);\n });\n } else {\n all.forEach(function (f) {\n features.push(f);\n });\n }\n } else {\n features.push(f);\n }\n }\n callback(features);\n }\n }\n };\n\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n JBrowseStore: JBrowseStore\n };\n}\n\n},{\"./das\":10,\"./spans\":41,\"./utils\":56}],25:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// kspace.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var pusho = utils.pusho;\n\n var sa = require('./sourceadapters');\n var MappedFeatureSource = sa.MappedFeatureSource;\n var CachingFeatureSource = sa.CachingFeatureSource;\n var BWGFeatureSource = sa.BWGFeatureSource;\n var RemoteBWGFeatureSource = sa.RemoteBWGFeatureSource;\n var BAMFeatureSource = sa.BAMFeatureSource;\n var RemoteBAMFeatureSource = sa.RemoteBAMFeatureSource;\n var DummySequenceSource = sa.DummySequenceSource;\n var DummyFeatureSource = sa.DummyFeatureSource;\n\n var OverlayFeatureSource = require('./overlay').OverlayFeatureSource;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var sample = require('./sample');\n var downsample = sample.downsample;\n var getBaseCoverage = sample.getBaseCoverage;\n\n var das = require('./das');\n var DASSequence = das.DASSequence;\n\n var Promise = require('es6-promise').Promise;\n}\n\nfunction FetchPool() {\n var self = this;\n this.reqs = [];\n this.awaitedFeatures = {};\n this.requestsIssued = new Promise(function (resolve, reject) {\n self.notifyRequestsIssued = resolve;\n });\n}\n\nFetchPool.prototype.addRequest = function (xhr) {\n this.reqs.push(xhr);\n};\n\nFetchPool.prototype.abortAll = function () {\n for (var i = 0; i < this.reqs.length; ++i) {\n this.reqs[i].abort();\n }\n};\n\nfunction KSCacheBaton(chr, min, max, scale, features, status, coverage) {\n this.chr = chr;\n this.min = min;\n this.max = max;\n this.coverage = coverage;\n this.scale = scale;\n this.features = features || [];\n this.status = status;\n}\n\nKSCacheBaton.prototype.toString = function () {\n return this.chr + \":\" + this.min + \"..\" + this.max + \";scale=\" + this.scale;\n};\n\nfunction KnownSpace(tierMap, chr, min, max, scale, seqSource) {\n this.tierMap = tierMap;\n this.chr = chr;\n this.min = min;\n this.max = max;\n this.scale = scale;\n this.seqSource = seqSource || new DummySequenceSource();\n this.viewCount = 0;\n\n this.featureCache = {};\n this.latestViews = {};\n}\n\nKnownSpace.prototype.cancel = function () {\n this.cancelled = true;\n};\n\nKnownSpace.prototype.bestCacheOverlapping = function (chr, min, max) {\n var baton = this.featureCache[this.tierMap[0]];\n if (baton) {\n return baton;\n } else {\n return null;\n }\n};\n\nKnownSpace.prototype.retrieveFeatures = function (tiers, chr, min, max, scale) {\n if (scale != scale) {\n throw \"retrieveFeatures called with silly scale\";\n }\n\n if (chr != this.chr) {\n throw \"Can't extend Known Space to a new chromosome\";\n }\n if (min < 1) {\n min = 1;\n }\n\n this.min = min;\n this.max = max;\n this.scale = scale;\n\n if (this.pool) {\n this.pool.abortAll();\n }\n this.pool = new FetchPool();\n this.awaitedSeq = new Awaited();\n this.seqWasFetched = false;\n this.viewCount++;\n\n this.startFetchesForTiers(tiers);\n this.pool.notifyRequestsIssued();\n};\n\nfunction filterFeatures(features, min, max) {\n var ff = [];\n var featuresByGroup = {};\n\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (!f.min || !f.max) {\n ff.push(f);\n } else if (f.groups && f.groups.length > 0) {\n pusho(featuresByGroup, f.groups[0].id, f);\n } else if (f.min <= max && f.max >= min) {\n ff.push(f);\n }\n }\n\n for (var gid in featuresByGroup) {\n var gf = featuresByGroup[gid];\n var gmin = 100000000000,\n gmax = -100000000000;\n for (var fi = 0; fi < gf.length; ++fi) {\n var f = gf[fi];\n gmin = Math.min(gmin, f.min);\n gmax = Math.max(gmax, f.max);\n }\n if (gmin <= max || gmax >= min) {\n for (var fi = 0; fi < gf.length; ++fi) {\n ff.push(gf[fi]);\n }\n }\n }\n\n return ff;\n}\n\nKnownSpace.prototype.invalidate = function (tier) {\n if (!this.pool) {\n return;\n }\n\n this.featureCache[tier] = null;\n this.startFetchesForTiers([tier]);\n};\n\nKnownSpace.prototype.startFetchesForTiers = function (tiers) {\n var thisB = this;\n\n var awaitedSeq = this.awaitedSeq;\n var needSeq = false;\n\n var gex;\n\n for (var t = 0; t < tiers.length; ++t) {\n var tierRenderer = tiers[t].browser.getTierRenderer(tiers[t]);\n try {\n if (this.startFetchesFor(tiers[t], awaitedSeq)) {\n needSeq = true;\n }\n } catch (ex) {\n var tier = tiers[t];\n\n tier.currentFeatures = [];\n tier.currentSequence = null;\n console.log('Error fetching tier source');\n console.log(ex);\n gex = ex;\n console.log(ex.stack);\n tierRenderer.renderTier(ex, tier);\n tier.wasRendered();\n }\n }\n\n if (needSeq && !this.seqWasFetched) {\n this.seqWasFetched = true;\n var smin = this.min,\n smax = this.max;\n\n if (this.cs) {\n if (this.cs.start <= smin && this.cs.end >= smax) {\n var cachedSeq;\n if (this.cs.start == smin && this.cs.end == smax) {\n cachedSeq = this.cs;\n } else {\n cachedSeq = new DASSequence(this.cs.name, smin, smax, this.cs.alphabet, this.cs.seq.substring(smin - this.cs.start, smax + 1 - this.cs.start));\n }\n return awaitedSeq.provide(cachedSeq);\n }\n }\n\n this.seqSource.fetch(this.chr, smin, smax, this.pool, function (err, seq) {\n if (seq) {\n if (!thisB.cs || smin <= thisB.cs.start && smax >= thisB.cs.end || smin >= thisB.cs.end || smax <= thisB.cs.start || smax - smin > thisB.cs.end - thisB.cs.start) {\n thisB.cs = seq;\n }\n awaitedSeq.provide(seq);\n } else {\n console.log('Sequence loading failed', err);\n awaitedSeq.provide(null);\n }\n });\n }\n\n if (gex) throw gex;\n};\n\nKnownSpace.prototype.startFetchesFor = function (tier, awaitedSeq) {\n var thisB = this;\n\n var viewID = this.viewCount;\n var source = tier.getSource() || new DummyFeatureSource();\n var needsSeq = tier.needsSequence(this.scale);\n var baton = thisB.featureCache[tier];\n var styleFilters = tier.getActiveStyleFilters(this.scale);\n var wantedTypes;\n if (styleFilters) wantedTypes = styleFilters.typeList();\n var chr = this.chr,\n min = this.min,\n max = this.max;\n\n if (wantedTypes === undefined) {\n return false;\n }\n if (baton && baton.chr === this.chr && baton.min <= min && baton.max >= max) {\n var cachedFeatures = baton.features;\n if (baton.min < min || baton.max > max) {\n cachedFeatures = filterFeatures(cachedFeatures, min, max);\n }\n\n thisB.provision(tier, baton.chr, intersection(baton.coverage, new Range(min, max)), baton.scale, wantedTypes, cachedFeatures, baton.status, needsSeq ? awaitedSeq : null);\n\n var availableScales = source.getScales();\n\n if (baton.scale <= this.scale || !availableScales) {\n return needsSeq;\n }\n }\n\n if (source.instrument) console.log('Starting fetch ' + viewID + ' (' + min + ', ' + max + ')');\n\n source.fetch(chr, min, max, this.scale, wantedTypes, this.pool, function (status, features, scale, coverage) {\n if (source.instrument) console.log('Finishing fetch ' + viewID);\n\n var latestViewID = thisB.latestViews[tier] || -1;\n if (thisB.cancelled || latestViewID > viewID) {\n return;\n }\n\n if (!coverage) {\n coverage = new Range(min, max);\n }\n\n if (!baton || min < baton.min || max > baton.max) {\n // FIXME should be merging in some cases?\n thisB.featureCache[tier] = new KSCacheBaton(chr, min, max, scale, features, status, coverage);\n }\n\n thisB.latestViews[tier] = viewID;\n thisB.provision(tier, chr, coverage, scale, wantedTypes, features, status, needsSeq ? awaitedSeq : null);\n }, styleFilters);\n return needsSeq;\n};\n\nKnownSpace.prototype.provision = function (tier, chr, coverage, actualScale, wantedTypes, features, status, awaitedSeq) {\n var tierRenderer = tier.browser.getTierRenderer(tier);\n if (status) {\n tier.setFeatures(chr, coverage, actualScale, [], null);\n if (!features) {\n var e = new Error(status);\n status = \"Error fetching data: \" + status + \"; see browser console\";\n console.log(\"Error fetching data for tier \" + tier.dasSource.name + \":\");\n console.log(tier.dasSource);\n console.log(\"Stack trace:\");\n console.log(e.stack);\n }\n tierRenderer.renderTier(status, tier);\n tier.wasRendered();\n } else {\n var mayDownsample = false;\n var needBaseComposition = false;\n var src = tier.getSource();\n while (MappedFeatureSource.prototype.isPrototypeOf(src) || CachingFeatureSource.prototype.isPrototypeOf(src) || OverlayFeatureSource.prototype.isPrototypeOf(src)) {\n\n if (OverlayFeatureSource.prototype.isPrototypeOf(src)) {\n src = src.sources[0];\n } else {\n src = src.source;\n }\n }\n if (BWGFeatureSource.prototype.isPrototypeOf(src) || RemoteBWGFeatureSource.prototype.isPrototypeOf(src) || BAMFeatureSource.prototype.isPrototypeOf(src) || RemoteBAMFeatureSource.prototype.isPrototypeOf(src)) {\n\n mayDownsample = true;\n }\n\n if (!src.opts || !src.opts.forceReduction && !src.opts.noDownsample) {\n if ( /* (actualScale < (this.scale/2) && features.length > 200) || */\n mayDownsample && wantedTypes && wantedTypes.length == 1 && wantedTypes.indexOf('density') >= 0) {\n features = downsample(features, this.scale);\n }\n }\n\n if (wantedTypes && wantedTypes.length == 1 && wantedTypes.indexOf('base-coverage') >= 0) {\n // Base-composition coverage track\n needBaseComposition = true;\n }\n\n if (awaitedSeq) {\n awaitedSeq.await(function (seq) {\n if (needBaseComposition) {\n features = getBaseCoverage(features, seq, tier.browser.baseColors);\n }\n tier.setFeatures(chr, coverage, actualScale, features, seq);\n tierRenderer.renderTier(status, tier);\n tier.wasRendered();\n });\n } else {\n tier.setFeatures(chr, coverage, actualScale, features);\n tierRenderer.renderTier(status, tier);\n tier.wasRendered();\n }\n }\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n KnownSpace: KnownSpace\n };\n}\n\n},{\"./das\":10,\"./overlay\":31,\"./sample\":34,\"./sourceadapters\":39,\"./spans\":41,\"./utils\":56,\"es6-promise\":384}],26:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// lh3utils.js: common support for lh3's file formats\n//\n\nif (typeof require !== 'undefined') {\n var jszlib = require('jszlib');\n var jszlib_inflate_buffer = jszlib.inflateBuffer;\n var arrayCopy = jszlib.arrayCopy;\n}\n\nfunction Vob(b, o) {\n this.block = b;\n this.offset = o;\n}\n\nVob.prototype.toString = function () {\n return '' + this.block + ':' + this.offset;\n};\n\nfunction readVob(ba, offset, allowZero) {\n var block = (ba[offset + 6] & 0xff) * 0x100000000 + (ba[offset + 5] & 0xff) * 0x1000000 + (ba[offset + 4] & 0xff) * 0x10000 + (ba[offset + 3] & 0xff) * 0x100 + (ba[offset + 2] & 0xff);\n var bint = ba[offset + 1] << 8 | ba[offset];\n if (block == 0 && bint == 0 && !allowZero) {\n return null; // Should only happen in the linear index?\n } else {\n return new Vob(block, bint);\n }\n}\n\nfunction unbgzf(data, lim) {\n lim = Math.min(lim || 1, data.byteLength - 50);\n var oBlockList = [];\n var ptr = [0];\n var totalSize = 0;\n\n while (ptr[0] < lim) {\n var ba = new Uint8Array(data, ptr[0], 12); // FIXME is this enough for all credible BGZF block headers?\n var xlen = ba[11] << 8 | ba[10];\n // dlog('xlen[' + (ptr[0]) +']=' + xlen);\n var unc = jszlib_inflate_buffer(data, 12 + xlen + ptr[0], Math.min(65536, data.byteLength - 12 - xlen - ptr[0]), ptr);\n ptr[0] += 8;\n totalSize += unc.byteLength;\n oBlockList.push(unc);\n }\n\n if (oBlockList.length == 1) {\n return oBlockList[0];\n } else {\n var out = new Uint8Array(totalSize);\n var cursor = 0;\n for (var i = 0; i < oBlockList.length; ++i) {\n var b = new Uint8Array(oBlockList[i]);\n arrayCopy(b, 0, out, cursor, b.length);\n cursor += b.length;\n }\n return out.buffer;\n }\n}\n\nfunction Chunk(minv, maxv) {\n this.minv = minv;this.maxv = maxv;\n}\n\n//\n// Binning (transliterated from SAM1.3 spec)\n//\n\n/* calculate bin given an alignment covering [beg,end) (zero-based, half-close-half-open) */\nfunction reg2bin(beg, end) {\n --end;\n if (beg >> 14 == end >> 14) return ((1 << 15) - 1) / 7 + (beg >> 14);\n if (beg >> 17 == end >> 17) return ((1 << 12) - 1) / 7 + (beg >> 17);\n if (beg >> 20 == end >> 20) return ((1 << 9) - 1) / 7 + (beg >> 20);\n if (beg >> 23 == end >> 23) return ((1 << 6) - 1) / 7 + (beg >> 23);\n if (beg >> 26 == end >> 26) return ((1 << 3) - 1) / 7 + (beg >> 26);\n return 0;\n}\n\n/* calculate the list of bins that may overlap with region [beg,end) (zero-based) */\nvar MAX_BIN = ((1 << 18) - 1) / 7;\nfunction reg2bins(beg, end) {\n var i = 0,\n k,\n list = [];\n --end;\n list.push(0);\n for (k = 1 + (beg >> 26); k <= 1 + (end >> 26); ++k) {\n list.push(k);\n }for (k = 9 + (beg >> 23); k <= 9 + (end >> 23); ++k) {\n list.push(k);\n }for (k = 73 + (beg >> 20); k <= 73 + (end >> 20); ++k) {\n list.push(k);\n }for (k = 585 + (beg >> 17); k <= 585 + (end >> 17); ++k) {\n list.push(k);\n }for (k = 4681 + (beg >> 14); k <= 4681 + (end >> 14); ++k) {\n list.push(k);\n }return list;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n unbgzf: unbgzf,\n readVob: readVob,\n reg2bin: reg2bin,\n reg2bins: reg2bins,\n Chunk: Chunk\n };\n}\n\n},{\"jszlib\":385}],27:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// memstore.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var dalliance_makeParser = sa.makeParser;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var textXHR = utils.textXHR;\n}\n\nfunction MemStore() {\n this.featuresByChr = {};\n this.maxLength = 1;\n this.chrRing = null;\n}\n\nMemStore.prototype.addFeatures = function (features) {\n var dirty = {};\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n var chr = f.segment || f.chr;\n var fa = this.featuresByChr[chr];\n if (!fa) {\n fa = [];\n this.featuresByChr[chr] = fa;\n }\n fa.push(f);\n dirty[chr] = true;\n\n var len = f.max - f.min + 1;\n if (len > this.maxLength) this.maxLength = len;\n }\n\n for (chr in dirty) {\n var fa = this.featuresByChr[chr];\n fa.sort(function (f1, f2) {\n var d = f1.min - f2.min;\n if (d != 0) return d;\n return f1.max - f2.max;\n });\n }\n this.chrRing = null;\n};\n\nMemStore.prototype._indexFor = function (fa, p) {\n var lb = 0,\n ub = fa.length;\n while (ub > lb) {\n var mid = (lb + ub) / 2 | 0;\n if (mid >= fa.length) return fa.length;\n var mg = fa[mid];\n if (p < mg.min) {\n ub = mid;\n } else {\n lb = mid + 1;\n }\n }\n return ub;\n};\n\nMemStore.prototype.fetch = function (chr, min, max) {\n var fa = this.featuresByChr[chr];\n if (!fa) {\n if (chr.indexOf('chr') == 0) fa = this.featuresByChr[chr.substring(3)];else fa = this.featuresByChr['chr' + chr];\n }\n if (!fa) return [];\n\n var mini = Math.max(0, this._indexFor(fa, min - this.maxLength - 1));\n var maxi = Math.min(fa.length - 1, this._indexFor(fa, max));\n\n var res = [];\n for (var fi = mini; fi <= maxi; ++fi) {\n var f = fa[fi];\n if (f.min <= max && f.max >= min) res.push(f);\n }\n return res;\n};\n\nMemStore.prototype.findNextFeature = function (chr, pos, dir) {\n if (this.chrRing == null) {\n this.chrRing = [];\n for (var chr in this.featuresByChr) {\n this.chrRing.push(chr);\n }\n this.chrRing.sort();\n }\n\n var fa = this.featuresByChr[chr];\n if (!fa) {\n if (chr.indexOf('chr') == 0) {\n chr = chr.substring(3);\n fa = this.featuresByChr[chr];\n } else {\n chr = 'chr' + chr;\n fa = this.featuresByChr[chr];\n }\n }\n if (!fa) return null;\n\n var i = Math.max(0, Math.min(this._indexFor(fa, pos), fa.length - 1));\n if (dir > 0) {\n while (i < fa.length) {\n var f = fa[i++];\n if (f.min > pos) return f;\n }\n var chrInd = this.chrRing.indexOf(chr) + 1;\n if (chrInd >= this.chrRing.length) chrInd = 0;\n return this.findNextFeature(this.chrRing[chrInd], 0, dir);\n } else {\n while (i >= 0) {\n var f = fa[i--];\n if (f.max < pos) return f;\n }\n var chrInd = this.chrRing.indexOf(chr) - 1;\n if (chrInd < 0) chrInd = this.chrRing.length - 1;\n return this.findNextFeature(this.chrRing[chrInd], 10000000000, dir);\n }\n};\n\nfunction MemStoreFeatureSource(source) {\n this.source = source;\n FeatureSourceBase.call(this);\n this.storeHolder = new Awaited();\n this.parser = dalliance_makeParser(source.payload);\n if (!this.parser) {\n throw \"Unsupported memstore payload: \" + source.payload;\n }\n\n var thisB = this;\n this._load(function (resp, err) {\n if (err) {\n thisB.error = err;\n thisB.storeHolder.provide(null);\n } else {\n var store = new MemStore();\n var features = [];\n var lines = resp.split('\\n');\n\n var session = thisB.parser.createSession(function (f) {\n features.push(f);\n });\n for (var li = 0; li < lines.length; ++li) {\n var line = lines[li];\n if (line.length > 0) {\n session.parse(line);\n }\n }\n session.flush();\n\n store.addFeatures(features);\n\n thisB.storeHolder.provide(store);\n }\n });\n}\n\nMemStoreFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nMemStoreFeatureSource.prototype._load = function (callback) {\n if (this.source.blob) {\n var r = new FileReader();\n r.onloadend = function () {\n return callback(r.result, r.error);\n };\n r.readAsText(this.source.blob);\n } else {\n if (this.source.credentials) var opts = { credentials: this.source.credentials };\n textXHR(this.source.uri, callback, opts);\n }\n};\n\nMemStoreFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, cnt) {\n var thisB = this;\n this.storeHolder.await(function (store) {\n if (store) {\n var f = store.fetch(chr, min, max);\n return cnt(null, f, 100000000);\n } else {\n return cnt(thisB.error);\n }\n });\n};\n\nMemStoreFeatureSource.prototype.getStyleSheet = function (callback) {\n if (this.parser && this.parser.getStyleSheet) this.parser.getStyleSheet(callback);\n};\n\nMemStoreFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.parser && this.parser.getDefaultFIPs) this.parser.getDefaultFIPs(callback);\n};\n\nMemStoreFeatureSource.prototype.getScales = function () {\n return 100000000;\n};\n\nMemStoreFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n var thisB = this;\n this.storeHolder.await(function (store) {\n if (store) {\n return callback(store.findNextFeature(chr, pos, dir));\n } else {\n return callback(null, thisB.error);\n }\n });\n};\n\nMemStoreFeatureSource.prototype.capabilities = function () {\n var caps = { leap: true };\n return caps;\n};\n\ndalliance_registerSourceAdapterFactory('memstore', function (source) {\n return { features: new MemStoreFeatureSource(source) };\n});\n\n},{\"./das\":10,\"./sourceadapters\":39,\"./utils\":56}],28:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// Molgenisjson.js -- query the Molgenis REST API.\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n}\n\nfunction MolgenisFeatureSource(source) {\n FeatureSourceBase.call(this);\n this.source = source;\n if (source.uri) {\n this.base = source.uri;\n } else if (source.entity) {\n this.base = window.location.origin + '/api/v2/' + source.entity + '?' + Math.random();\n } else {\n throw new Error(\"Bad molgenis track configuration: please specify 'genome_attrs.chr' and 'genome_attrs.pos'\");\n }\n\n this.species = source.species || 'human';\n\n if (typeof source.type === 'string') {\n this.type = [source.type];\n } else {\n this.type = source.type || ['regulatory'];\n }\n}\n\nMolgenisFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\nMolgenisFeatureSource.prototype.constructor = MolgenisFeatureSource;\n\nMolgenisFeatureSource.prototype.getStyleSheet = function (callback) {\n var stylesheet = new DASStylesheet();\n\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'A';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'green';\n stylesheet.pushStyle({ type: 'variant', method: 'A' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'C';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({ type: 'variant', method: 'C' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'G';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'orange';\n stylesheet.pushStyle({ type: 'variant', method: 'G' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'T';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({ type: 'variant', method: 'T' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = '?';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'darkgrey';\n stylesheet.pushStyle({ type: 'variant', method: 'unknown' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'DOT';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'purple';\n stylesheet.pushStyle({ type: 'indel' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'STAR';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({ type: 'variant', method: 'multiple' }, null, varStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'blue';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'red';\n wigStyle.BGCOLOR = 'red';\n wigStyle.HEIGHT = 8;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'exon', method: 'exon' }, null, wigStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'white';\n wigStyle.BGCOLOR = 'white';\n wigStyle.HEIGHT = 8;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'exon', method: 'intron' }, null, wigStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'HISTOGRAM';\n varStyle.BGCOLOR = 'blue';\n varStyle.HEIGHT = 50;\n stylesheet.pushStyle({ type: 'numeric' }, null, varStyle);\n }\n\n return callback(stylesheet);\n};\n\nMolgenisFeatureSource.prototype.getScales = function () {\n return [];\n};\n\nMolgenisFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n var source = this.source;\n\n if (!source.genome_attrs.chr || !source.genome_attrs.pos) {\n throw new Error(\"Bad molgenis track configuration: please specify 'genome_attrs.chr' and 'genome_attrs.pos'\");\n }\n\n var url = this.base;\n\n if (source.attrs) {\n var attributes = [];\n for (var index = 0; index < source.attrs.length; ++index) {\n var attr = source.attrs[index];\n var attrArray = attr.split(\":\");\n attributes.push(attrArray[0]);\n }\n if (attributes[source.genome_attrs.chr] === undefined) {\n attributes.push(source.genome_attrs.chr);\n }\n if (attributes[source.genome_attrs.pos] === undefined) {\n attributes.push(source.genome_attrs.pos);\n }\n if (attributes[source.genome_attrs.alt] === undefined) {\n if (source.genome_attrs.alt) {\n attributes.push(source.genome_attrs.alt);\n }\n }\n if (attributes[source.genome_attrs.ref] === undefined) {\n if (source.genome_attrs.ref) {\n attributes.push(source.genome_attrs.ref);\n }\n }\n if (attributes[source.genome_attrs.stop] === undefined) {\n if (source.genome_attrs.stop) {\n attributes.push(source.genome_attrs.stop);\n }\n }\n url += '&attrs=' + encodeURIComponent(attributes);\n }\n\n if (source.genome_attrs.stop) {\n url += '&q=' + encodeURIComponent(source.genome_attrs.chr) + '==' + chr + ';(' + source.genome_attrs.pos + '=ge=' + min + ';' + source.genome_attrs.pos + '=le=' + max + ',' + source.genome_attrs.stop + '=ge=' + min + ';' + source.genome_attrs.stop + '=le=' + max + ')';\n } else {\n url += '&q=' + encodeURIComponent(source.genome_attrs.chr) + '==' + chr + ';' + source.genome_attrs.pos + '=ge=' + min + ';' + source.genome_attrs.pos + '=le=' + max;\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n thisB.busy--;\n thisB.notifyActivity();\n\n if (req.status >= 300) {\n var err = 'Error code ' + req.status;\n try {\n var jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } catch (ex) {};\n\n callback(err, null);\n } else {\n var jf = JSON.parse(req.response);\n var items = jf.items;\n var features = [];\n for (var fi = 0; fi < items.length; ++fi) {\n var entity = items[fi];\n var notes = [];\n var feature = new DASFeature();\n feature.segment = chr;\n feature.min = entity[source.genome_attrs.pos] | 0;\n if (source.genome_attrs.stop) {\n feature.max = entity[source.genome_attrs.stop] | 0;\n } else {\n feature.max = entity[source.genome_attrs.pos] | 0;\n }\n\n feature.type = entity.feature_type || 'unknown';\n var identifier;\n if (source.label_attr) {\n identifier = source.label_attr;\n } else {\n identifier = \"ID\";\n }\n feature.id = entity[identifier];\n\n //add attrs to notes for use in popup\n if (source.attrs) {\n for (var index = 0; index < source.attrs.length; ++index) {\n var attr = source.attrs[index];\n var attrArray = attr.split(\":\");\n\n var label = attrArray[1];\n var value = entity[attrArray[0]];\n\n notes.push(label + '=' + value);\n }\n }\n if (source.actions) {\n feature.actions = eval(source.actions);\n feature.entity = entity;\n }\n\n if (notes.length > 0) {\n feature.notes = notes;\n }\n\n if (source.track_type === \"NUMERIC\") {\n feature.score = entity[source.score_attr];\n }\n\n setStyleProperties(entity, feature, source);\n feature.molgenis = true;\n features.push(feature);\n }\n callback(null, features);\n }\n }\n };\n\n thisB.busy++;\n thisB.notifyActivity();\n\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send('');\n};\n\nfunction setStyleProperties(entity, feature, source) {\n\n var type = source.track_type;\n var altAttr = source.genome_attrs.alt;\n var refAttr = source.genome_attrs.ref;\n if (type === \"NUMERIC\") {\n feature.type = \"numeric\";\n return;\n }\n if (type === \"EXON\") {\n var labelAttr = source.label_attr;\n if (entity[labelAttr].search(source.exon_key) != -1) {\n feature.type = \"exon\";\n feature.method = \"exon\";\n return;\n } else {\n feature.type = \"exon\";\n feature.method = \"intron\";\n return;\n }\n } else if (altAttr && entity[altAttr] && refAttr && entity[refAttr]) {\n if (entity[altAttr].length > 1 || entity[refAttr].length > 1) {\n feature.type = \"indel\";\n return;\n } else if (entity[altAttr] === 'A') {\n feature.type = \"variant\";\n feature.method = \"A\";\n return;\n } else if (entity[altAttr] === 'T') {\n feature.type = \"variant\";\n feature.method = \"T\";\n return;\n } else if (entity[altAttr] === 'G') {\n feature.type = \"variant\";\n feature.method = \"G\";\n return;\n } else if (entity[altAttr] === 'C') {\n feature.type = \"variant\";\n feature.method = \"C\";\n return;\n } else if (entity[altAttr].search(',') != -1) {\n feature.type = \"variant\";\n feature.method = \"multiple\";\n return;\n } else {\n feature.type = \"variant\";\n feature.method = \"unknown\";\n return;\n }\n } else {\n feature.type = \"default\";\n return;\n }\n}\n\ndalliance_registerSourceAdapterFactory('molgenis', function (source) {\n return { features: new MolgenisFeatureSource(source) };\n});\n\n},{\"./das\":10,\"./sourceadapters\":39}],29:[function(require,module,exports){\n/* jshint esversion: 6 */\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.drawTier = exports.renderTier = undefined;\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 _sequenceDraw = require(\"./sequence-draw.js\");\n\nvar _glyphs = require(\"./glyphs.js\");\n\nvar _defaultRenderer = require(\"./default-renderer\");\n\nvar DefaultRenderer = _interopRequireWildcard(_defaultRenderer);\n\nvar _ramda = require(\"ramda\");\n\nvar R = _interopRequireWildcard(_ramda);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nexports.renderTier = renderTier;\nexports.drawTier = drawTier;\n\n/* Renders multiple tiers in a single track.\n Works by simply drawing several tiers to a single canvas.\n Actual rendering is done using default-renderer.es6.\n A multi-tier renderer is configured by adding the following to a tier's\n configuration:\n renderer: 'multi',\n multi: {\n multi_id: \"multi_1\",\n }\n\n All subtiers with the \"multi_1\" multi_id will be drawn to this tier's canvas.\n */\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\nfunction drawTier(multiTier) {\n var multiConfig = multiTier.dasSource.multi;\n var getSubConfig = function getSubConfig(t) {\n return t.dasSource.sub;\n };\n\n // Padding is used for finding the correct canvas size and must be set\n if (!multiTier.padding) multiTier.padding = 3;\n\n var canvas = multiTier.viewport.getContext(\"2d\");\n var retina = multiTier.browser.retina && window.devicePixelRatio > 1;\n if (retina) {\n canvas.scale(2, 2);\n }\n\n // Filter out only tiers that are to be drawn in this multitier,\n // and also have fetched data.\n var tiers = multiTier.browser.tiers.filter(function (tier) {\n return _typeof(getSubConfig(tier)) === \"object\" && getSubConfig(tier).multi_id === multiConfig.multi_id && (tier.currentFeatures || tier.currentSequence);\n });\n\n // The shortest distance from the top of the canvas to a subtier\n var minOffset = R.pipe(R.map(function (tier) {\n return tier.dasSource.sub.offset;\n }), R.reduce(function (acc, offset) {\n return offset < acc ? offset : acc;\n }, 0))(tiers);\n\n tiers.forEach(function (tier) {\n if (tier.sequenceSource) {\n (0, _sequenceDraw.drawSeqTier)(tier, tier.currentSequence);\n } else {\n // Shift subtiers up by the minimum offset,\n // so that there's no empty space at the top\n DefaultRenderer.prepareSubtiers(tier, canvas, getSubConfig(tier).offset - minOffset, false);\n }\n\n // Must be set for painting to work\n if (!multiTier.glyphCacheOrigin) multiTier.glyphCacheOrigin = tier.glyphCacheOrigin;\n });\n\n // The canvas should fit all subtiers, including offsets, but no more\n var canvasHeight = R.pipe(R.map(function (tier) {\n return R.map(function (subtier) {\n return subtier.height + getSubConfig(tier).offset;\n }, tier.subtiers);\n }), R.flatten, R.reduce(function (acc, h) {\n return h > acc ? h : acc;\n }, -Infinity), R.add(-minOffset))(tiers);\n\n prepareViewport(multiTier, canvas, retina, canvasHeight, true);\n\n tiers.sort(function (t1, t2) {\n return getSubConfig(t1).z > getSubConfig(t2).z;\n });\n\n // TODO: make it add the glyph on to the first available tier;\n // crashes if last tier is empty...\n if (multiConfig.grid && tiers && tiers[tiers.length - 1] && tiers[tiers.length - 1].subtiers[0]) {\n var grid = new _glyphs.GridGlyph(canvasHeight, multiConfig.grid_offset, multiConfig.grid_spacing);\n // pretty hacky way of adding the grid, but it works (mostly)\n tiers[tiers.length - 1].subtiers[0].glyphs.unshift(grid);\n }\n\n tiers.forEach(function (tier) {\n // Need to save and restore canvas to make sure that the subtiers are\n // drawn on top of one another, if not shifted...\n canvas.save();\n DefaultRenderer.paint(tier, canvas, retina, true);\n canvas.restore();\n });\n\n multiTier.drawOverlay();\n\n if (multiConfig.quant) {\n var quantCanvas = DefaultRenderer.createQuantOverlay(multiTier, canvasHeight + multiTier.padding * 2, retina);\n DefaultRenderer.paintQuant(quantCanvas, multiTier, multiConfig.quant, 10);\n }\n\n if (typeof multiTier.dasSource.drawCallback === \"function\") {\n multiTier.dasSource.drawCallback(canvas, multiTier);\n }\n\n multiTier.originHaxx = 0;\n multiTier.browser.arrangeTiers();\n}\n\nfunction prepareViewport(tier, canvas, retina, canvasHeight) {\n var clear = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n\n var desiredWidth = tier.browser.featurePanelWidth + 2000;\n if (retina) {\n desiredWidth *= 2;\n }\n\n var fpw = tier.viewport.width | 0;\n if (fpw < desiredWidth - 50) {\n tier.viewport.width = fpw = desiredWidth;\n }\n\n canvasHeight += 2 * tier.padding;\n canvasHeight = Math.max(canvasHeight, tier.browser.minTierHeight);\n\n if (canvasHeight != tier.viewport.height) {\n tier.viewport.height = canvasHeight;\n\n if (retina) {\n tier.viewport.height *= 2;\n }\n }\n\n tier.viewportHolder.style.left = '-1000px';\n tier.viewport.style.width = retina ? '' + fpw / 2 + 'px' : '' + fpw + 'px';\n tier.viewport.style.height = '' + canvasHeight + 'px';\n tier.layoutHeight = Math.max(canvasHeight, tier.browser.minTierHeight);\n\n tier.updateHeight();\n tier.norigin = tier.browser.viewStart;\n\n if (clear) {\n DefaultRenderer.clearViewport(canvas, fpw, canvasHeight);\n }\n\n DefaultRenderer.drawUnmapped(tier, canvas, canvasHeight);\n}\n\n},{\"./default-renderer\":11,\"./glyphs.js\":23,\"./sequence-draw.js\":36,\"ramda\":387}],30:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// memstore.js\n//\n\nfunction formatLongInt(n) {\n return (n | 0).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n\nfunction formatQuantLabel(v) {\n var t = '' + v;\n var dot = t.indexOf('.');\n if (dot < 0) {\n return t;\n } else {\n var dotThreshold = 2;\n if (t.substring(0, 1) == '-') {\n ++dotThreshold;\n }\n\n if (dot >= dotThreshold) {\n return t.substring(0, dot);\n } else {\n return t.substring(0, dot + 2);\n }\n }\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n formatLongInt: formatLongInt,\n formatQuantLabel: formatQuantLabel\n };\n}\n\n},{}],31:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// overlay.js: featuresources composed from multiple underlying sources\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n var arrayIndexOf = utils.arrayIndexOf;\n}\n\nfunction OverlayFeatureSource(sources, opts) {\n this.sources = sources;\n this.opts = opts || {};\n this.activityListeners = [];\n this.readinessListeners = [];\n this.changeListeners = [];\n this.business = [];\n this.readiness = [];\n\n for (var i = 0; i < this.sources.length; ++i) {\n this.initN(i);\n }\n\n if (typeof opts.merge === 'function') {\n this.merge = opts.merge;\n } else if (opts.merge == 'concat') {\n this.merge = OverlayFeatureSource_merge_concat;\n } else if (opts.merge == 'alternates') {\n this.merge = OverlayFeatureSource_merge_concat;\n this.filterDispatchOnMethod = true;\n } else {\n this.merge = OverlayFeatureSource_merge_byKey;\n }\n}\n\nOverlayFeatureSource.prototype.initN = function (n) {\n var s = this.sources[n];\n var thisB = this;\n this.business[n] = 0;\n\n if (s.addActivityListener) {\n s.addActivityListener(function (b) {\n thisB.business[n] = b;\n thisB.notifyActivity();\n });\n }\n if (s.addChangeListener) {\n s.addChangeListener(function () {\n thisB.notifyChange();\n });\n }\n if (s.addReadinessListener) {\n s.addReadinessListener(function (r) {\n thisB.readiness[n] = r;\n thisB.notifyReadiness();\n });\n }\n};\n\nOverlayFeatureSource.prototype.addReadinessListener = function (l) {\n this.readinessListeners.push(l);\n this.notifyReadinessListener(l);\n};\n\nOverlayFeatureSource.prototype.removeReadinessListener = function (l) {\n var idx = arrayIndexOf(this.readinessListeners, l);\n if (idx >= 0) {\n this.readinessListeners.splice(idx, 1);\n }\n};\n\nOverlayFeatureSource.prototype.notifyReadiness = function () {\n for (var i = 0; i < this.readinessListeners.length; ++i) {\n this.notifyReadinessListener(this.readinessListeners[i]);\n }\n};\n\nOverlayFeatureSource.prototype.notifyReadinessListener = function (l) {\n var r = null;\n for (var i = 0; i < this.readiness.length; ++i) {\n if (this.readiness[i] != null) {\n r = this.readiness[i];break;\n }\n }\n try {\n l(r);\n } catch (e) {\n console.log(e);\n }\n};\n\nOverlayFeatureSource.prototype.addActivityListener = function (l) {\n this.activityListeners.push(l);\n};\n\nOverlayFeatureSource.prototype.removeActivityListener = function (l) {\n var idx = arrayIndexOf(this.activityListeners, l);\n if (idx >= 0) {\n this.activityListeners.splice(idx, 1);\n }\n};\n\nOverlayFeatureSource.prototype.notifyActivity = function () {\n var busy = 0;\n for (var i = 0; i < this.business.length; ++i) {\n busy += this.business[i];\n }\n\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nOverlayFeatureSource.prototype.addChangeListener = function (listener) {\n this.changeListeners.push(listener);\n};\n\nOverlayFeatureSource.prototype.removeChangeListener = function (l) {\n var idx = arrayIndexOf(this.changeListeners, l);\n if (idx >= 0) {\n this.changeListeners.splice(idx, 1);\n }\n};\n\nOverlayFeatureSource.prototype.notifyChange = function () {\n for (var li = 0; li < this.changeListeners.length; ++li) {\n try {\n this.changeListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nOverlayFeatureSource.prototype.getScales = function () {\n return this.sources[0].getScales();\n};\n\nOverlayFeatureSource.prototype.getStyleSheet = function (callback) {\n return this.sources[0].getStyleSheet(callback);\n};\n\nOverlayFeatureSource.prototype.capabilities = function () {\n var caps = {};\n var s0 = this.sources[0];\n if (s0.capabilities) caps = shallowCopy(s0.capabilities());\n\n for (var i = 1; i < this.sources.length; ++i) {\n var si = this.sources[i];\n if (si.capabilities) {\n var co = si.capabilities();\n if (co.search) {\n caps.search = co.search;\n }\n }\n }\n\n return caps;\n};\n\nOverlayFeatureSource.prototype.search = function (query, callback) {\n for (var i = 0; i < this.sources.length; ++i) {\n if (_sourceAdapterIsCapable(this.sources[i], 'search')) {\n return this.sources[i].search(query, callback);\n }\n }\n};\n\nOverlayFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback, styleFilters) {\n var sources;\n if (this.filterDispatchOnMethod) {\n sources = [];\n var sfl = styleFilters.list();\n for (var si = 0; si < this.sources.length; ++si) {\n var source = this.sources[si];\n for (var fi = 0; fi < sfl.length; ++fi) {\n var filter = sfl[fi];\n if (!filter.method || filter.method == source.name) {\n sources.push(source);\n break;\n }\n }\n }\n } else {\n sources = this.sources;\n }\n\n var baton = new OverlayBaton(this, callback, sources);\n for (var si = 0; si < sources.length; ++si) {\n this.fetchN(baton, si, sources[si], chr, min, max, scale, types, pool, styleFilters);\n }\n};\n\nOverlayFeatureSource.prototype.fetchN = function (baton, si, source, chr, min, max, scale, types, pool, styleFilters) {\n // FIXME should we try to prune styleFilters?\n source.fetch(chr, min, max, scale, types, pool, function (status, features, scale) {\n return baton.completed(si, status, features, scale);\n }, styleFilters);\n};\n\nOverlayFeatureSource.prototype.quantFindNextFeature = function (chr, pos, dir, threshold, callback) {\n return this.sources[0].quantFindNextFeature(chr, pos, dir, threshold, callback);\n};\n\nOverlayFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n return this.sources[0].findNextFeature(chr, pos, dir, callback);\n};\n\nfunction OverlayBaton(source, callback, sources) {\n this.source = source;\n this.callback = callback;\n this.sources = sources;\n this.count = sources.length;\n\n this.returnCount = 0;\n this.statusCount = 0;\n this.returns = [];\n this.features = [];\n this.statuses = [];\n this.scale = null;\n}\n\nOverlayBaton.prototype.completed = function (index, status, features, scale) {\n if (this.scale == null || index == 0) this.scale = scale;\n\n if (this.returns[index]) throw 'Multiple returns for source ' + index;\n\n this.returns[index] = true;\n this.returnCount++;\n\n this.features[index] = features;\n\n if (status) {\n this.statuses[index] = status;\n this.statusCount++;\n }\n\n if (this.returnCount == this.count) {\n if (this.statusCount > 0) {\n var message = '';\n for (var si = 0; si < this.count; ++si) {\n var s = this.statuses[si];\n if (s) {\n if (message.length > 0) message += ', ';\n message += s;\n }\n }\n return this.callback(message, null, this.scale);\n } else {\n this.callback(null, this.source.merge(this.features, this.sources), this.scale);\n }\n }\n};\n\nOverlayFeatureSource.prototype.getDefaultFIPs = function (callback) {\n for (var si = 0; si < this.sources.length; ++si) {\n var s = this.sources[si];\n if (s.getDefaultFIPs) s.getDefaultFIPs(callback);\n }\n};\n\nOverlayFeatureSource.prototype.keyForFeature = function (feature) {\n return '' + feature.min + '..' + feature.max;\n};\n\nfunction OverlayFeatureSource_merge_byKey(featureSets) {\n var omaps = [];\n\n for (var fsi = 1; fsi < featureSets.length; ++fsi) {\n var om = {};\n var of = featureSets[fsi];\n for (var fi = 0; fi < of.length; ++fi) {\n om[this.keyForFeature(of[fi])] = of[fi];\n }\n omaps.push(om);\n }\n\n var mf = [];\n var fl = featureSets[0];\n for (var fi = 0; fi < fl.length; ++fi) {\n var f = fl[fi];\n\n for (var oi = 0; oi < omaps.length; ++oi) {\n var om = omaps[oi];\n of = om[this.keyForFeature(f)];\n if (of) {\n for (var k in of) {\n if (k === 'score') {\n f.score2 = of.score;\n } else if (k === 'min' || k === 'max' || k === 'segment' || k === '_cachedStyle') {\n // do nothing\n } else {\n f[k] = of[k];\n }\n }\n }\n }\n mf.push(f);\n }\n return mf;\n}\n\nfunction OverlayFeatureSource_merge_concat(featureSets, sources) {\n var features = [];\n for (var fsi = 0; fsi < featureSets.length; ++fsi) {\n var fs = featureSets[fsi];\n var name = sources[fsi].name;\n for (var fi = 0; fi < fs.length; ++fi) {\n var f = fs[fi];\n f.method = name;\n features.push(f);\n }\n }\n return features;\n}\n\nfunction _sourceAdapterIsCapable(s, cap) {\n if (!s.capabilities) return false;else return s.capabilities()[cap];\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n OverlayFeatureSource: OverlayFeatureSource\n };\n}\n\n},{\"./utils\":56}],32:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// bedwig.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n var readInt = bin.readInt;\n\n var bbi = require('./bigwig');\n var BIG_WIG_MAGIC = bbi.BIG_WIG_MAGIC;\n var BIG_BED_MAGIC = bbi.BIG_BED_MAGIC;\n\n var lh3utils = require('./lh3utils');\n var unbgzf = lh3utils.unbgzf;\n\n var bam = require('./bam');\n var BAM_MAGIC = bam.BAM_MAGIC;\n var BAI_MAGIC = bam.BAI_MAGIC;\n\n var tbi = require('./tabix');\n var TABIX_MAGIC = tbi.TABIX_MAGIC;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nfunction probeResource(source, listener, retry) {\n var BED_REGEXP = new RegExp('^\\\\w+\\\\s[0-9]+\\\\s[0-9]+.*$');\n var KV_REGEXP = /([^=]+)=\\\"?([^\\\"]+)\\\"?/;\n var VCFHEAD_RE = /^##\\s*fileformat=VCFv4\\..+/;\n\n var fetchable;\n if (source.blob) fetchable = new BlobFetchable(source.blob);else if (source.transport == 'encode') fetchable = new EncodeFetchable(source.uri);else fetchable = new URLFetchable(source.uri, { credentials: source.credentials });\n\n fetchable.slice(0, 1 << 16).salted().fetch(function (result, error) {\n if (!result) {\n if (!retry) {\n source.credentials = true;\n probeResource(source, listener, true);\n }\n\n return listener(source, \"Couldn't fetch data\");\n }\n\n var ba = new Uint8Array(result);\n var la = new Uint32Array(result, 0, 1);\n var magic = la[0];\n if (magic == BIG_WIG_MAGIC || magic == BIG_BED_MAGIC) {\n source.tier_type = 'bwg';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.bw|.bb|.bigWig|.bigBed)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else if (magic == BAI_MAGIC) {\n source.tier_type = 'bai';\n return listener(source, null);\n } else if (ba[0] == 31 || ba[1] == 139) {\n var unc = unbgzf(result);\n var uncba = new Uint8Array(unc);\n magic = readInt(uncba, 0);\n if (magic == BAM_MAGIC) {\n source.tier_type = 'bam';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.bam)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else if (magic == TABIX_MAGIC) {\n source.tier_type = 'tabix-index';\n return listener(source, null);\n } else if (magic == 0x69662323) {\n source.tier_type = 'tabix';\n source.payload = 'vcf';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.vcf)?(.gz)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else {\n console.log('magic = ' + magic.toString(16));\n return listener(source, \"Unsupported format\");\n }\n } else {\n var text = String.fromCharCode.apply(null, ba);\n var lines = text.split(\"\\n\");\n\n if (lines.length > 0 && VCFHEAD_RE.test(lines[0])) {\n source.tier_type = 'memstore';\n source.payload = 'vcf';\n var nameExtractPattern = new RegExp('/?([^/]+?)(\\.vcf)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match && !source.name) {\n source.name = match[1];\n }\n return listener(source, null);\n }\n\n for (var li = 0; li < lines.length; ++li) {\n var line = lines[li].replace('\\r', '');\n if (line.length == 0) continue;\n\n if (line.indexOf('browser') == 0) continue;\n\n if (line.indexOf('track') == 0) {\n var maybeType = 'bed';\n var toks = line.split(/\\s/);\n for (var ti = 1; ti < toks.length; ++ti) {\n var m = KV_REGEXP.exec(toks[ti]);\n if (m) {\n if (m[1] == 'type' && m[2] == 'wiggle_0') {\n maybeType = 'wig';\n } else if (m[0] == 'name') {\n source.name = m[2];\n }\n }\n }\n\n finishProbeBedWig(source, maybeType);\n return listener(source, null);\n }\n\n if (line.indexOf('fixedStep') == 0) {\n finishProbeBedWig(source, 'wig');\n return listener(source, null);\n }\n\n if (line.indexOf('variableStep') == 0) {\n finishProbeBedWig(source, 'wig');\n return listener(source, null);\n }\n\n if (BED_REGEXP.test(line)) {\n finishProbeBedWig(source, null);\n return listener(source, null);\n }\n\n break;\n }\n\n return listener(source, \"Unsupported format\");\n }\n }, { timeout: 1500 }); // Timeout to catch mixed-origin case on Chromium.\n}\n\nfunction finishProbeBedWig(source, maybeType) {\n source.tier_type = 'memstore';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.(bed|wig))?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n if (!source.name) source.name = match[1];\n if (!maybeType && match[3]) {\n maybeType = match[3];\n }\n }\n source.payload = maybeType || 'bed';\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n probeResource: probeResource\n };\n}\n\n},{\"./bam\":1,\"./bigwig\":3,\"./bin\":4,\"./encode\":14,\"./lh3utils\":26,\"./tabix\":47}],33:[function(require,module,exports){\n/* jshint esversion: 6 */\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Ruler = Ruler;\nexports.rulerDrawCallback = rulerDrawCallback;\n\n\nfunction Ruler(options) {\n var self = this;\n\n self.value = options.value;\n self.min = options.min;\n self.max = options.max;\n self.width = options.width;\n self.color = options.color;\n\n Object.keys(self).map(function (key) {\n if (self[key] === undefined) {\n console.log(\"WARNING: Ruler option \" + key + \" not set\");\n }\n });\n}\n\nRuler.prototype.constructor = Ruler;\n\nfunction rulerDrawCallback(canvas, tier) {\n var rulers = tier.dasSource.rulers;\n\n if (!rulers) {\n console.log(\"Tier uses ruler callback but has no rulers!\");\n } else if (!(rulers instanceof Array)) {\n console.log(\"rulers.js: 'rulers' should be an Array\");\n }\n\n rulers.map(function (r) {\n var rulerY = (r.max - r.value) * r.height;\n var viewWidth = tier.viewport.width;\n var oldLineWidth = canvas.lineWidth;\n\n canvas.strokeStyle = r.color;\n canvas.beginPath();\n canvas.moveTo(-viewWidth, rulerY + r.offset);\n // Other parts of the code rely on not having changed the lineWidth...\n // So we need to change it back when we're done.\n canvas.lineWidth = r.width;\n canvas.lineTo(2 * viewWidth, rulerY + r.offset);\n canvas.stroke();\n canvas.lineWidth = oldLineWidth;\n });\n}\n\n},{}],34:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// sample.js: downsampling of quantitative features\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var das = require('./das');\n var DASFeature = das.DASFeature;\n\n var parseCigar = require('./cigar').parseCigar;\n\n var shallowCopy = require('./utils').shallowCopy;\n}\n\nvar __DS_SCALES = [1, 2, 5];\n\nfunction ds_scale(n) {\n return __DS_SCALES[n % __DS_SCALES.length] * Math.pow(10, n / __DS_SCALES.length | 0);\n}\n\nfunction DSBin(scale, min, max) {\n this.scale = scale;\n this.tot = 0;\n this.cnt = 0;\n this.hasScore = false;\n this.min = min;this.max = max;\n this.features = [];\n}\n\nfunction _featureOrder(a, b) {\n if (a.min < b.min) {\n return -1;\n } else if (a.min > b.min) {\n return 1;\n } else if (a.max < b.max) {\n return -1;\n } else if (b.max > a.max) {\n return 1;\n } else {\n return 0;\n }\n}\n\nDSBin.prototype.score = function () {\n if (this.cnt == 0) {\n return 0;\n } else if (this.hasScore) {\n return this.tot / this.cnt;\n } else {\n var features = this.features;\n features.sort(_featureOrder);\n\n var maxSeen = -10000000000;\n var cov = 0,\n lap = 0;\n\n for (var fi = 1; fi < features.length; ++fi) {\n var f = features[fi];\n var lMin = Math.max(f.min, this.min);\n var lMax = Math.min(f.max, this.max);\n lap += lMax - lMin + 1;\n\n if (lMin > maxSeen) {\n cov += lMax - lMin + 1;\n maxSeen = lMax;\n } else {\n if (lMax > maxSeen) {\n cov += lMax - maxSeen;\n maxSeen = lMax;\n }\n }\n }\n\n if (cov > 0) return 1.0 * lap / cov;else return 0;\n }\n};\n\nDSBin.prototype.feature = function (f) {\n if (f.score !== undefined) {\n this.tot += f.score;\n this.hasScore = true;\n }\n\n ++this.cnt;\n this.features.push(f);\n};\n\nfunction downsample(features, targetRez) {\n var sn = 0;\n while (ds_scale(sn + 1) < targetRez) {\n ++sn;\n }\n var scale = ds_scale(sn);\n\n var binTots = [];\n var maxBin = -10000000000;\n var minBin = 10000000000;\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.groups && f.groups.length > 0) {\n // Don't downsample complex features (?)\n return features;\n }\n\n var minLap = f.min / scale | 0;\n var maxLap = f.max / scale | 0;\n maxBin = Math.max(maxBin, maxLap);\n minBin = Math.min(minBin, minLap);\n for (var b = minLap; b <= maxLap; ++b) {\n var bm = binTots[b];\n if (!bm) {\n bm = new DSBin(scale, b * scale, (b + 1) * scale - 1);\n binTots[b] = bm;\n }\n bm.feature(f);\n }\n }\n\n var sampledFeatures = [];\n for (var b = minBin; b <= maxBin; ++b) {\n var bm = binTots[b];\n if (bm) {\n var f = new DASFeature();\n f.segment = features[0].segment;\n f.min = b * scale + 1;\n f.max = (b + 1) * scale;\n f.score = bm.score();\n f.type = 'density';\n sampledFeatures.push(f);\n }\n }\n\n var afterDS = Date.now();\n return sampledFeatures;\n}\n\n/** Data structure to store information for\na base position:\n\npos: position of the base.\n*/\nfunction BaseBin(pos) {\n\n this._pos = pos;\n this._bases = {};\n this._totalCount = 0;\n}\n\n/** Keep record for incidence of a base,\nwith related qual score and strand for a position.\n\nParams\n base: base (e.g A, T, G, C, N) observed at position.\n qual: numeric quality score.\n strand: '+' or '-'.\n*/\nBaseBin.prototype.recordBase = function (base, qual, strand) {\n if (!this._bases[base]) {\n var strandComposition = { '+': 0, '-': 0 };\n strandComposition[strand]++;\n this._bases[base] = {\n cnt: 1,\n totalQual: qual,\n strandCnt: strandComposition\n };\n } else {\n var baseComposition = this._bases[base];\n baseComposition.cnt++;\n baseComposition.totalQual += qual;\n baseComposition.strandCnt[strand]++;\n }\n this._totalCount++;\n};\n\n/** Returns count of total number of bases observed at position */\nBaseBin.prototype.totalCount = function () {\n return this._totalCount;\n};\n\n/** Returns the base position */\nBaseBin.prototype.pos = function () {\n return this._pos;\n};\n\n/** Creates a list of tag, info pairs in the form\n[tag]=[info] for each base, for use in feature-popup */\nBaseBin.prototype.infoList = function () {\n var info = [];\n var totalCount = this._totalCount;\n var totalCountStr = \"Depth=\" + totalCount.toString();\n info.push(totalCountStr);\n for (var base in this._bases) {\n var baseComposition = this._bases[base];\n var baseCnt = baseComposition.cnt;\n var basePercentage = baseCnt * 100 / totalCount;\n var plusStrandCnt = baseComposition.strandCnt['+'];\n var minusStrandCnt = baseComposition.strandCnt['-'];\n var meanQual = baseComposition.totalQual / baseCnt;\n\n var baseInfoString = [base, '=', baseCnt, ' (', basePercentage.toFixed(0), '%, ', plusStrandCnt, ' +, ', minusStrandCnt, ' -, Qual: ', meanQual.toFixed(0), ')'];\n info.push(baseInfoString.join(''));\n }\n return info;\n};\n\n/** Return a list of objects for creating a\nhistogram showing composition of different bases at a\ngiven location.\n\nCurrent implementation is hacky: the logic involves\noverlaying BoxGlyphs on top of each other, thus the score\nis not meaningful, but only used to manipulate height.\n\nParams:\n ref: reference base at position\n threshold: value between 0 and 1 representing min allele frequency\n below which the allele will be ignored in histogram.\n (interpreted as noise)\n Similar to 'allele threshold' parameter in IGV\n\nReturns a list of objects containing 2 properties\n base: such as A, T, G, C, N, - (del)\n score: a numeric score for determining height of histogram\nThe list is ordered such that a preceeding object always have a\nscore >= the current object, and the ref base will be the last item.\n\nExample: There are 50 T's and 40 A's (total depth = 90)\nat a base where ref=A. The function will return\n[T: 90, A: 40]. When creating a histogram with overlap,\nthis will give an appearance of 40 A's (bottom) and 50 T's (top):\n#######\n# T #\n# T #\n# T #\n# T #\n# T #\n#######\n# A #\n# A #\n# A #\n# A #\n#######\n*/\nBaseBin.prototype.baseScoreList = function (ref, threshold) {\n var baseScoreList = [];\n var totalCount = this._totalCount;\n var minCount = threshold * totalCount;\n for (var base in this._bases) {\n var baseCount = this._bases[base].cnt;\n if (baseCount < minCount || base == ref) continue;\n var baseScorePair = { base: base, score: totalCount };\n baseScoreList.push(baseScorePair);\n totalCount -= baseCount;\n }\n baseScoreList.push({ base: ref, score: totalCount });\n return baseScoreList;\n};\n\n/** Generates an aligned read from the raw sequence of a BAM record\nusing given cigar string.\n\nParams:\n rawseq: unaligned read sequence from Bam record\n rawquals: unaligned read quals from Bam record\n cigar: Bam cigar string from Bam record\n\nReturns an object with 2 properties:\n seq: string containing aligned read\n quals: string containing printable-character representation\n of sequencing quality score\n*/\nfunction alignSeqUsingCigar(rawseq, rawquals, cigar) {\n var ops = parseCigar(cigar);\n var seq = [];\n var quals = [];\n var cursor = 0;\n for (var ci = 0; ci < ops.length; ++ci) {\n var co = ops[ci];\n if (co.op == 'M') {\n seq.push(rawseq.substr(cursor, co.cnt));\n quals.push(rawquals.substr(cursor, co.cnt));\n cursor += co.cnt;\n } else if (co.op == 'D') {\n for (var oi = 0; oi < co.cnt; ++oi) {\n seq.push('-');\n quals.push('Z');\n }\n } else if (co.op == 'I') {\n cursor += co.cnt;\n } else if (co.op == 'S') {\n cursor += co.cnt;\n } else {\n console.log('unknown cigop' + co.op);\n }\n }\n var processedSeq = { seq: seq.join(''), quals: quals.join('') };\n return processedSeq;\n}\n\n/** Constructs the reference sequence for a given window.\n\nParams\n currentSequence: DasSequence object containing ref sequence\n in current browser view.\n min, max: min and max position for window.\n\nReturns a string containing the refseq, padded with 'N' where sequence is not\n available.\n*/\nfunction getRefSeq(currentSequence, min, max) {\n var refSeq = [];\n if (currentSequence) {\n var csStart = currentSequence.start | 0;\n var csEnd = currentSequence.end | 0;\n if (csStart <= max && csEnd >= min) {\n var sfMin = Math.max(min, csStart);\n var sfMax = Math.min(max, csEnd);\n\n for (var i = 0; i < sfMin - min; i++) {\n refSeq.push('N');\n }refSeq.push(currentSequence.seq.substr(sfMin - csStart, sfMax - sfMin + 1));\n for (var i = 0; i < max - sfMax; i++) {\n refSeq.push('N');\n }\n }\n }\n return refSeq.join('');\n}\n\n/** Constructs features necessary for a coverage track showing\nbase composition for BAM reads\n\nParams\n features: a list of features from BAM records.\n currentRefSeq: a DASSequence object containing reference sequence.\n baseColors: an object mapping base to desired colors.\n\nReturns a list of features of type base-coverage.\n*/\nfunction getBaseCoverage(features, currentRefSeq, baseColors) {\n var minBin = null;\n var maxBin = null;\n\n var allBins = [];\n\n // Populate BaseBins\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.groups && f.groups.length > 0) {\n // Don't downsample complex features\n return features;\n }\n var processedSeq = alignSeqUsingCigar(f.seq, f.quals, f.cigar);\n var seq = processedSeq.seq;\n var quals = processedSeq.quals;\n var strand = f.orientation;\n var minForFeature = f.min || 0;\n var maxForFeature = f.max || 0;\n var ind = 0;\n\n for (var b = minForFeature; b <= maxForFeature; ++b) {\n var bm = allBins[b];\n if (!bm) {\n bm = new BaseBin(b);\n allBins[b] = bm;\n }\n var base = seq.charAt(ind);\n var qual = quals.charCodeAt(ind) - 33; // Generate numeric qual score\n bm.recordBase(base, qual, strand);\n ind++;\n }\n\n if (!minBin) minBin = minForFeature;else minBin = Math.min(minBin, minForFeature);\n if (!maxBin) maxBin = maxForFeature;else maxBin = Math.max(maxBin, maxForFeature);\n }\n\n // Generate coverage features\n var refSeq = getRefSeq(currentRefSeq, minBin, maxBin);\n var baseFeatures = [];\n var ind = 0;\n for (var b = minBin; b <= maxBin; ++b) {\n var bm = allBins[b];\n if (bm) {\n var f = new DASFeature();\n f.segment = features[0].segment;\n f.min = bm.pos();\n f.max = f.min;\n f.notes = [];\n f.notes = f.notes.concat(bm.infoList());\n f.type = 'base-coverage';\n f.suppressScore = true;\n if (refSeq) {\n var refBase = refSeq.charAt(ind);\n var refString = 'Ref=' + refBase;\n f.notes.unshift(refString);\n var baseScoreList = bm.baseScoreList(refBase, 0.2);\n // TODO: shift 0.2 threshold to a config parameter\n for (var i = 0; i < baseScoreList.length; i++) {\n var base = baseScoreList[i].base;\n var score = baseScoreList[i].score;\n var fBase = shallowCopy(f);\n fBase.score = score;\n // Color by baseColor when mismatch occurs\n // otherwise, BoxGlyph to COLOR1 in style\n if (baseScoreList.length > 1 || base != refBase) fBase.itemRgb = baseColors[base];\n\n baseFeatures.push(fBase);\n }\n } else {\n // No refSeq, only show coverage height.\n baseFeatures.push(f);\n }\n }\n ind++;\n }\n return baseFeatures;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n downsample: downsample,\n getBaseCoverage: getBaseCoverage\n };\n}\n\n},{\"./cigar\":8,\"./das\":10,\"./utils\":56}],35:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// bin.js general binary data support\n//\n\n\"use strict\";\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n\n var connectTrix = require('./trix').connectTrix;\n}\n\nvar REGION_PATTERN = /^([\\d+,\\w,\\.,\\_,\\-]+)[\\s:]+([0-9,\\.]+?)([KkMmGg])?((-|\\.\\.|\\s)+([0-9,\\.]+)([KkMmGg])?)?$/;\n\nfunction parseLocCardinal(n, m) {\n var i = parseFloat(n.replace(/,/g, ''));\n if (m === 'k' || m === 'K') {\n return i * 1000 | 0;\n } else if (m == 'm' || m === 'M') {\n return i * 1000000 | 0;\n } else {\n return i | 0;\n }\n}\n\nBrowser.prototype.search = function (g, statusCallback, opts) {\n var thisB = this;\n opts = opts || {};\n var srPadding = opts.padding || this.defaultSearchRegionPadding;\n\n var m = REGION_PATTERN.exec(g);\n\n if (m) {\n var chr = m[1],\n start,\n end;\n if (m[6]) {\n start = parseLocCardinal(m[2], m[3]);\n end = parseLocCardinal(m[6], m[7]);\n } else {\n var width = this.viewEnd - this.viewStart + 1;\n start = parseLocCardinal(m[2], m[3]) - width / 2 | 0;\n end = start + width - 1;\n }\n this.setLocation(chr, start, end, statusCallback);\n } else {\n if (!g || g.length == 0) {\n return false;\n }\n\n var searchCount = 0;\n var foundLatch = false;\n\n var searchCallback = function searchCallback(found, err) {\n --searchCount;\n if (err) {\n return statusCallback(err);\n }\n\n if (!found) found = [];\n var min = 500000000,\n max = -100000000;\n var nchr = null;\n for (var fi = 0; fi < found.length; ++fi) {\n var f = found[fi];\n\n if (nchr == null) {\n nchr = f.segment;\n }\n min = Math.min(min, f.min);\n max = Math.max(max, f.max);\n }\n\n if (!nchr) {\n if (searchCount == 0 && !foundLatch) return statusCallback(\"no match for '\" + g + \"'\");\n } else {\n foundLatch = true;\n thisB.highlightRegion(nchr, min, max);\n\n var mid = (max + min) / 2 | 0;\n var padding = Math.max(srPadding, 0.3 * (max - min + 1) | 0);\n thisB.setLocation(nchr, min - padding, max + padding, statusCallback);\n }\n };\n\n var doTrixSearch = function doTrixSearch(tier, trix) {\n trix.lookup(g, function (result, status) {\n if (result == null || result.length < 2) {\n return tier.featureSource.search(g, searchCallback);\n } else {\n var hit = result[1].split(',')[0];\n return tier.featureSource.search(hit, searchCallback);\n }\n });\n };\n\n if (this.searchEndpoint) {\n searchCount = 1;\n return this.doDasSearch(thisB.searchEndpoint, g, searchCallback);\n }\n\n var searchSources = [].concat(_toConsumableArray(this.searchOnlySourceHolders || []), _toConsumableArray(this.tiers));\n\n for (var ti = 0; ti < searchSources.length; ++ti) {\n (function (tier) {\n if (thisB.sourceAdapterIsCapable(tier.featureSource, 'search')) {\n if (tier.dasSource.trixURI) {\n ++searchCount;\n if (tier.trix) {\n doTrixSearch(tier, tier.trix);\n } else {\n var ix = new URLFetchable(tier.dasSource.trixURI, { credentials: tier.dasSource.credentials,\n resolver: tier.dasSource.resolver });\n\n var ixx = new URLFetchable(tier.dasSource.trixxURI || tier.dasSource.trixURI + 'x', { credentials: tier.dasSource.credentials,\n resolver: tier.dasSource.resolver });\n\n connectTrix(ix, ixx, function (trix) {\n tier.trix = trix;\n doTrixSearch(tier, trix);\n });\n }\n } else {\n ++searchCount;\n tier.featureSource.search(g, searchCallback);\n }\n } else if (tier.dasSource.provides_search) {\n ++searchCount;\n thisB.doDasSearch(tier.dasSource, g, searchCallback);\n }\n })(searchSources[ti]);\n }\n }\n};\n\nBrowser.prototype.doDasSearch = function (source, g, searchCallback) {\n var thisB = this;\n source.features(null, { group: g, type: 'transcript' }, function (found) {\n if (!found) found = [];\n var min = 500000000,\n max = -100000000;\n var nchr = null;\n\n var found2 = [];\n for (var fi = 0; fi < found.length; ++fi) {\n var f = found[fi];\n\n if (f.label.toLowerCase() != g.toLowerCase()) {\n // ...because Dazzle can return spurious overlapping features.\n continue;\n }\n found2.push(f);\n }\n\n return searchCallback(found2);\n }, false);\n};\n\n},{\"./bin\":4,\"./cbrowser\":6,\"./trix\":54}],36:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2012\n//\n// sequence-draw.js: renderers for sequence-related data\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var formatLongInt = utils.formatLongInt;\n var makeElementNS = utils.makeElementNS;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n\n var nf = require('./numformats');\n var formatLongInt = nf.formatLongInt;\n}\n\nvar MIN_TILE = 100;\nvar rulerTileColors = ['black', 'white'];\n\nvar steps = [1, 2, 5];\n\nvar NS_SVG = 'http://www.w3.org/2000/svg';\n\nfunction tileSizeForScale(scale, min) {\n if (!min) {\n min = MIN_TILE;\n }\n\n function ts(p) {\n return steps[p % steps.length] * Math.pow(10, p / steps.length | 0);\n }\n var pow = steps.length;\n while (scale * ts(pow) < min) {\n ++pow;\n }\n return ts(pow);\n}\n\nfunction drawSeqTier(tier, seq) {\n var gc = tier.viewport.getContext('2d');\n var retina = tier.browser.retina && window.devicePixelRatio > 1;\n var desiredWidth = tier.browser.featurePanelWidth + 2000;\n if (retina) {\n desiredWidth *= 2;\n }\n var fpw = tier.viewport.width | 0; // this.browser.featurePanelWidth;\n if (fpw < desiredWidth - 50) {\n tier.viewport.width = fpw = desiredWidth;\n }\n\n var height = 50;\n if (seq && seq.seq) {\n height += 25;\n }\n\n var canvasHeight = height;\n if (retina) canvasHeight *= 2;\n\n tier.viewport.height = canvasHeight;\n tier.viewport.style.height = '' + height + 'px';\n tier.viewport.style.width = retina ? '' + fpw / 2 + 'px' : '' + fpw + 'px';\n tier.layoutHeight = height;\n tier.updateHeight();\n\n if (tier.background) {\n gc.fillStyle = tier.background;\n gc.fillRect(0, 0, fpw, tier.viewport.height);\n }\n if (retina) {\n gc.scale(2, 2);\n }\n\n gc.translate(1000, 0);\n drawSeqTierGC(tier, seq, gc);\n tier.norigin = tier.browser.viewStart;\n tier.viewportHolder.style.left = '-1000px';\n}\n\nfunction drawSeqTierGC(tier, seq, gc) {\n var scale = tier.browser.scale,\n knownStart = tier.browser.viewStart - 1000 / scale | 0,\n knownEnd = tier.browser.viewEnd + 2000 / scale,\n currentSeqMax = tier.browser.currentSeqMax;\n\n var seqTierMax = knownEnd;\n if (currentSeqMax > 0 && currentSeqMax < knownEnd) {\n seqTierMax = currentSeqMax;\n }\n var tile = tileSizeForScale(scale);\n var pos = Math.max(0, (knownStart / tile | 0) * tile);\n\n var origin = tier.browser.viewStart;\n\n while (pos <= seqTierMax) {\n gc.fillStyle = pos / tile % 2 == 0 ? 'white' : 'black';\n gc.strokeStyle = 'black';\n gc.fillRect((pos - origin) * scale, 8, tile * scale, 3);\n gc.strokeRect((pos - origin) * scale, 8, tile * scale, 3);\n\n gc.fillStyle = 'black';\n gc.fillText(formatLongInt(pos), (pos - origin) * scale, 22);\n\n pos += tile;\n }\n\n if (seq && seq.seq) {\n for (var p = knownStart; p <= knownEnd; ++p) {\n if (p >= seq.start && p <= seq.end) {\n var base = seq.seq.substr(p - seq.start, 1).toUpperCase();\n var color = tier.browser.baseColors[base];\n if (!color) {\n color = 'gray';\n }\n\n gc.fillStyle = color;\n\n if (scale >= 8) {\n var w = gc.measureText(base).width;\n // console.log(scale-w);\n gc.fillText(base, (p - origin) * scale + (scale - w) * 0.5, 52);\n } else {\n gc.fillRect((p - origin) * scale, 42, scale, 12);\n }\n }\n }\n }\n}\n\nfunction svgSeqTier(tier, seq) {\n var scale = tier.browser.scale,\n knownStart = tier.browser.viewStart - 1000 / scale | 0,\n knownEnd = tier.browser.viewEnd + 2000 / scale,\n currentSeqMax = tier.browser.currentSeqMax;\n\n var fpw = tier.viewport.width | 0;\n\n var seqTierMax = knownEnd;\n if (currentSeqMax > 0 && currentSeqMax < knownEnd) {\n seqTierMax = currentSeqMax;\n }\n var tile = tileSizeForScale(scale);\n var pos = Math.max(0, (knownStart / tile | 0) * tile);\n\n var origin = tier.browser.viewStart;\n\n var g = makeElementNS(NS_SVG, 'g', [], { fontSize: '8pt' });\n while (pos <= seqTierMax) {\n g.appendChild(makeElementNS(NS_SVG, 'rect', null, { x: (pos - origin) * scale,\n y: 8,\n width: tile * scale,\n height: 3,\n fill: pos / tile % 2 == 0 ? 'white' : 'black',\n stroke: 'black' }));\n\n g.appendChild(makeElementNS(NS_SVG, 'text', formatLongInt(pos), { x: (pos - origin) * scale,\n y: 28,\n fill: 'black', stroke: 'none' }));\n\n pos += tile;\n }\n\n if (seq && seq.seq) {\n for (var p = knownStart; p <= knownEnd; ++p) {\n if (p >= seq.start && p <= seq.end) {\n var base = seq.seq.substr(p - seq.start, 1).toUpperCase();\n var color = tier.browser.baseColors[base];\n if (!color) {\n color = 'gray';\n }\n\n if (scale >= 8) {\n g.appendChild(makeElementNS(NS_SVG, 'text', base, {\n x: (0.5 + p - origin) * scale,\n y: 52,\n textAnchor: 'middle',\n fill: color }));\n } else {\n g.appendChild(makeElementNS(NS_SVG, 'rect', null, {\n x: (p - origin) * scale,\n y: 42,\n width: scale,\n height: 12,\n fill: color }));\n }\n }\n }\n }\n\n return g;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n drawSeqTier: drawSeqTier,\n drawSeqTierGC: drawSeqTierGC,\n svgSeqTier: svgSeqTier\n };\n}\n\n},{\"./numformats\":30,\"./svg-utils\":45,\"./utils\":56}],37:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// session.js\n//\n\n\"use strict\";\n\nif (typeof require != 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var sc = require('./sourcecompare');\n var sourceDataURI = sc.sourceDataURI;\n var sourcesAreEqual = sc.sourcesAreEqual;\n\n var VERSION = require('./version');\n\n var utils = require('./utils');\n var miniJSONify = utils.miniJSONify;\n\n var sha1 = require('./sha1');\n var hex_sha1 = sha1.hex_sha1;\n}\n\nBrowser.prototype.nukeStatus = function () {\n delete localStorage['dalliance.' + this.cookieKey + '.view-chr'];\n delete localStorage['dalliance.' + this.cookieKey + '.view-start'];\n delete localStorage['dalliance.' + this.cookieKey + '.view-end'];\n delete localStorage['dalliance.' + this.cookieKey + '.current-seq-length'];\n delete localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom'];\n delete localStorage['dalliance.' + this.cookieKey + '.saved-zoom'];\n\n delete localStorage['dalliance.' + this.cookieKey + '.sources'];\n delete localStorage['dalliance.' + this.cookieKey + '.hubs'];\n delete localStorage['dalliance.' + this.cookieKey + '.version'];\n\n delete localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'];\n delete localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'];\n delete localStorage['dalliance.' + this.cookieKey + '.ruler-location'];\n};\n\nBrowser.prototype.storeStatus = function () {\n this.storeViewStatus();\n this.storeTierStatus();\n};\n\nBrowser.prototype.storeViewStatus = function () {\n if (!this.cookieKey || this.noPersist || this.noPersistView) {\n return;\n }\n\n localStorage['dalliance.' + this.cookieKey + '.view-chr'] = this.chr;\n localStorage['dalliance.' + this.cookieKey + '.view-start'] = this.viewStart | 0;\n localStorage['dalliance.' + this.cookieKey + '.view-end'] = this.viewEnd | 0;\n localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom'] = '' + this.isSnapZooming;\n localStorage['dalliance.' + this.cookieKey + '.saved-zoom'] = this.savedZoom;\n if (this.currentSeqMax) {\n localStorage['dalliance.' + this.cookieKey + '.current-seq-length'] = this.currentSeqMax;\n }\n};\n\nBrowser.prototype.storeTierStatus = function () {\n if (!this.cookieKey || this.noPersist) {\n return;\n }\n\n var currentSourceList = [];\n for (var t = 0; t < this.tiers.length; ++t) {\n var tt = this.tiers[t];\n var ts = tt.dasSource;\n if (!ts.noPersist) {\n currentSourceList.push({ source: tt.dasSource, config: tt.config || {} });\n }\n }\n localStorage['dalliance.' + this.cookieKey + '.sources'] = JSON.stringify(currentSourceList);\n\n var coveredHubURLs = {};\n var currentHubList = [];\n for (var hi = 0; hi < this.hubObjects.length; ++hi) {\n var tdb = this.hubObjects[hi];\n var hc = { url: tdb.hub.url, genome: tdb.genome };\n if (tdb.credentials) hc.credentials = tdb.credentials;\n if (tdb.mapping) hc.mapping = tdb.mapping;\n coveredHubURLs[hc.url] = true;\n currentHubList.push(hc);\n }\n\n // Needed to handle hubs that failed to connect, or hubs that haven't\n // connected yet when we're called soon after startup.\n for (var hi = 0; hi < this.hubs.length; ++hi) {\n var hc = this.hubs[hi];\n if (typeof hc === 'string') hc = { url: hc };\n if (!coveredHubURLs[hc.url]) currentHubList.push(hc);\n }\n\n localStorage['dalliance.' + this.cookieKey + '.hubs'] = JSON.stringify(currentHubList);\n\n localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'] = this.reverseScrolling;\n localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'] = this.reverseKeyScrolling;\n localStorage['dalliance.' + this.cookieKey + '.single-base-highlight'] = this.singleBaseHighlight;\n localStorage['dalliance.' + this.cookieKey + '.ruler-location'] = this.rulerLocation;\n\n localStorage['dalliance.' + this.cookieKey + '.export-ruler'] = this.exportRuler;\n localStorage['dalliance.' + this.cookieKey + '.export-highlights'] = this.exportHighlights;\n\n localStorage['dalliance.' + this.cookieKey + '.version'] = VERSION.CONFIG;\n};\n\nBrowser.prototype.restoreStatus = function () {\n if (this.noPersist) return;\n\n var storedConfigVersion = localStorage['dalliance.' + this.cookieKey + '.version'];\n if (storedConfigVersion) {\n storedConfigVersion = storedConfigVersion | 0;\n } else {\n storedConfigVersion = -100;\n }\n if (VERSION.CONFIG != storedConfigVersion) {\n return;\n }\n\n var storedConfigHash = localStorage['dalliance.' + this.cookieKey + '.configHash'] || '';\n var pageConfigHash = hex_sha1(miniJSONify({\n sources: this.sources,\n hubs: this.hubs,\n rulerLocation: this.rulerLocation\n }));\n if (pageConfigHash != storedConfigHash) {\n localStorage['dalliance.' + this.cookieKey + '.configHash'] = pageConfigHash;\n return;\n }\n\n var defaultSourcesByURI = {};\n for (var si = 0; si < this.sources.length; ++si) {\n var source = this.sources[si];\n if (!source) continue;\n\n var uri = sourceDataURI(source);\n var ul = defaultSourcesByURI[uri];\n if (!ul) defaultSourcesByURI[uri] = ul = [];\n ul.push(source);\n }\n\n if (!this.noPersistView) {\n var qChr = localStorage['dalliance.' + this.cookieKey + '.view-chr'];\n var qMin = localStorage['dalliance.' + this.cookieKey + '.view-start'] | 0;\n var qMax = localStorage['dalliance.' + this.cookieKey + '.view-end'] | 0;\n if (qChr && qMin && qMax) {\n this.chr = qChr;\n this.viewStart = qMin;\n this.viewEnd = qMax;\n\n var csm = localStorage['dalliance.' + this.cookieKey + '.current-seq-length'];\n if (csm) {\n this.currentSeqMax = csm | 0;\n }\n\n this.isSnapZooming = localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom'] == 'true';\n\n var sz = parseFloat(localStorage['dalliance.' + this.cookieKey + '.saved-zoom']);\n if (typeof sz === 'number' && !isNaN(sz)) {\n this.savedZoom = sz;\n }\n }\n }\n\n var rs = localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'];\n this.reverseScrolling = rs && rs == 'true';\n var rks = localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'];\n this.reverseKeyScrolling = rks && rks == 'true';\n var sbh = localStorage['dalliance.' + this.cookieKey + '.single-base-highlight'];\n this.singleBaseHighlight = sbh && sbh == 'true';\n\n var rl = localStorage['dalliance.' + this.cookieKey + '.ruler-location'];\n if (rl) this.rulerLocation = rl;\n\n var x = localStorage['dalliance.' + this.cookieKey + '.export-ruler'];\n if (x) this.exportRuler = x === 'true';\n var x = localStorage['dalliance.' + this.cookieKey + '.export-highlights'];\n if (x) this.exportHighlights = x === 'true';\n\n var sourceStr = localStorage['dalliance.' + this.cookieKey + '.sources'];\n if (sourceStr) {\n var storedSources = JSON.parse(sourceStr);\n this.sources = [];\n this.restoredConfigs = [];\n for (var si = 0; si < storedSources.length; ++si) {\n var source = this.sources[si] = storedSources[si].source;\n this.restoredConfigs[si] = storedSources[si].config;\n var uri = sourceDataURI(source);\n var ul = defaultSourcesByURI[uri] || [];\n for (var osi = 0; osi < ul.length; ++osi) {\n var oldSource = ul[osi];\n if (sourcesAreEqual(source, oldSource)) {\n for (var k in oldSource) {\n if (oldSource.hasOwnProperty(k) && (typeof oldSource[k] === 'function' || oldSource[k] instanceof Blob)) {\n source[k] = oldSource[k];\n }\n }\n }\n }\n }\n }\n\n var hubStr = localStorage['dalliance.' + this.cookieKey + '.hubs'];\n if (hubStr) {\n this.hubs = JSON.parse(hubStr);\n }\n\n return true;\n};\n\nBrowser.prototype.reset = function () {\n for (var i = this.tiers.length - 1; i >= 0; --i) {\n this.removeTier({ index: i }, true);\n }\n for (var i = 0; i < this.defaultSources.length; ++i) {\n var s = this.defaultSources[i];\n if (!s.disabled) this.addTier(this.defaultSources[i]);\n }\n\n this.highlights.splice(0, this.highlights.length);\n\n this.setLocation(this.defaultChr, this.defaultStart, this.defaultEnd);\n};\n\n},{\"./cbrowser\":6,\"./sha1\":38,\"./sourcecompare\":40,\"./utils\":56,\"./version\":58}],38:[function(require,module,exports){\n/*\r\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\r\n * in FIPS 180-1\r\n * Version 2.2 Copyright Paul Johnston 2000 - 2009.\r\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n * Distributed under the BSD License\r\n * See http://pajhome.org.uk/crypt/md5 for details.\r\n */\n\n\"use strict\";\n\n/*\r\n * Configurable variables. You may need to tweak these to be compatible with\r\n * the server-side, but the defaults work in most cases.\r\n */\n\nvar hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\nvar b64pad = \"\"; /* base-64 pad character. \"=\" for strict RFC compliance */\n\n/*\r\n * These are the functions you'll usually want to call\r\n * They take string arguments and return either hex or base-64 encoded strings\r\n */\nfunction hex_sha1(s) {\n return rstr2hex(rstr_sha1(str2rstr_utf8(s)));\n}\nfunction b64_sha1(s) {\n return rstr2b64(rstr_sha1(str2rstr_utf8(s)));\n}\nfunction any_sha1(s, e) {\n return rstr2any(rstr_sha1(str2rstr_utf8(s)), e);\n}\nfunction hex_hmac_sha1(k, d) {\n return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)));\n}\nfunction b64_hmac_sha1(k, d) {\n return rstr2b64(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)));\n}\nfunction any_hmac_sha1(k, d, e) {\n return rstr2any(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)), e);\n}\n\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\nfunction sha1_vm_test() {\n return hex_sha1(\"abc\").toLowerCase() == \"a9993e364706816aba3e25717850c26c9cd0d89d\";\n}\n\n/*\r\n * Calculate the SHA1 of a raw string\r\n */\nfunction rstr_sha1(s) {\n return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));\n}\n\n/*\r\n * Calculate the HMAC-SHA1 of a key and some data (raw strings)\r\n */\nfunction rstr_hmac_sha1(key, data) {\n var bkey = rstr2binb(key);\n if (bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\n\n var ipad = Array(16),\n opad = Array(16);\n for (var i = 0; i < 16; i++) {\n ipad[i] = bkey[i] ^ 0x36363636;\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\n }\n\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\n}\n\n/*\r\n * Convert a raw string to a hex string\r\n */\nfunction rstr2hex(input) {\n // try { hexcase } catch(e) { hexcase=0; }\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\n var output = \"\";\n var x;\n for (var i = 0; i < input.length; i++) {\n x = input.charCodeAt(i);\n output += hex_tab.charAt(x >>> 4 & 0x0F) + hex_tab.charAt(x & 0x0F);\n }\n return output;\n}\n\n/*\r\n * Convert a raw string to a base-64 string\r\n */\nfunction rstr2b64(input) {\n // try { b64pad } catch(e) { b64pad=''; }\n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var output = \"\";\n var len = input.length;\n for (var i = 0; i < len; i += 3) {\n var triplet = input.charCodeAt(i) << 16 | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);\n for (var j = 0; j < 4; j++) {\n if (i * 8 + j * 6 > input.length * 8) output += b64pad;else output += tab.charAt(triplet >>> 6 * (3 - j) & 0x3F);\n }\n }\n return output;\n}\n\n/*\r\n * Convert a raw string to an arbitrary string encoding\r\n */\nfunction rstr2any(input, encoding) {\n var divisor = encoding.length;\n var remainders = Array();\n var i, q, x, quotient;\n\n /* Convert to an array of 16-bit big-endian values, forming the dividend */\n var dividend = Array(Math.ceil(input.length / 2));\n for (i = 0; i < dividend.length; i++) {\n dividend[i] = input.charCodeAt(i * 2) << 8 | input.charCodeAt(i * 2 + 1);\n }\n\n /*\r\n * Repeatedly perform a long division. The binary array forms the dividend,\r\n * the length of the encoding is the divisor. Once computed, the quotient\r\n * forms the dividend for the next step. We stop when the dividend is zero.\r\n * All remainders are stored for later use.\r\n */\n while (dividend.length > 0) {\n quotient = Array();\n x = 0;\n for (i = 0; i < dividend.length; i++) {\n x = (x << 16) + dividend[i];\n q = Math.floor(x / divisor);\n x -= q * divisor;\n if (quotient.length > 0 || q > 0) quotient[quotient.length] = q;\n }\n remainders[remainders.length] = x;\n dividend = quotient;\n }\n\n /* Convert the remainders to the output string */\n var output = \"\";\n for (i = remainders.length - 1; i >= 0; i--) {\n output += encoding.charAt(remainders[i]);\n } /* Append leading zero equivalents */\n var full_length = Math.ceil(input.length * 8 / (Math.log(encoding.length) / Math.log(2)));\n for (i = output.length; i < full_length; i++) {\n output = encoding[0] + output;\n }return output;\n}\n\n/*\r\n * Encode a string as utf-8.\r\n * For efficiency, this assumes the input is valid utf-16.\r\n */\nfunction str2rstr_utf8(input) {\n var output = \"\";\n var i = -1;\n var x, y;\n\n while (++i < input.length) {\n /* Decode utf-16 surrogate pairs */\n x = input.charCodeAt(i);\n y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;\n if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {\n x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);\n i++;\n }\n\n /* Encode output as utf-8 */\n if (x <= 0x7F) output += String.fromCharCode(x);else if (x <= 0x7FF) output += String.fromCharCode(0xC0 | x >>> 6 & 0x1F, 0x80 | x & 0x3F);else if (x <= 0xFFFF) output += String.fromCharCode(0xE0 | x >>> 12 & 0x0F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);else if (x <= 0x1FFFFF) output += String.fromCharCode(0xF0 | x >>> 18 & 0x07, 0x80 | x >>> 12 & 0x3F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);\n }\n return output;\n}\n\n/*\r\n * Encode a string as utf-16\r\n */\nfunction str2rstr_utf16le(input) {\n var output = \"\";\n for (var i = 0; i < input.length; i++) {\n output += String.fromCharCode(input.charCodeAt(i) & 0xFF, input.charCodeAt(i) >>> 8 & 0xFF);\n }return output;\n}\n\nfunction str2rstr_utf16be(input) {\n var output = \"\";\n for (var i = 0; i < input.length; i++) {\n output += String.fromCharCode(input.charCodeAt(i) >>> 8 & 0xFF, input.charCodeAt(i) & 0xFF);\n }return output;\n}\n\n/*\r\n * Convert a raw string to an array of big-endian words\r\n * Characters >255 have their high-byte silently ignored.\r\n */\nfunction rstr2binb(input) {\n var output = Array(input.length >> 2);\n for (var i = 0; i < output.length; i++) {\n output[i] = 0;\n }for (var i = 0; i < input.length * 8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << 24 - i % 32;\n }return output;\n}\n\n/*\r\n * Convert an array of big-endian words to a string\r\n */\nfunction binb2rstr(input) {\n var output = \"\";\n for (var i = 0; i < input.length * 32; i += 8) {\n output += String.fromCharCode(input[i >> 5] >>> 24 - i % 32 & 0xFF);\n }return output;\n}\n\n/*\r\n * Calculate the SHA-1 of an array of big-endian words, and a bit length\r\n */\nfunction binb_sha1(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << 24 - len % 32;\n x[(len + 64 >> 9 << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for (var j = 0; j < 80; j++) {\n if (j < 16) w[j] = x[i + j];else w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n var t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = bit_rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n}\n\n/*\r\n * Perform the appropriate triplet combination function for the current\r\n * iteration\r\n */\nfunction sha1_ft(t, b, c, d) {\n if (t < 20) return b & c | ~b & d;\n if (t < 40) return b ^ c ^ d;\n if (t < 60) return b & c | b & d | c & d;\n return b ^ c ^ d;\n}\n\n/*\r\n * Determine the appropriate additive constant for the current iteration\r\n */\nfunction sha1_kt(t) {\n return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;\n}\n\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\nfunction safe_add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xFFFF;\n}\n\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\nfunction bit_rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n b64_sha1: b64_sha1,\n hex_sha1: hex_sha1\n };\n}\n\n},{}],39:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// sourceadapters.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var tier = require('./tier');\n var DasTier = tier.DasTier;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var arrayIndexOf = utils.arrayIndexOf;\n var shallowCopy = utils.shallowCopy;\n var resolveUrlToPage = utils.resolveUrlToPage;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASSource = das.DASSource;\n var DASSegment = das.DASSegment;\n var DASFeature = das.DASFeature;\n var DASSequence = das.DASSequence;\n var DASLink = das.DASLink;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n\n var twoBit = require('./twoBit');\n var makeTwoBit = twoBit.makeTwoBit;\n\n var bbi = require('./bigwig');\n var makeBwg = bbi.makeBwg;\n\n var bam = require('./bam');\n var makeBam = bam.makeBam;\n var BamFlags = bam.BamFlags;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n\n var parseCigar = require('./cigar').parseCigar;\n\n var OverlayFeatureSource = require('./overlay').OverlayFeatureSource;\n\n var JBrowseStore = require('./jbjson').JBrowseStore;\n\n var Chainset = require('./chainset').Chainset;\n\n var style = require('./style');\n var StyleFilterSet = style.StyleFilterSet;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nvar __dalliance_sourceAdapterFactories = {};\n\nfunction dalliance_registerSourceAdapterFactory(type, factory) {\n __dalliance_sourceAdapterFactories[type] = factory;\n}\n\nvar __dalliance_parserFactories = {};\n\nfunction dalliance_registerParserFactory(type, factory) {\n __dalliance_parserFactories[type] = factory;\n}\n\nfunction dalliance_makeParser(type) {\n if (__dalliance_parserFactories[type]) {\n return __dalliance_parserFactories[type](type);\n }\n}\n\nDasTier.prototype.initSources = function () {\n var thisTier = this;\n\n var sources = this.browser.createSources(this.dasSource);\n this.featureSource = sources.features || new DummyFeatureSource();\n this.sequenceSource = sources.sequence;\n\n if (this.featureSource && this.featureSource.addChangeListener) {\n this.featureSource.addChangeListener(function () {\n thisTier.browser.refreshTier(thisTier);\n });\n }\n};\n\nBrowser.prototype.createSources = function (config) {\n var sources = this.sourceCache.get(config);\n if (sources) return sources;\n\n var fs, ss;\n\n if (config.tier_type == 'sequence' || config.twoBitURI || config.twoBitBlob) {\n if (config.twoBitURI || config.twoBitBlob) {\n ss = new TwoBitSequenceSource(config);\n } else if (config.ensemblURI) {\n ss = new EnsemblSequenceSource(config);\n } else {\n ss = new DASSequenceSource(config);\n }\n } else if (config.tier_type && __dalliance_sourceAdapterFactories[config.tier_type]) {\n var saf = __dalliance_sourceAdapterFactories[config.tier_type];\n var ns = saf(config);\n fs = ns.features;\n ss = ns.sequence;\n } else if (config.bwgURI || config.bwgBlob) {\n var worker = this.getWorker();\n if (worker) fs = new RemoteBWGFeatureSource(config, worker, this);else fs = new BWGFeatureSource(config);\n } else if (config.bamURI || config.bamBlob) {\n var worker = this.getWorker();\n if (worker) fs = new RemoteBAMFeatureSource(config, worker, this);else fs = new BAMFeatureSource(config);\n } else if (config.jbURI) {\n fs = new JBrowseFeatureSource(config);\n } else if (config.uri || config.features_uri) {\n fs = new DASFeatureSource(config);\n }\n\n if (config.overlay) {\n var sources = [];\n if (fs) sources.push(new CachingFeatureSource(fs));\n\n for (var oi = 0; oi < config.overlay.length; ++oi) {\n var cs = this.createSources(config.overlay[oi]);\n if (cs && cs.features) sources.push(cs.features);\n }\n fs = new OverlayFeatureSource(sources, config);\n }\n\n if (config.sequenceAliases) {\n fs = new MappedFeatureSource(fs, new Chainset({ type: 'alias', sequenceAliases: config.sequenceAliases }));\n }\n\n if (config.mapping) {\n fs = new MappedFeatureSource(fs, this.chains[config.mapping]);\n }\n\n if (config.name && fs && !fs.name) {\n fs.name = config.name;\n }\n\n if (typeof fs !== 'undefined' && fs !== null) {\n fs = new CachingFeatureSource(fs);\n }\n\n if (typeof fs !== 'undefined' && fs !== null || typeof ss !== 'undefined' && ss != null) {\n sources = {\n features: fs,\n sequence: ss\n };\n this.sourceCache.put(config, sources);\n }\n\n return sources;\n};\n\nDasTier.prototype.fetchStylesheet = function (cb) {\n var ssSource;\n // Somewhat ugly workaround for the special case of DAS sources...\n if (this.dasSource.stylesheet_uri || !this.dasSource.tier_type && !this.dasSource.bwgURI && !this.dasSource.bwgBlob && !this.dasSource.bamURI && !this.dasSource.bamBlob && !this.dasSource.twoBitURI && !this.dasSource.twoBitBlob && !this.dasSource.jbURI && !this.dasSource.overlay) {\n ssSource = new DASFeatureSource(this.dasSource);\n } else {\n ssSource = this.getSource();\n }\n ssSource.getStyleSheet(cb);\n};\n\nvar __cfs_id_seed = 0;\n\nfunction CachingFeatureSource(source) {\n var thisB = this;\n\n this.source = source;\n this.cfsid = 'cfs' + ++__cfs_id_seed;\n if (source.name) {\n this.name = source.name;\n }\n if (source.addChangeListener) {\n source.addChangeListener(function () {\n thisB.cfsid = 'cfs' + ++__cfs_id_seed;\n });\n }\n}\n\nCachingFeatureSource.prototype.addReadinessListener = function (listener) {\n if (this.source.addReadinessListener) return this.source.addReadinessListener(listener);else listener(null);\n};\n\nCachingFeatureSource.prototype.removeReadinessListener = function (listener) {\n if (this.source.removeReadinessListener) return this.source.removeReadinessListener(listener);\n};\n\nCachingFeatureSource.prototype.search = function (query, callback) {\n if (this.source.search) return this.source.search(query, callback);\n};\n\nCachingFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.source.getDefaultFIPs) return this.source.getDefaultFIPs(callback);\n};\n\nCachingFeatureSource.prototype.getStyleSheet = function (callback) {\n this.source.getStyleSheet(callback);\n};\n\nCachingFeatureSource.prototype.getScales = function () {\n return this.source.getScales();\n};\n\nCachingFeatureSource.prototype.addActivityListener = function (l) {\n if (this.source.addActivityListener) {\n this.source.addActivityListener(l);\n }\n};\n\nCachingFeatureSource.prototype.removeActivityListener = function (l) {\n if (this.source.removeActivityListener) {\n this.source.removeActivityListener(l);\n }\n};\n\nCachingFeatureSource.prototype.addChangeListener = function (l) {\n if (this.source.addChangeListener) this.source.addChangeListener(l);\n};\n\nCachingFeatureSource.prototype.removeChangeListener = function (l) {\n if (this.source.removeChangeListener) this.source.removeChangeListener(l);\n};\n\nCachingFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n this.source.findNextFeature(chr, pos, dir, callback);\n};\n\nCachingFeatureSource.prototype.quantFindNextFeature = function (chr, pos, dir, threshold, callback) {\n this.source.quantFindNextFeature(chr, pos, dir, threshold, callback);\n};\n\nCachingFeatureSource.prototype.capabilities = function () {\n if (this.source.capabilities) {\n return this.source.capabilities();\n } else {\n return {};\n }\n};\n\nCachingFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback, styleFilters) {\n if (!pool) {\n throw Error('Fetch pool is null');\n }\n\n var self = this;\n var cacheKey = this.cfsid;\n\n var awaitedFeatures = pool.awaitedFeatures[cacheKey];\n if (awaitedFeatures && awaitedFeatures.started) {\n if (awaitedFeatures.styleFilters.doesNotContain(styleFilters)) {\n // console.log('Fetch already started with wrong parameters, skipping cache.');\n self.source.fetch(chr, min, max, scale, types, pool, callback, styleFilters);\n return;\n }\n } else if (awaitedFeatures) {\n awaitedFeatures.styleFilters.addAll(styleFilters);\n } else {\n awaitedFeatures = new Awaited();\n awaitedFeatures.styleFilters = styleFilters;\n pool.awaitedFeatures[cacheKey] = awaitedFeatures;\n\n pool.requestsIssued.then(function () {\n awaitedFeatures.started = true;\n self.source.fetch(chr, min, max, scale, awaitedFeatures.styleFilters.typeList(), pool, function (status, features, scale, coverage) {\n if (!awaitedFeatures.res) awaitedFeatures.provide({ status: status, features: features, scale: scale, coverage: coverage });\n }, awaitedFeatures.styleFilters);\n }).catch(function (err) {\n console.log(err);\n });\n }\n\n awaitedFeatures.await(function (af) {\n callback(af.status, af.features, af.scale, af.coverage);\n });\n};\n\nfunction FeatureSourceBase() {\n this.busy = 0;\n this.activityListeners = [];\n this.readinessListeners = [];\n this.readiness = null;\n}\n\nFeatureSourceBase.prototype.addReadinessListener = function (listener) {\n this.readinessListeners.push(listener);\n listener(this.readiness);\n};\n\nFeatureSourceBase.prototype.removeReadinessListener = function (listener) {\n var idx = arrayIndexOf(this.readinessListeners, listener);\n if (idx >= 0) {\n this.readinessListeners.splice(idx, 1);\n }\n};\n\nFeatureSourceBase.prototype.notifyReadiness = function () {\n for (var li = 0; li < this.readinessListeners.length; ++li) {\n try {\n this.readinessListeners[li](this.readiness);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nFeatureSourceBase.prototype.addActivityListener = function (listener) {\n this.activityListeners.push(listener);\n};\n\nFeatureSourceBase.prototype.removeActivityListener = function (listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0) {\n this.activityListeners.splice(idx, 1);\n }\n};\n\nFeatureSourceBase.prototype.notifyActivity = function () {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nFeatureSourceBase.prototype.getScales = function () {\n return null;\n};\n\nFeatureSourceBase.prototype.fetch = function (chr, min, max, scale, types, pool, cnt) {\n return cnt(null, [], 1000000000);\n};\n\nFeatureSourceBase.prototype.getStyleSheet = function (callback) {\n var stylesheet = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({ type: 'default' }, null, defStyle);\n return callback(stylesheet);\n};\n\nfunction DASFeatureSource(dasSource) {\n this.dasSource = new DASSource(dasSource);\n this.busy = 0;\n this.activityListeners = [];\n}\n\nDASFeatureSource.prototype.addActivityListener = function (listener) {\n this.activityListeners.push(listener);\n};\n\nDASFeatureSource.prototype.removeActivityListener = function (listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0) this.activityListeners.splice(idx, 1);\n};\n\nDASFeatureSource.prototype.notifyActivity = function () {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nDASFeatureSource.prototype.getStyleSheet = function (callback) {\n this.dasSource.stylesheet(function (stylesheet) {\n callback(stylesheet);\n }, function () {\n callback(null, \"Couldn't fetch DAS stylesheet\");\n });\n};\n\nDASFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n if (types && types.length === 0) {\n callback(null, [], scale);\n return;\n }\n\n if (!this.dasSource.uri && !this.dasSource.features_uri) {\n // FIXME should this be making an error callback???\n return;\n }\n\n if (this.dasSource.dasStaticFeatures && this.cachedStaticFeatures) {\n return callback(null, this.cachedStaticFeatures, this.cachedStaticScale);\n }\n\n var tryMaxBins = this.dasSource.maxbins !== false;\n var fops = {\n type: types\n };\n if (tryMaxBins) {\n fops.maxbins = 1 + ((max - min) / scale | 0);\n }\n\n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n\n this.dasSource.features(new DASSegment(chr, min, max), fops, function (features, status) {\n\n thisB.busy--;\n thisB.notifyActivity();\n\n var retScale = scale;\n if (!tryMaxBins) {\n retScale = 0.1;\n }\n if (!status && thisB.dasSource.dasStaticFeatures) {\n thisB.cachedStaticFeatures = features;\n thisB.cachedStaticScale = retScale;\n }\n callback(status, features, retScale);\n });\n};\n\nDASFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n if (this.dasSource.capabilities && arrayIndexOf(this.dasSource.capabilities, 'das1:adjacent-feature') >= 0) {\n var thisB = this;\n if (this.dasAdjLock) {\n return console.log('Already looking for a next feature, be patient!');\n }\n this.dasAdjLock = true;\n var fops = {\n adjacent: chr + ':' + (pos | 0) + ':' + (dir > 0 ? 'F' : 'B')\n };\n var types = thisTier.getDesiredTypes(thisTier.browser.scale);\n if (types) {\n fops.types = types;\n }\n thisTier.dasSource.features(null, fops, function (res) {\n thisB.dasAdjLock = false;\n if (res.length > 0 && res[0] !== null) {\n callback(res[0]);\n }\n });\n }\n};\n\nfunction DASSequenceSource(dasSource) {\n this.dasSource = new DASSource(dasSource);\n this.awaitedEntryPoints = new Awaited();\n\n var thisB = this;\n this.dasSource.entryPoints(function (ep) {\n thisB.awaitedEntryPoints.provide(ep);\n });\n}\n\nDASSequenceSource.prototype.fetch = function (chr, min, max, pool, callback) {\n this.dasSource.sequence(new DASSegment(chr, min, max), function (seqs) {\n if (seqs.length == 1) {\n return callback(null, seqs[0]);\n } else {\n return callback(\"Didn't get sequence\");\n }\n });\n};\n\nDASSequenceSource.prototype.getSeqInfo = function (chr, cnt) {\n this.awaitedEntryPoints.await(function (ep) {\n for (var epi = 0; epi < ep.length; ++epi) {\n if (ep[epi].name == chr) {\n return cnt({ length: ep[epi].end });\n }\n }\n return cnt();\n });\n};\n\nfunction TwoBitSequenceSource(source) {\n var thisB = this;\n this.source = source;\n this.twoBit = new Awaited();\n var data;\n if (source.twoBitURI) {\n data = new URLFetchable(source.twoBitURI, { credentials: source.credentials, resolver: source.resolver });\n } else if (source.twoBitBlob) {\n data = new BlobFetchable(source.twoBitBlob);\n } else {\n throw Error(\"No twoBitURI or twoBitBlob parameter\");\n }\n\n makeTwoBit(data, function (tb, error) {\n if (error) {\n console.log(error);\n } else {\n thisB.twoBit.provide(tb);\n }\n });\n}\n\nTwoBitSequenceSource.prototype.fetch = function (chr, min, max, pool, callback) {\n this.twoBit.await(function (tb) {\n tb.fetch(chr, min, max, function (seq, err) {\n if (err) {\n return callback(err, null);\n } else {\n var sequence = new DASSequence(chr, min, max, 'DNA', seq);\n return callback(null, sequence);\n }\n });\n });\n};\n\nTwoBitSequenceSource.prototype.getSeqInfo = function (chr, cnt) {\n this.twoBit.await(function (tb) {\n var seq = tb.getSeq(chr);\n if (seq) {\n tb.getSeq(chr).length(function (l) {\n cnt({ length: l });\n });\n } else {\n cnt();\n }\n });\n};\n\nfunction EnsemblSequenceSource(source) {\n this.source = source;\n // http://data.gramene.org/ensembl/info/assembly/triticum_aestivum/2B?content-type=application/json\n // http://data.gramene.org/ensembl/sequence/region/triticum_aestivum/2B:8001..18000:1?content-type=application/json\n}\n\nEnsemblSequenceSource.prototype.fetch = function (chr, min, max, pool, callback) {\n var url = this.source.ensemblURI + '/sequence/region/' + this.source.species + '/' + chr + ':' + min + '..' + max + ':1?content-type=application/json';\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n var jr;\n if (req.status >= 300) {\n var err = 'Error code ' + req.status;\n try {\n jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } finally {\n callback(err, null);\n }\n } else {\n jr = JSON.parse(req.response);\n var sequence = new DASSequence(chr, min, max, 'DNA', jr.seq);\n return callback(null, sequence);\n }\n }\n };\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n};\n\nEnsemblSequenceSource.prototype.getSeqInfo = function (chr, cnt) {\n var url = this.source.ensemblURI + '/info/assembly/' + this.source.species + '/' + chr + '?content-type=application/json';\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n if (req.status >= 300) {\n cnt();\n } else {\n var jr = JSON.parse(req.response);\n cnt(jr);\n }\n }\n };\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n};\n\nDASFeatureSource.prototype.getScales = function () {\n return [];\n};\n\nvar bwg_preflights = {};\n\nfunction BWGFeatureSource(bwgSource) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.readiness = 'Connecting';\n this.bwgSource = this.opts = bwgSource;\n thisB.bwgHolder = new Awaited();\n\n if (this.opts.preflight) {\n var pfs = bwg_preflights[this.opts.preflight];\n if (!pfs) {\n pfs = new Awaited();\n bwg_preflights[this.opts.preflight] = pfs;\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n if (req.status == 200) {\n pfs.provide('success');\n } else {\n pfs.provide('failure');\n }\n }\n };\n req.open('get', this.opts.preflight + '?' + hex_sha1('salt' + Date.now()), true); // Instead, ensure we always preflight a unique URI.\n if (this.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n }\n pfs.await(function (status) {\n if (status === 'success') {\n thisB.init();\n }\n });\n } else {\n thisB.init();\n }\n}\n\nBWGFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nBWGFeatureSource.prototype.init = function () {\n var thisB = this;\n var arg;\n\n var uri = this.bwgSource.uri || this.bwgSource.bwgURI;\n if (uri) {\n if (this.bwgSource.transport === 'encode') {\n arg = new EncodeFetchable(uri, { credentials: this.opts.credentials });\n } else {\n arg = new URLFetchable(uri, { credentials: this.opts.credentials, resolver: this.opts.resolver });\n }\n } else {\n arg = new BlobFetchable(this.bwgSource.bwgBlob);\n }\n\n makeBwg(arg, function (bwg, err) {\n if (err) {\n thisB.error = err;\n thisB.readiness = null;\n thisB.notifyReadiness();\n thisB.bwgHolder.provide(null);\n } else {\n thisB.bwgHolder.provide(bwg);\n thisB.readiness = null;\n thisB.notifyReadiness();\n if (bwg.type == 'bigbed') {\n bwg.getExtraIndices(function (ei) {\n thisB.extraIndices = ei;\n });\n }\n }\n });\n};\n\nBWGFeatureSource.prototype.capabilities = function () {\n var caps = { leap: true };\n if (this.bwgHolder.res && this.bwgHolder.res.type == 'bigwig') caps.quantLeap = true;\n if (this.extraIndices && this.extraIndices.length > 0) {\n caps.search = [];\n for (var eii = 0; eii < this.extraIndices.length; ++eii) {\n caps.search.push(this.extraIndices[eii].field);\n }\n }\n return caps;\n};\n\nBWGFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n this.bwgHolder.await(function (bwg) {\n if (typeof bwg === 'undefined' || bwg === null) {\n return callback(thisB.error || \"Can't access binary file\", null, null);\n }\n\n var data;\n var wantDensity = !types || types.length === 0 || arrayIndexOf(types, 'density') >= 0;\n if (thisB.opts.clientBin) {\n wantDensity = false;\n }\n var scaleFactor = thisB.opts.scaleFactor || 1.0;\n if (bwg.type == 'bigwig' || wantDensity || typeof thisB.opts.forceReduction !== 'undefined') {\n var zoom = -1;\n for (var z = 0; z < bwg.zoomLevels.length; ++z) {\n if (bwg.zoomLevels[z].reduction <= scale * scaleFactor) {\n zoom = z;\n } else {\n break;\n }\n }\n if (typeof thisB.opts.forceReduction !== 'undefined') {\n zoom = thisB.opts.forceReduction;\n }\n\n if (zoom < 0) {\n data = bwg.getUnzoomedView();\n } else {\n data = bwg.getZoomedView(zoom);\n }\n } else {\n data = bwg.getUnzoomedView();\n }\n\n thisB.busy++;\n thisB.notifyActivity();\n data.readWigData(chr, min, max, function (features) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var fs = 1000000000;\n if (bwg.type === 'bigwig') {\n var is = (max - min) / features.length / 2;\n if (is < fs) {\n fs = is;\n }\n }\n if (thisB.opts.link) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.label) {\n f.links = [new DASLink('Link', thisB.opts.link.replace(/\\$\\$/, f.label))];\n }\n }\n }\n callback(null, features, fs);\n });\n });\n};\n\nBWGFeatureSource.prototype.quantFindNextFeature = function (chr, pos, dir, threshold, callback) {\n // var beforeQFNF = Date.now()|0;\n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n this.bwgHolder.res.thresholdSearch(chr, pos, dir, threshold, function (a, b) {\n thisB.busy--;\n thisB.notifyActivity();\n // var afterQFNF = Date.now()|0;\n // console.log('QFNF took ' + (afterQFNF - beforeQFNF) + 'ms');\n return callback(a, b);\n });\n};\n\nBWGFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n this.bwgHolder.res.getUnzoomedView().getFirstAdjacent(chr, pos, dir, function (res) {\n thisB.busy--;\n thisB.notifyActivity();\n if (res.length > 0 && res[0] !== null) {\n callback(res[0]);\n }\n });\n};\n\nBWGFeatureSource.prototype.getScales = function () {\n var bwg = this.bwgHolder.res;\n if (bwg /* && bwg.type == 'bigwig' */) {\n var scales = [1]; // Can we be smarter about inferring baseline scale?\n for (var z = 0; z < bwg.zoomLevels.length; ++z) {\n scales.push(bwg.zoomLevels[z].reduction);\n }\n return scales;\n } else {\n return null;\n }\n};\n\nBWGFeatureSource.prototype.search = function (query, callback) {\n if (!this.extraIndices || this.extraIndices.length === 0) {\n return callback(null, 'No indices available');\n }\n\n var index = this.extraIndices[0];\n return index.lookup(query, callback);\n};\n\nBWGFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.opts.noExtraFeatureInfo) return true;\n\n this.bwgHolder.await(function (bwg) {\n if (!bwg) return;\n\n if (bwg.schema && bwg.definedFieldCount < bwg.schema.fields.length) {\n var fip = function fip(feature, featureInfo) {\n for (var hi = 0; hi < featureInfo.hit.length; ++hi) {\n if (featureInfo.hit[hi].isSuperGroup) return;\n }\n for (var fi = bwg.definedFieldCount; fi < bwg.schema.fields.length; ++fi) {\n var f = bwg.schema.fields[fi];\n featureInfo.add(f.comment, feature[f.name]);\n }\n };\n\n callback(fip);\n } else {\n // No need to do anything.\n }\n });\n};\n\nBWGFeatureSource.prototype.getStyleSheet = function (callback) {\n var thisB = this;\n\n this.bwgHolder.await(function (bwg) {\n if (!bwg) {\n return callback(null, 'bbi error');\n }\n\n var stylesheet = new DASStylesheet();\n if (bwg.type == 'bigbed') {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'bigbed' }, null, wigStyle);\n\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'red';\n wigStyle.HEIGHT = 10;\n wigStyle.BUMP = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'translation' }, null, wigStyle);\n\n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'white';\n densStyle.COLOR2 = 'black';\n densStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'density' }, null, densStyle);\n } else {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'HISTOGRAM';\n wigStyle.COLOR1 = 'white';\n wigStyle.COLOR2 = 'black';\n wigStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n }\n\n if (bwg.definedFieldCount == 12 && bwg.fieldCount >= 14) {\n stylesheet.geneHint = true;\n }\n\n return callback(stylesheet);\n });\n};\n\nfunction RemoteBWGFeatureSource(bwgSource, worker, browser) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.worker = worker;\n this.readiness = 'Connecting';\n this.bwgSource = this.opts = bwgSource;\n this.keyHolder = new Awaited();\n\n if (bwgSource.resolver) {\n this.resolverKey = browser.registerResolver(bwgSource.resolver);\n }\n\n this.init();\n}\n\nRemoteBWGFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nRemoteBWGFeatureSource.prototype.init = function () {\n var thisB = this;\n var uri = this.uri || this.bwgSource.uri || this.bwgSource.bwgURI;\n var blob = this.bwgSource.blob || this.bwgSource.bwgBlob;\n\n var cnt = function cnt(key, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (key) {\n thisB.worker.postCommand({ command: 'meta', connection: key }, function (meta, err) {\n if (err) {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n } else {\n thisB.meta = meta;\n thisB.keyHolder.provide(key);\n }\n });\n } else {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n }\n };\n\n if (blob) {\n this.worker.postCommand({ command: 'connectBBI', blob: blob }, cnt);\n } else {\n this.worker.postCommand({\n command: 'connectBBI',\n uri: resolveUrlToPage(uri),\n resolver: this.resolverKey,\n transport: this.bwgSource.transport,\n credentials: this.bwgSource.credentials }, cnt);\n }\n};\n\nRemoteBWGFeatureSource.prototype.capabilities = function () {\n var caps = { leap: true };\n\n if (this.meta && this.meta.type == 'bigwig') caps.quantLeap = true;\n if (this.meta && this.meta.extraIndices && this.meta.extraIndices.length > 0) {\n caps.search = [];\n for (var eii = 0; eii < this.meta.extraIndices.length; ++eii) {\n caps.search.push(this.meta.extraIndices[eii].field);\n }\n }\n return caps;\n};\n\nRemoteBWGFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.keyHolder.await(function (key) {\n if (!key) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Can't access binary file\", null, null);\n }\n\n var zoom = -1;\n var wantDensity = !types || types.length === 0 || arrayIndexOf(types, 'density') >= 0;\n if (thisB.opts.clientBin) {\n wantDensity = false;\n }\n if (thisB.meta.type == 'bigwig' || wantDensity || typeof thisB.opts.forceReduction !== 'undefined') {\n for (var z = 1; z < thisB.meta.zoomLevels.length; ++z) {\n if (thisB.meta.zoomLevels[z] <= scale) {\n zoom = z - 1; // Scales returned in metadata start at 1, unlike \"real\" zoom levels.\n } else {\n break;\n }\n }\n if (typeof thisB.opts.forceReduction !== 'undefined') {\n zoom = thisB.opts.forceReduction;\n }\n }\n\n thisB.worker.postCommand({ command: 'fetch', connection: key, chr: chr, min: min, max: max, zoom: zoom }, function (features, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var fs = 1000000000;\n if (thisB.meta.type === 'bigwig') {\n var is = (max - min) / features.length / 2;\n if (is < fs) {\n fs = is;\n }\n }\n if (thisB.opts.link) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.label) {\n f.links = [new DASLink('Link', thisB.opts.link.replace(/\\$\\$/, f.label))];\n }\n }\n }\n callback(error, features, fs);\n });\n });\n};\n\nRemoteBWGFeatureSource.prototype.quantFindNextFeature = function (chr, pos, dir, threshold, callback) {\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n this.worker.postCommand({ command: 'quantLeap', connection: this.keyHolder.res, chr: chr, pos: pos, dir: dir, threshold: threshold, under: false }, function (result, err) {\n console.log(result, err);\n thisB.busy--;\n thisB.notifyActivity();\n return callback(result, err);\n });\n};\n\nRemoteBWGFeatureSource.prototype.findNextFeature = function (chr, pos, dir, callback) {\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n this.worker.postCommand({ command: 'leap', connection: this.keyHolder.res, chr: chr, pos: pos, dir: dir }, function (result, err) {\n thisB.busy--;\n thisB.notifyActivity();\n if (result.length > 0 && result[0] !== null) {\n callback(result[0]);\n }\n });\n};\n\nRemoteBWGFeatureSource.prototype.getScales = function () {\n var meta = this.meta;\n if (meta) {\n return meta.zoomLevels;\n } else {\n return null;\n }\n};\n\nRemoteBWGFeatureSource.prototype.search = function (query, callback) {\n if (!this.meta.extraIndices || this.meta.extraIndices.length === 0) {\n return callback(null, 'No indices available');\n }\n\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n var index = this.meta.extraIndices[0];\n this.worker.postCommand({ command: 'search', connection: this.keyHolder.res, query: query, index: index }, function (result, err) {\n thisB.busy--;\n thisB.notifyActivity();\n\n callback(result, err);\n });\n};\n\nRemoteBWGFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.opts.noExtraFeatureInfo) return true;\n\n var thisB = this;\n this.keyHolder.await(function (key) {\n var bwg = thisB.meta;\n if (!bwg) return;\n\n if (bwg.schema && bwg.definedFieldCount < bwg.schema.fields.length) {\n var fip = function fip(feature, featureInfo) {\n for (var hi = 0; hi < featureInfo.hit.length; ++hi) {\n if (featureInfo.hit[hi].isSuperGroup) return;\n }\n for (var fi = bwg.definedFieldCount; fi < bwg.schema.fields.length; ++fi) {\n var f = bwg.schema.fields[fi];\n featureInfo.add(f.comment, feature[f.name]);\n }\n };\n\n callback(fip);\n } else {\n // No need to do anything.\n }\n });\n};\n\nRemoteBWGFeatureSource.prototype.getStyleSheet = function (callback) {\n var thisB = this;\n\n this.keyHolder.await(function (key) {\n var bwg = thisB.meta;\n if (!bwg) {\n return callback(null, 'bbi error');\n }\n\n var stylesheet = new DASStylesheet();\n if (bwg.type == 'bigbed') {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'bigbed' }, null, wigStyle);\n\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'red';\n wigStyle.HEIGHT = 10;\n wigStyle.BUMP = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'translation' }, null, wigStyle);\n\n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'white';\n densStyle.COLOR2 = 'black';\n densStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'density' }, null, densStyle);\n } else {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'HISTOGRAM';\n wigStyle.COLOR1 = 'white';\n wigStyle.COLOR2 = 'black';\n wigStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n }\n\n if (bwg.definedFieldCount == 12 && bwg.fieldCount >= 14) {\n stylesheet.geneHint = true;\n }\n\n return callback(stylesheet);\n });\n};\n\nfunction bamRecordToFeature(r, group) {\n if (r.flag & BamFlags.SEGMENT_UNMAPPED) return;\n\n var len;\n if (r.seq) len = r.seq.length;else len = r.seqLength;\n\n if (r.cigar) {\n len = 0;\n var ops = parseCigar(r.cigar);\n for (var ci = 0; ci < ops.length; ++ci) {\n var co = ops[ci];\n if (co.op == 'M' || co.op == 'D') len += co.cnt;\n }\n }\n\n var f = new DASFeature();\n f.min = r.pos + 1;\n f.max = r.pos + len;\n f.segment = r.segment;\n f.type = 'bam';\n f.id = r.readName;\n f.notes = [/* 'Sequence=' + r.seq, 'CIGAR=' + r.cigar, */'MQ=' + r.mq];\n f.cigar = r.cigar;\n f.seq = r.seq;\n f.quals = r.quals;\n f.orientation = r.flag & BamFlags.REVERSE_COMPLEMENT ? '-' : '+';\n f.bamRecord = r;\n\n if (group && r.flag & BamFlags.MULTIPLE_SEGMENTS) {\n f.groups = [{ id: r.readName,\n type: 'readpair' }];\n }\n\n return f;\n}\n\nfunction BAMFeatureSource(bamSource) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.bamSource = bamSource;\n this.opts = { credentials: bamSource.credentials, preflight: bamSource.preflight, bamGroup: bamSource.bamGroup };\n this.bamHolder = new Awaited();\n\n if (this.opts.preflight) {\n var pfs = bwg_preflights[this.opts.preflight];\n if (!pfs) {\n pfs = new Awaited();\n bwg_preflights[this.opts.preflight] = pfs;\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n if (req.status == 200) {\n pfs.provide('success');\n } else {\n pfs.provide('failure');\n }\n }\n };\n // req.setRequestHeader('cache-control', 'no-cache'); /* Doesn't work, not an allowed request header in CORS */\n req.open('get', this.opts.preflight + '?' + hex_sha1('salt' + Date.now()), true); // Instead, ensure we always preflight a unique URI.\n if (this.opts.credentials) {\n req.withCredentials = 'true';\n }\n req.send();\n }\n pfs.await(function (status) {\n if (status === 'success') {\n thisB.init();\n }\n });\n } else {\n thisB.init();\n }\n}\n\nBAMFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nBAMFeatureSource.prototype.init = function () {\n var thisB = this;\n var bamF, baiF;\n if (this.bamSource.bamBlob) {\n bamF = new BlobFetchable(this.bamSource.bamBlob);\n baiF = new BlobFetchable(this.bamSource.baiBlob);\n } else {\n bamF = new URLFetchable(this.bamSource.bamURI, { credentials: this.opts.credentials, resolver: this.opts.resolver });\n baiF = new URLFetchable(this.bamSource.baiURI || this.bamSource.bamURI + '.bai', { credentials: this.opts.credentials, resolver: this.opts.resolver });\n }\n makeBam(bamF, baiF, null, function (bam, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (bam) {\n thisB.bamHolder.provide(bam);\n } else {\n thisB.error = err;\n thisB.bamHolder.provide(null);\n }\n });\n};\n\nBAMFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var light = types && types.length == 1 && types[0] == 'density';\n\n var thisB = this;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.bamHolder.await(function (bam) {\n if (!bam) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Couldn't fetch BAM\");\n }\n\n bam.fetch(chr, min, max, function (bamRecords, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n if (error) {\n callback(error, null, null);\n } else {\n var features = [];\n for (var ri = 0; ri < bamRecords.length; ++ri) {\n var r = bamRecords[ri];\n\n var f = bamRecordToFeature(r, thisB.opts.bamGroup);\n if (f) features.push(f);\n }\n callback(null, features, 1000000000);\n }\n }, { light: light });\n });\n};\n\nBAMFeatureSource.prototype.getScales = function () {\n return 1000000000;\n};\n\nBAMFeatureSource.prototype.getStyleSheet = function (callback) {\n this.bamHolder.await(function (bam) {\n var stylesheet = new DASStylesheet();\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'black';\n densStyle.COLOR2 = 'red';\n densStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'density' }, 'low', densStyle);\n stylesheet.pushStyle({ type: 'density' }, 'medium', densStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = '__SEQUENCE';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'bam' }, 'high', wigStyle);\n\n return callback(stylesheet);\n });\n};\n\nfunction RemoteBAMFeatureSource(bamSource, worker) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.bamSource = bamSource;\n this.worker = worker;\n this.opts = { credentials: bamSource.credentials, preflight: bamSource.preflight, bamGroup: bamSource.bamGroup };\n this.keyHolder = new Awaited();\n\n if (bamSource.resolver) {\n this.resolverKey = browser.registerResolver(bamSource.resolver);\n }\n\n this.init();\n}\n\nRemoteBAMFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nRemoteBAMFeatureSource.prototype.init = function () {\n var thisB = this;\n var uri = this.bamSource.uri || this.bamSource.bamURI;\n var indexUri = this.bamSource.indexUri || this.bamSource.baiURI || uri + '.bai';\n\n var blob = this.bamSource.bamBlob || this.bamSource.blob;\n var indexBlob = this.bamSource.baiBlob || this.bamSource.indexBlob;\n\n var cnt = function cnt(result, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (result) {\n thisB.keyHolder.provide(result);\n } else {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n }\n };\n\n if (blob) {\n this.worker.postCommand({ command: 'connectBAM', blob: blob, indexBlob: indexBlob }, cnt);\n } else {\n this.worker.postCommand({\n command: 'connectBAM',\n uri: resolveUrlToPage(uri),\n resolver: this.resolverKey,\n indexUri: resolveUrlToPage(indexUri),\n credentials: this.bamSource.credentials,\n indexChunks: this.bamSource.indexChunks }, cnt);\n }\n};\n\nRemoteBAMFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var light = types && types.length == 1 && types[0] == 'density';\n var thisB = this;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.keyHolder.await(function (key) {\n if (!key) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Couldn't fetch BAM\");\n }\n\n thisB.worker.postCommand({ command: 'fetch', connection: key, chr: chr, min: min, max: max, opts: { light: light } }, function (bamRecords, error) {\n // console.log('retrieved ' + bamRecords.length + ' via worker.');\n\n thisB.busy--;\n thisB.notifyActivity();\n\n if (error) {\n callback(error, null, null);\n } else {\n var features = [];\n for (var ri = 0; ri < bamRecords.length; ++ri) {\n var r = bamRecords[ri];\n var f = bamRecordToFeature(r, thisB.opts.bamGroup);\n if (f) features.push(f);\n }\n callback(null, features, 1000000000);\n }\n });\n });\n};\n\nRemoteBAMFeatureSource.prototype.getScales = function () {\n return 1000000000;\n};\n\nRemoteBAMFeatureSource.prototype.getStyleSheet = function (callback) {\n this.keyHolder.await(function (bam) {\n var stylesheet = new DASStylesheet();\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'black';\n densStyle.COLOR2 = 'red';\n densStyle.HEIGHT = 30;\n stylesheet.pushStyle({ type: 'density' }, 'low', densStyle);\n stylesheet.pushStyle({ type: 'density' }, 'medium', densStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = '__SEQUENCE';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'bam' }, 'high', wigStyle);\n return callback(stylesheet);\n });\n};\n\nfunction MappedFeatureSource(source, mapping) {\n this.source = source;\n this.mapping = mapping;\n\n this.activityListeners = [];\n this.busy = 0;\n}\n\nMappedFeatureSource.prototype.addActivityListener = function (listener) {\n this.activityListeners.push(listener);\n};\n\nMappedFeatureSource.prototype.removeActivityListener = function (listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0) this.activityListeners.splice(idx, 0);\n};\n\nMappedFeatureSource.prototype.notifyActivity = function () {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nMappedFeatureSource.prototype.getStyleSheet = function (callback) {\n return this.source.getStyleSheet(callback);\n};\n\nMappedFeatureSource.prototype.getScales = function () {\n return this.source.getScales();\n};\n\nMappedFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.source.getDefaultFIPs) return this.source.getDefaultFIPs(callback);\n};\n\nMappedFeatureSource.prototype.simplifySegments = function (segs, minGap) {\n if (segs.length === 0) return segs;\n\n segs.sort(function (s1, s2) {\n var d = s1.name - s2.name;\n if (d) return d;\n d = s1.start - s2.start;\n if (d) return d;\n return s1.end - s2.end; // Should never come to this...?\n });\n\n var ssegs = [];\n var currentSeg = segs[0];\n for (var si = 0; si < segs.length; ++si) {\n var ns = segs[si];\n\n // console.log(ns.name + ' ' + ns.start + ' ' + ns.end);\n if (ns.name != currentSeg.name || ns.start > currentSeg.end + minGap) {\n ssegs.push(currentSeg);\n currentSeg = ns;\n } else {\n currentSeg = new DASSegment(currentSeg.name, Math.min(currentSeg.start, ns.start), Math.max(currentSeg.end, ns.end));\n }\n }\n ssegs.push(currentSeg);\n return ssegs;\n};\n\nMappedFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback, styleFilters) {\n var thisB = this;\n var fetchLength = max - min + 1;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.mapping.sourceBlocksForRange(chr, min, max, function (mseg) {\n if (mseg.length === 0) {\n thisB.busy--;\n thisB.notifyActivity();\n\n callback(\"No mapping available for this regions\", [], scale);\n } else {\n mseg = thisB.simplifySegments(mseg, Math.max(100, 0.05 * fetchLength));\n\n var mappedFeatures = [];\n var mappedLoc = null;\n var count = mseg.length;\n var finalStatus;\n\n mseg.map(function (seg) {\n thisB.source.fetch(seg.name, seg.start, seg.end, scale, types, pool, function (status, features, fscale) {\n if (status && !finalStatus) finalStatus = status;\n\n if (features) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n var sn = f.segment;\n if (sn.indexOf('chr') === 0) {\n sn = sn.substr(3);\n }\n\n var mappings = thisB.mapping.mapSegment(sn, f.min, f.max);\n\n if (mappings.length === 0) {\n if (f.parts && f.parts.length > 0) {\n mappedFeatures.push(f);\n }\n } else {\n for (var mi = 0; mi < mappings.length; ++mi) {\n var m = mappings[mi];\n var mf = shallowCopy(f);\n mf.segment = m.segment;\n mf.min = m.min;\n mf.max = m.max;\n if (m.partialMin) mf.partialMin = m.partialMin;\n if (m.partialMax) mf.partialMax = m.partialMax;\n\n if (m.flipped) {\n if (f.orientation == '-') {\n mf.orientation = '+';\n } else if (f.orientation == '+') {\n mf.orientation = '-';\n }\n }\n mappedFeatures.push(mf);\n }\n }\n }\n }\n\n var m1 = thisB.mapping.mapPoint(seg.name, seg.start);\n var m2 = thisB.mapping.mapPoint(seg.name, seg.end);\n\n if (m1 && m2) {\n var segDestCoverage = new Range(m1.pos, m2.pos);\n if (mappedLoc) mappedLoc = union(mappedLoc, segDestCoverage);else mappedLoc = segDestCoverage;\n }\n\n --count;\n if (count === 0) {\n thisB.busy--;\n thisB.notifyActivity();\n callback(finalStatus, mappedFeatures, fscale, mappedLoc);\n }\n }, styleFilters);\n });\n }\n });\n};\n\nfunction DummyFeatureSource() {}\n\nDummyFeatureSource.prototype.getScales = function () {\n return null;\n};\n\nDummyFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, cnt) {\n return cnt(null, [], 1000000000);\n};\n\nDummyFeatureSource.prototype.getStyleSheet = function (callback) {\n var stylesheet = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({ type: 'default' }, null, defStyle);\n return callback(stylesheet);\n};\n\nfunction DummySequenceSource() {}\n\nDummySequenceSource.prototype.fetch = function (chr, min, max, pool, cnt) {\n return cnt(null, null);\n};\n\nfunction JBrowseFeatureSource(source) {\n this.store = new JBrowseStore(source.jbURI, source.jbQuery);\n}\n\nJBrowseFeatureSource.prototype.getScales = function () {\n return null;\n};\n\nJBrowseFeatureSource.prototype.getStyleSheet = function (callback) {\n var stylesheet = new DASStylesheet();\n\n var cdsStyle = new DASStyle();\n cdsStyle.glyph = 'BOX';\n cdsStyle.FGCOLOR = 'black';\n cdsStyle.BGCOLOR = 'red';\n cdsStyle.HEIGHT = 10;\n cdsStyle.BUMP = true;\n cdsStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'translation' }, null, cdsStyle);\n\n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'green';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n\n return callback(stylesheet);\n};\n\nJBrowseFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n if (types && types.length === 0) {\n callback(null, [], scale);\n return;\n }\n\n var fops = {};\n\n this.store.features(new DASSegment(chr, min, max), fops, function (features, status) {\n callback(status, features, 100000);\n });\n};\n\nBrowser.prototype.sourceAdapterIsCapable = function (s, cap) {\n if (!s.capabilities) return false;else return s.capabilities()[cap];\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n FeatureSourceBase: FeatureSourceBase,\n\n TwoBitSequenceSource: TwoBitSequenceSource,\n EnsemblSequenceSource: EnsemblSequenceSource,\n DASSequenceSource: DASSequenceSource,\n MappedFeatureSource: MappedFeatureSource,\n CachingFeatureSource: CachingFeatureSource,\n BWGFeatureSource: BWGFeatureSource,\n RemoteBWGFeatureSource: RemoteBWGFeatureSource,\n BAMFeatureSource: BAMFeatureSource,\n RemoteBAMFeatureSource: RemoteBAMFeatureSource,\n DummyFeatureSource: DummyFeatureSource,\n DummySequenceSource: DummySequenceSource,\n\n registerSourceAdapterFactory: dalliance_registerSourceAdapterFactory,\n registerParserFactory: dalliance_registerParserFactory,\n makeParser: dalliance_makeParser\n };\n\n // Standard set of plugins.\n require('./ensembljson');\n //---START MOLGENIS CUSTOM CODE---\n require('./molgenisjson');\n //---END MOLGENIS CUSTOM CODE---\n require('./tabix-source');\n require('./memstore');\n require('./bedwig');\n require('./vcf');\n require('./test-source');\n}\n\n},{\"./bam\":1,\"./bedwig\":2,\"./bigwig\":3,\"./bin\":4,\"./cbrowser\":6,\"./chainset\":7,\"./cigar\":8,\"./das\":10,\"./encode\":14,\"./ensembljson\":15,\"./jbjson\":24,\"./memstore\":27,\"./molgenisjson\":28,\"./overlay\":31,\"./spans\":41,\"./style\":42,\"./tabix-source\":46,\"./test-source\":48,\"./tier\":52,\"./twoBit\":55,\"./utils\":56,\"./vcf\":57}],40:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2015\n//\n// sourcecompare.js\n//\n\n\nfunction sourceDataURI(conf) {\n if (conf.uri) {\n return conf.uri;\n } else if (conf.blob) {\n return 'file:' + conf.blob.name;\n } else if (conf.bwgBlob) {\n return 'file:' + conf.bwgBlob.name;\n } else if (conf.bamBlob) {\n return 'file:' + conf.bamBlob.name;\n } else if (conf.twoBitBlob) {\n return 'file:' + conf.twoBitBlob.name;\n }\n\n return conf.bwgURI || conf.bamURI || conf.jbURI || conf.twoBitURI || 'https://www.biodalliance.org/magic/no_uri';\n}\n\nfunction sourceStyleURI(conf) {\n if (conf.stylesheet_uri) return conf.stylesheet_uri;else if (conf.tier_type == 'sequence' || conf.twoBitURI || conf.twoBitBlob) return 'https://www.biodalliance.org/magic/sequence';else return sourceDataURI(conf);\n}\n\nfunction sourcesAreEqualModuloStyle(a, b) {\n if (sourceDataURI(a) != sourceDataURI(b)) return false;\n\n if (a.mapping != b.mapping) return false;\n\n if (a.tier_type != b.tier_type) return false;\n\n if (a.overlay) {\n if (!b.overlay || b.overlay.length != a.overlay.length) return false;\n for (var oi = 0; oi < a.overlay.length; ++oi) {\n if (!sourcesAreEqualModuloStyle(a.overlay[oi], b.overlay[oi])) return false;\n }\n } else {\n if (b.overlay) return false;\n }\n\n return true;\n}\n\nfunction sourcesAreEqual(a, b) {\n if (sourceDataURI(a) != sourceDataURI(b) || sourceStyleURI(a) != sourceStyleURI(b)) return false;\n\n if (a.mapping != b.mapping) return false;\n\n if (a.tier_type != b.tier_type) return false;\n\n if (a.overlay) {\n if (!b.overlay || b.overlay.length != a.overlay.length) return false;\n for (var oi = 0; oi < a.overlay.length; ++oi) {\n if (!sourcesAreEqual(a.overlay[oi], b.overlay[oi])) return false;\n }\n } else {\n if (b.overlay) return false;\n }\n\n return true;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n sourcesAreEqual: sourcesAreEqual,\n sourcesAreEqualModuloStyle: sourcesAreEqualModuloStyle,\n sourceDataURI: sourceDataURI,\n sourceStyleURI: sourceStyleURI\n };\n}\n\n},{}],41:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// spans.js: JavaScript Intset/Location port.\n//\n\n\"use strict\";\n\nfunction Range(min, max) {\n if (typeof min != 'number' || typeof max != 'number') throw 'Bad range ' + min + ',' + max;\n this._min = min;\n this._max = max;\n}\n\nRange.prototype.min = function () {\n return this._min;\n};\n\nRange.prototype.max = function () {\n return this._max;\n};\n\nRange.prototype.contains = function (pos) {\n return pos >= this._min && pos <= this._max;\n};\n\nRange.prototype.isContiguous = function () {\n return true;\n};\n\nRange.prototype.ranges = function () {\n return [this];\n};\n\nRange.prototype._pushRanges = function (ranges) {\n ranges.push(this);\n};\n\nRange.prototype.toString = function () {\n return '[' + this._min + '-' + this._max + ']';\n};\n\nfunction _Compound(ranges) {\n // given: a set of unsorted possibly overlapping ranges\n // sort the input ranges\n var sorted = ranges.sort(_rangeOrder);\n // merge overlaps between adjacent ranges\n var merged = [];\n var current = sorted.shift();\n sorted.forEach(function (range) {\n if (range._min <= current._max) {\n if (range._max > current._max) {\n current._max = range._max;\n }\n } else {\n merged.push(current);\n current = range;\n }\n });\n merged.push(current);\n this._ranges = merged;\n}\n\n_Compound.prototype.min = function () {\n return this._ranges[0].min();\n};\n\n_Compound.prototype.max = function () {\n return this._ranges[this._ranges.length - 1].max();\n};\n\n// returns the index of the first range that is not less than pos\n_Compound.prototype.lower_bound = function (pos) {\n // first check if pos is out of range\n var r = this.ranges();\n if (pos > this.max()) return r.length;\n if (pos < this.min()) return 0;\n // do a binary search\n var a = 0,\n b = r.length - 1;\n while (a <= b) {\n var m = Math.floor((a + b) / 2);\n if (pos > r[m]._max) {\n a = m + 1;\n } else if (pos < r[m]._min) {\n b = m - 1;\n } else {\n return m;\n }\n }\n return a;\n};\n\n_Compound.prototype.contains = function (pos) {\n var lb = this.lower_bound(pos);\n if (lb < this._ranges.length && this._ranges[lb].contains(pos)) {\n return true;\n }\n return false;\n};\n\n_Compound.prototype.insertRange = function (range) {\n var lb = this.lower_bound(range._min);\n if (lb === this._ranges.length) {\n // range follows this\n this._ranges.push(range);\n return;\n }\n\n var r = this.ranges();\n if (range._max < r[lb]._min) {\n // range preceeds lb\n this._ranges.splice(lb, 0, range);\n return;\n }\n\n // range overlaps lb (at least)\n if (r[lb]._min < range._min) range._min = r[lb]._min;\n var ub = lb + 1;\n while (ub < r.length && r[ub]._min <= range._max) {\n ub++;\n }\n ub--;\n // ub is the upper bound of the new range\n if (r[ub]._max > range._max) range._max = r[ub]._max;\n\n // splice range into this._ranges\n this._ranges.splice(lb, ub - lb + 1, range);\n return;\n};\n\n_Compound.prototype.isContiguous = function () {\n return this._ranges.length > 1;\n};\n\n_Compound.prototype.ranges = function () {\n return this._ranges;\n};\n\n_Compound.prototype._pushRanges = function (ranges) {\n for (var ri = 0; ri < this._ranges.length; ++ri) {\n ranges.push(this._ranges[ri]);\n }\n};\n\n_Compound.prototype.toString = function () {\n var s = '';\n for (var r = 0; r < this._ranges.length; ++r) {\n if (r > 0) {\n s = s + ',';\n }\n s = s + this._ranges[r].toString();\n }\n return s;\n};\n\nfunction union(s0, s1) {\n if (!(s0 instanceof _Compound)) {\n if (!(s0 instanceof Array)) s0 = [s0];\n s0 = new _Compound(s0);\n }\n\n if (s1) s0.insertRange(s1);\n\n return s0;\n}\n\nfunction intersection(s0, s1) {\n var r0 = s0.ranges();\n var r1 = s1.ranges();\n var l0 = r0.length,\n l1 = r1.length;\n var i0 = 0,\n i1 = 0;\n var or = [];\n\n while (i0 < l0 && i1 < l1) {\n var s0 = r0[i0],\n s1 = r1[i1];\n var lapMin = Math.max(s0.min(), s1.min());\n var lapMax = Math.min(s0.max(), s1.max());\n if (lapMax >= lapMin) {\n or.push(new Range(lapMin, lapMax));\n }\n if (s0.max() > s1.max()) {\n ++i1;\n } else {\n ++i0;\n }\n }\n\n if (or.length == 0) {\n return null; // FIXME\n } else if (or.length == 1) {\n return or[0];\n } else {\n return new _Compound(or);\n }\n}\n\nfunction coverage(s) {\n var tot = 0;\n var rl = s.ranges();\n for (var ri = 0; ri < rl.length; ++ri) {\n var r = rl[ri];\n tot += r.max() - r.min() + 1;\n }\n return tot;\n}\n\nfunction rangeOrder(a, b) {\n if (a.min() < b.min()) {\n return -1;\n } else if (a.min() > b.min()) {\n return 1;\n } else if (a.max() < b.max()) {\n return -1;\n } else if (b.max() > a.max()) {\n return 1;\n } else {\n return 0;\n }\n}\n\nfunction _rangeOrder(a, b) {\n if (a._min < b._min) {\n return -1;\n } else if (a._min > b._min) {\n return 1;\n } else if (a._max < b._max) {\n return -1;\n } else if (b._max > a._max) {\n return 1;\n } else {\n return 0;\n }\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n Range: Range,\n union: union,\n intersection: intersection,\n coverage: coverage,\n rangeOver: rangeOrder,\n _rangeOrder: _rangeOrder\n };\n}\n\n},{}],42:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2014\n//\n// style.js\n//\n\n\"use strict\";\n\nfunction StyleFilter(type, method, label) {\n this.type = type;\n this.method = method;\n this.label = label;\n}\n\nStyleFilter.prototype.equals = function (o) {\n return this.type == o.type && this.method == o.method && this.label == o.label;\n};\n\nStyleFilter.prototype.toString = function () {\n var fs = [];\n if (this.type) fs.push('type=' + this.type);\n if (this.method) fs.push('method=' + this.method);\n if (this.label) fs.push('label=' + this.label);\n return 'StyleFilter<' + fs.join(';') + '>';\n};\n\nfunction StyleFilterSet(filters) {\n this._filters = {};\n if (filters) {\n for (var fi = 0; fi < filters.length; ++fi) {\n this.add(filters[fi]);\n }\n }\n}\n\nStyleFilterSet.prototype.add = function (filter) {\n var fs = filter.toString();\n if (!this._filters[fs]) {\n this._filters[fs] = filter;\n this._list = null;\n }\n};\n\nStyleFilterSet.prototype.addAll = function (filterSet) {\n var l = filterSet.list();\n for (var fi = 0; fi < l.length; ++fi) {\n this.add(l[fi]);\n }\n};\n\nStyleFilterSet.prototype.doesNotContain = function (filterSet) {\n var l = filterSet.list();\n for (var fi = 0; fi < l.length; ++fi) {\n if (!this._filters[fi.toString()]) return true;\n }\n return false;\n};\n\nStyleFilterSet.prototype.list = function () {\n if (!this._list) {\n this._list = [];\n for (var k in this._filters) {\n if (this._filters.hasOwnProperty(k)) {\n this._list.push(this._filters[k]);\n }\n }\n }\n return this._list;\n};\n\nStyleFilterSet.prototype.typeList = function () {\n var types = [];\n var list = this.list();\n for (var fi = 0; fi < list.length; ++fi) {\n var filter = list[fi];\n var type = filter.type;\n if (!type || type == 'default') return null;\n if (types.indexOf(type) < 0) types.push(type);\n }\n return types;\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n StyleFilter: StyleFilter,\n StyleFilterSet: StyleFilterSet\n };\n}\n\n},{}],43:[function(require,module,exports){\n/* jshint esversion: 6 */\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.renderTier = renderTier;\nexports.drawTier = drawTier;\n\n/* To be used by tiers which are to be drawn in a multitier\n using the multi-renderer.\n\n Subtiers are configured by adding the following to a tier's source configuration:\n renderer: 'sub',\n sub: {\n multi_id: \"multi_1\",\n offset: 130,\n z: 2,\n }\n This would define a subtier that's to be rendered in the multi-tier with\n id \"multi_1\", with the top of the subtier at 130 pixels and at z-index 2.\n */\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\n// drawTier is called when this tier's data has been fetched,\n// so by refreshing the multiTier from here, we can be sure that\n// there's something new worth drawing in it\nfunction drawTier(tier) {\n var browser = tier.browser;\n\n var multiTier = browser.tiers.filter(function (t) {\n return t.dasSource.renderer === 'multi' && t.dasSource.multi.multi_id === tier.dasSource.sub.multi_id;\n });\n\n multiTier.forEach(function (t) {\n return browser.refreshTier(t);\n });\n}\n\n},{}],44:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// svg-export.js\n//\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var makeElementNS = utils.makeElementNS;\n\n var VERSION = require('./version');\n\n var svgSeqTier = require('./sequence-draw').svgSeqTier;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n var formatLongInt = nf.formatLongInt;\n}\n\nBrowser.prototype.makeSVG = function (opts) {\n opts = opts || {};\n var minTierHeight = opts.minTierHeight || 20;\n var padding = 3;\n var fpw = opts.width || this.featurePanelWidth;\n\n var backupFPW = this.featurePanelWidth;\n var backupScale = this.scale;\n this.featurePanelWidth = fpw;\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n\n var b = this;\n var saveDoc = document.implementation.createDocument(NS_SVG, 'svg', null);\n\n var saveRoot = makeElementNS(NS_SVG, 'g', null, {\n fontFamily: 'helvetica',\n fontSize: '8pt'\n });\n saveDoc.documentElement.appendChild(saveRoot);\n\n var margin = 200;\n\n if (opts.banner) {\n var dallianceAnchor = makeElementNS(NS_SVG, 'a', makeElementNS(NS_SVG, 'text', 'Graphics from Biodalliance ' + VERSION, {\n x: b.featurePanelWidth + margin - 100,\n y: 35,\n strokeWidth: 0,\n fontSize: '12pt',\n textAnchor: 'end',\n fill: 'blue'\n }));\n dallianceAnchor.setAttribute('xmlns:xlink', NS_XLINK);\n dallianceAnchor.setAttribute('xlink:href', 'http://www.biodalliance.org/');\n\n saveRoot.appendChild(dallianceAnchor);\n }\n\n if (opts.region) {\n saveRoot.appendChild(makeElementNS(NS_SVG, 'text', this.chr + ':' + formatLongInt(this.viewStart) + '..' + formatLongInt(this.viewEnd), {\n x: margin + 100,\n y: 35,\n strokeWidth: 0,\n fontSize: '12pt',\n textAnchor: 'start'\n }));\n }\n\n var clipRect = makeElementNS(NS_SVG, 'rect', null, {\n x: margin,\n y: 50,\n width: b.featurePanelWidth,\n height: 100000\n });\n var clip = makeElementNS(NS_SVG, 'clipPath', clipRect, { id: 'featureClip' });\n saveRoot.appendChild(clip);\n\n var pos = 70;\n var tierHolder = makeElementNS(NS_SVG, 'g', null, {});\n\n for (var ti = 0; ti < b.tiers.length; ++ti) {\n var tier = b.tiers[ti];\n tier.backupSubtiers = tier.subtiers;\n tier.backupOriginHaxx = tier.originHaxx;\n tier.backupLayoutHeight = tier.layoutHeight;\n\n var renderer = b.getTierRenderer(tier);\n if (renderer && renderer.prepareSubtiers) {\n renderer.prepareSubtiers(tier, tier.viewport.getContext('2d'));\n }\n\n var tierSVG = makeElementNS(NS_SVG, 'g', null, { clipPath: 'url(#featureClip)', clipRule: 'nonzero' });\n var tierLabels = makeElementNS(NS_SVG, 'g');\n var tierTopPos = pos;\n\n var tierBackground = makeElementNS(NS_SVG, 'rect', null, { x: 0, y: tierTopPos, width: '10000', height: 50, fill: tier.background });\n tierSVG.appendChild(tierBackground);\n\n if (tier.sequenceSource) {\n var seqTrack = svgSeqTier(tier, tier.currentSequence);\n\n tierSVG.appendChild(makeElementNS(NS_SVG, 'g', seqTrack, { transform: 'translate(' + margin + ', ' + pos + ')' }));\n pos += 80;\n } else {\n if (!tier.subtiers) {\n continue;\n }\n\n var offset = (tier.glyphCacheOrigin - b.viewStart) * b.scale;\n var hasQuant = false;\n for (var sti = 0; sti < tier.subtiers.length; ++sti) {\n pos += padding;\n var subtier = tier.subtiers[sti];\n\n var glyphElements = [];\n for (var gi = 0; gi < subtier.glyphs.length; ++gi) {\n var glyph = subtier.glyphs[gi];\n glyphElements.push(glyph.toSVG());\n }\n\n tierSVG.appendChild(makeElementNS(NS_SVG, 'g', glyphElements, { transform: 'translate(' + (margin + offset) + ', ' + pos + ')' }));\n\n if (subtier.quant) {\n hasQuant = true;\n var q = subtier.quant;\n var h = subtier.height;\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + (h / 20 | 0);\n }\n var ticSpacing = h / (numTics - 1);\n var ticInterval = (q.max - q.min) / (numTics - 1);\n\n var path = new SVGPath();\n path.moveTo(margin + 5, pos);\n path.lineTo(margin, pos);\n path.lineTo(margin, pos + subtier.height);\n path.lineTo(margin + 5, pos + subtier.height);\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n path.moveTo(margin, pos + ty);\n path.lineTo(margin + 3, pos + ty);\n }\n\n tierLabels.appendChild(makeElementNS(NS_SVG, 'path', null, { d: path.toPathData(), fill: 'none', stroke: 'black', strokeWidth: '2px' }));\n tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel(q.max), { x: margin - 3, y: pos + 7, textAnchor: 'end' }));\n tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel(q.min), { x: margin - 3, y: pos + subtier.height, textAnchor: 'end' }));\n for (var t = 1; t < numTics - 1; ++t) {\n var ty = t * ticSpacing;\n tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel(1.0 * q.max - t * ticInterval), { x: margin - 3, y: pos + ty + 3, textAnchor: 'end' }));\n }\n }\n\n pos += subtier.height + padding;\n }\n\n if (pos - tierTopPos < minTierHeight) {\n pos = tierTopPos + minTierHeight;\n }\n }\n\n var labelName;\n if (typeof tier.config.name === 'string') labelName = tier.config.name;else labelName = tier.dasSource.name;\n tierLabels.appendChild(makeElementNS(NS_SVG, 'text', labelName, { x: margin - (hasQuant ? 20 : 12), y: (pos + tierTopPos + 8) / 2, fontSize: '10pt', textAnchor: 'end' }));\n\n tierBackground.setAttribute('height', pos - tierTopPos);\n tierHolder.appendChild(makeElementNS(NS_SVG, 'g', [tierSVG, tierLabels]));\n\n tier.subtiers = tier.backupSubtiers;\n tier.originHaxx = tier.backupOriginHaxx;\n tier.layoutHeight = tier.backupLayoutHeight;\n }\n\n if (opts.highlights) {\n var highlights = this.highlights || [];\n for (var hi = 0; hi < highlights.length; ++hi) {\n var h = highlights[hi];\n if ((h.chr == this.chr || h.chr == 'chr' + this.chr) && h.min < this.viewEnd && h.max > this.viewStart) {\n var tmin = (Math.max(h.min, this.viewStart) - this.viewStart) * this.scale;\n var tmax = (Math.min(h.max, this.viewEnd) - this.viewStart) * this.scale;\n\n tierHolder.appendChild(makeElementNS(NS_SVG, 'rect', null, { x: margin + tmin, y: 70, width: tmax - tmin, height: pos - 70,\n stroke: 'none', fill: this.defaultHighlightFill, fillOpacity: this.defaultHighlightAlpha }));\n }\n }\n }\n\n var rulerPos = -1;\n if (opts.ruler == 'center') {\n rulerPos = margin + (this.viewEnd - this.viewStart) * this.scale / 2;\n } else if (opts.ruler == 'left') {\n rulerPos = margin;\n } else if (opts.ruler == 'right') {\n rulerPos = margin + (this.viewEnd - this.viewStart) * this.scale;\n }\n if (rulerPos >= 0) {\n tierHolder.appendChild(makeElementNS(NS_SVG, 'line', null, { x1: rulerPos, y1: 70, x2: rulerPos, y2: pos,\n stroke: 'blue' }));\n }\n\n saveRoot.appendChild(tierHolder);\n saveDoc.documentElement.setAttribute('width', b.featurePanelWidth + 20 + margin);\n saveDoc.documentElement.setAttribute('height', pos + 50);\n\n this.featurePanelWidth = backupFPW;\n this.scale = backupScale;\n\n var svg = void 0;\n if (typeof XMLSerializer !== 'undefined') {\n svg = new XMLSerializer().serializeToString(saveDoc);\n } else {\n var root = saveDoc.documentElement;\n root.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg = root.outerHTML;\n }\n\n if (opts.output && opts.output === 'string') {\n return svg;\n } else {\n return new Blob([svg], { type: 'image/svg+xml' });\n }\n};\n\n},{\"./cbrowser\":6,\"./numformats\":30,\"./sequence-draw\":36,\"./svg-utils\":45,\"./utils\":56,\"./version\":58}],45:[function(require,module,exports){\n'use strict';\n\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// svg-utils.js\n//\n\nvar NS_SVG = 'http://www.w3.org/2000/svg';\nvar NS_XLINK = 'http://www.w3.org/1999/xlink';\n\nfunction SVGPath() {\n this.ops = [];\n}\n\nSVGPath.prototype.moveTo = function (x, y) {\n this.ops.push('M ' + x + ' ' + y);\n};\n\nSVGPath.prototype.lineTo = function (x, y) {\n this.ops.push('L ' + x + ' ' + y);\n};\n\nSVGPath.prototype.closePath = function () {\n this.ops.push('Z');\n};\n\nSVGPath.prototype.toPathData = function () {\n return this.ops.join(' ');\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n NS_SVG: NS_SVG,\n NS_XLINK: NS_XLINK,\n SVGPath: SVGPath\n };\n}\n\n},{}],46:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tabix-source.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var dalliance_makeParser = sa.makeParser;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n\n var connectTabix = require('./tabix').connectTabix;\n}\n\nfunction TabixFeatureSource(source) {\n FeatureSourceBase.call(this);\n this.readiness = 'Connecting';\n this.source = source;\n\n this.tabixHolder = new Awaited();\n var thisB = this;\n\n var parser = dalliance_makeParser(source.payload);\n if (!parser) {\n throw 'Unsuported tabix payload ' + source.payload;\n } else {\n this.parser = parser;\n }\n\n var data, index;\n if (this.source.blob) {\n data = new BlobFetchable(this.source.blob);\n index = new BlobFetchable(this.source.indexBlob);\n } else {\n data = new URLFetchable(this.source.uri, { credentials: this.source.credentials, resolver: this.source.resolver });\n index = new URLFetchable(this.source.indexURI || this.source.uri + '.tbi', { credentials: this.source.credentials, resolver: this.source.resolver });\n }\n connectTabix(data, index, function (tabix, err) {\n thisB.tabixHolder.provide(tabix);\n tabix.fetchHeader(function (lines, err) {\n if (lines) {\n var session = parser.createSession(function () {/* Null sink because we shouldn't get records */});\n for (var li = 0; li < lines.length; ++li) {\n session.parse(lines[li]);\n }\n session.flush();\n }\n });\n thisB.readiness = null;\n thisB.notifyReadiness();\n });\n}\n\nTabixFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nTabixFeatureSource.prototype.fetch = function (chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.tabixHolder.await(function (tabix) {\n tabix.fetch(chr, min, max, function (records, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var features = [];\n var session = thisB.parser.createSession(function (f) {\n features.push(f);\n });\n for (var ri = 0; ri < records.length; ++ri) {\n var f = session.parse(records[ri]);\n }\n session.flush();\n callback(null, features, 1000000000);\n });\n });\n};\n\nTabixFeatureSource.prototype.getStyleSheet = function (callback) {\n if (this.parser && this.parser.getStyleSheet) this.parser.getStyleSheet(callback);\n};\n\nTabixFeatureSource.prototype.getDefaultFIPs = function (callback) {\n if (this.parser && this.parser.getDefaultFIPs) this.parser.getDefaultFIPs(callback);\n};\n\ndalliance_registerSourceAdapterFactory('tabix', function (source) {\n return { features: new TabixFeatureSource(source) };\n});\n\n},{\"./bin\":4,\"./sourceadapters\":39,\"./tabix\":47,\"./utils\":56}],47:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// tabix.js: basic support for tabix-indexed flatfiles\n//\n\n\"use strict\";\n\nvar TABIX_MAGIC = 0x01494254;\n\nif (typeof require !== 'undefined') {\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var bin = require('./bin');\n var readInt = bin.readInt;\n var readShort = bin.readShort;\n var readByte = bin.readByte;\n var readInt64 = bin.readInt64;\n var readFloat = bin.readFloat;\n\n var lh3utils = require('./lh3utils');\n var readVob = lh3utils.readVob;\n var unbgzf = lh3utils.unbgzf;\n var reg2bins = lh3utils.reg2bins;\n var Chunk = lh3utils.Chunk;\n}\n\nfunction TabixFile() {}\n\nfunction connectTabix(data, tbi, callback) {\n var tabix = new TabixFile();\n tabix.data = data;\n tabix.tbi = tbi;\n\n tabix.tbi.fetch(function (header) {\n // Do we really need to fetch the whole thing? :-(\n if (!header) {\n return callback(null, \"Couldn't access Tabix\");\n }\n\n var unchead = unbgzf(header, header.byteLength);\n var uncba = new Uint8Array(unchead);\n var magic = readInt(uncba, 0);\n if (magic != TABIX_MAGIC) {\n return callback(null, 'Not a tabix index');\n }\n\n var nref = readInt(uncba, 4);\n tabix.format = readInt(uncba, 8);\n tabix.colSeq = readInt(uncba, 12);\n tabix.colStart = readInt(uncba, 16);\n tabix.colEnd = readInt(uncba, 20);\n tabix.meta = readInt(uncba, 24);\n tabix.skip = readInt(uncba, 28);\n var nameLength = readInt(uncba, 32);\n\n tabix.indices = [];\n\n var p = 36;\n tabix.chrToIndex = {};\n tabix.indexToChr = [];\n for (var i = 0; i < nref; ++i) {\n var name = '';\n\n while (true) {\n var ch = uncba[p++];\n if (ch == 0) break;\n\n name += String.fromCharCode(ch);\n }\n\n tabix.chrToIndex[name] = i;\n if (name.indexOf('chr') == 0) {\n tabix.chrToIndex[name.substring(3)] = i;\n } else {\n tabix.chrToIndex['chr' + name] = i;\n }\n tabix.indexToChr.push(name);\n }\n\n var minBlockIndex = 1000000000;\n for (var ref = 0; ref < nref; ++ref) {\n var blockStart = p;\n var nbin = readInt(uncba, p);p += 4;\n for (var b = 0; b < nbin; ++b) {\n var bin = readInt(uncba, p);\n var nchnk = readInt(uncba, p + 4);\n p += 8 + nchnk * 16;\n }\n var nintv = readInt(uncba, p);p += 4;\n\n var q = p;\n for (var i = 0; i < nintv; ++i) {\n var v = readVob(uncba, q);q += 8;\n if (v) {\n var bi = v.block;\n if (v.offset > 0) bi += 65536;\n\n if (bi < minBlockIndex) minBlockIndex = bi;\n break;\n }\n }\n p += nintv * 8;\n\n var ub = uncba;\n if (nbin > 0) {\n tabix.indices[ref] = new Uint8Array(unchead, blockStart, p - blockStart);\n }\n }\n\n tabix.headerMax = minBlockIndex;\n\n callback(tabix);\n }, { timeout: 50000 });\n}\n\n// Copy-paste from BamFile\n\nTabixFile.prototype.blocksForRange = function (refId, min, max) {\n var index = this.indices[refId];\n if (!index) {\n return [];\n }\n\n var intBinsL = reg2bins(min, max);\n var intBins = [];\n for (var i = 0; i < intBinsL.length; ++i) {\n intBins[intBinsL[i]] = true;\n }\n var leafChunks = [],\n otherChunks = [];\n\n var nbin = readInt(index, 0);\n var p = 4;\n for (var b = 0; b < nbin; ++b) {\n var bin = readInt(index, p);\n var nchnk = readInt(index, p + 4);\n p += 8;\n if (intBins[bin]) {\n for (var c = 0; c < nchnk; ++c) {\n var cs = readVob(index, p, true);\n var ce = readVob(index, p + 8, true);\n (bin < 4681 ? otherChunks : leafChunks).push(new Chunk(cs, ce));\n p += 16;\n }\n } else {\n p += nchnk * 16;\n }\n }\n\n var nintv = readInt(index, p);\n var lowest = null;\n var minLin = Math.min(min >> 14, nintv - 1),\n maxLin = Math.min(max >> 14, nintv - 1);\n for (var i = minLin; i <= maxLin; ++i) {\n var lb = readVob(index, p + 4 + i * 8);\n if (!lb) {\n continue;\n }\n if (!lowest || lb.block < lowest.block || lb.offset < lowest.offset) {\n lowest = lb;\n }\n }\n\n var prunedOtherChunks = [];\n if (lowest != null) {\n for (var i = 0; i < otherChunks.length; ++i) {\n var chnk = otherChunks[i];\n if (chnk.maxv.block >= lowest.block && chnk.maxv.offset >= lowest.offset) {\n prunedOtherChunks.push(chnk);\n }\n }\n }\n otherChunks = prunedOtherChunks;\n\n var intChunks = [];\n for (var i = 0; i < otherChunks.length; ++i) {\n intChunks.push(otherChunks[i]);\n }\n for (var i = 0; i < leafChunks.length; ++i) {\n intChunks.push(leafChunks[i]);\n }\n\n intChunks.sort(function (c0, c1) {\n var dif = c0.minv.block - c1.minv.block;\n if (dif != 0) {\n return dif;\n } else {\n return c0.minv.offset - c1.minv.offset;\n }\n });\n var mergedChunks = [];\n if (intChunks.length > 0) {\n var cur = intChunks[0];\n for (var i = 1; i < intChunks.length; ++i) {\n var nc = intChunks[i];\n if (nc.minv.block == cur.maxv.block /* && nc.minv.offset == cur.maxv.offset */) {\n // no point splitting mid-block\n cur = new Chunk(cur.minv, nc.maxv);\n } else {\n mergedChunks.push(cur);\n cur = nc;\n }\n }\n mergedChunks.push(cur);\n }\n\n return mergedChunks;\n};\n\nTabixFile.prototype.fetch = function (chr, min, max, callback) {\n var thisB = this;\n\n var chrId = this.chrToIndex[chr];\n if (chrId == undefined) return callback([]);\n\n var canonicalChr = this.indexToChr[chrId];\n\n var chunks;\n if (chrId === undefined) {\n chunks = [];\n } else {\n chunks = this.blocksForRange(chrId, min, max);\n if (!chunks) {\n callback(null, 'Error in index fetch');\n }\n }\n\n var records = [];\n var index = 0;\n var data;\n\n function tramp() {\n if (index >= chunks.length) {\n return callback(records);\n } else if (!data) {\n var c = chunks[index];\n var fetchMin = c.minv.block;\n var fetchMax = c.maxv.block + (1 << 16); // *sigh*\n thisB.data.slice(fetchMin, fetchMax - fetchMin).fetch(function (r) {\n data = unbgzf(r, c.maxv.block - c.minv.block + 1);\n return tramp();\n });\n } else {\n var ba = new Uint8Array(data);\n thisB.readRecords(ba, chunks[index].minv.offset, records, min, max, canonicalChr);\n data = null;\n ++index;\n return tramp();\n }\n }\n tramp();\n};\n\nTabixFile.prototype.readRecords = function (ba, offset, sink, min, max, chr) {\n LINE_LOOP: while (true) {\n var line = '';\n while (offset < ba.length) {\n var ch = ba[offset++];\n if (ch == 10) {\n var toks = line.split('\\t');\n\n if (toks[this.colSeq - 1] == chr) {\n var fmin = parseInt(toks[this.colStart - 1]);\n var fmax = fmin;\n if (this.colEnd > 0) fmax = parseInt(toks[this.colEnd - 1]);\n if (this.format & 0x10000) ++fmin;\n\n if (fmin <= max && fmax >= min) sink.push(line);\n }\n continue LINE_LOOP;\n } else {\n line += String.fromCharCode(ch);\n }\n }\n return;\n }\n};\n\nTabixFile.prototype.fetchHeader = function (callback) {\n var self = this;\n var fetchPtr = 0,\n ptr = 0,\n line = '';\n var lines = [];\n\n self.data.slice(0, self.headerMax).fetch(function (chnk) {\n if (!chnk) {\n return callback(null, \"Fetch failed\");\n }\n var ba = new Uint8Array(unbgzf(chnk, chnk.byteLength));\n var ptr = 0,\n line = '',\n lines = [];\n while (ptr < ba.length) {\n var ch = ba[ptr++];\n if (ch == 10) {\n if (line.charCodeAt(0) == self.meta) {\n lines.push(line);\n line = '';\n } else {\n return callback(lines);\n }\n } else {\n line += String.fromCharCode(ch);\n }\n }\n callback(lines);\n });\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n connectTabix: connectTabix,\n TABIX_MAGIC: TABIX_MAGIC\n };\n}\n\n},{\"./bin\":4,\"./lh3utils\":26,\"./spans\":41}],48:[function(require,module,exports){\n\"use strict\";\n\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\nvar _sourceadapters = require(\"./sourceadapters.js\");\n\nvar _das = require(\"./das.js\");\n\nvar _ramda = require(\"ramda\");\n\nvar R = _interopRequireWildcard(_ramda);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* jshint esversion: 6 */\n\n/*\n Source that can be configured to produce any type of feature,\n useful for testing renderers.\n */\n\nvar TestSource = function (_FeatureSourceBase) {\n _inherits(TestSource, _FeatureSourceBase);\n\n function TestSource(source) {\n _classCallCheck(this, TestSource);\n\n var _this = _possibleConstructorReturn(this, (TestSource.__proto__ || Object.getPrototypeOf(TestSource)).call(this));\n\n _this.features = R.defaultTo([], source.features);\n return _this;\n }\n\n _createClass(TestSource, [{\n key: \"genFeature\",\n value: function genFeature(conf) {\n var feature = new _das.DASFeature();\n\n for (var key in conf) {\n feature[key] = conf[key];\n }\n }\n }, {\n key: \"fetch\",\n value: function fetch(chr, min, max, scale, types, pool, callback) {\n var features = R.forEach(this.genFeature, this.features);\n return callback(null, features, 1);\n }\n }]);\n\n return TestSource;\n}(_sourceadapters.FeatureSourceBase);\n\n(0, _sourceadapters.registerSourceAdapterFactory)('test-source', function (source) {\n return { features: new TestSource(source) };\n});\n\n},{\"./das.js\":10,\"./sourceadapters.js\":39,\"ramda\":387}],49:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// thub.js: support for track-hub style registries\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var textXHR = utils.textXHR;\n var relativeURL = utils.relativeURL;\n var shallowCopy = utils.shallowCopy;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n}\n\nvar THUB_STANZA_REGEXP = /\\n\\s*\\n/;\nvar THUB_PARSE_REGEXP = /(\\w+) +(.+)\\n?/;\nvar THUB_SUBGROUP_REGEXP = /subGroup[1-9]/;\n\nvar THUB_PENNANT_PREFIX = 'http://genome.ucsc.edu/images/';\n\nfunction TrackHub(url) {\n this.genomes = {};\n this.url = url;\n}\n\nfunction TrackHubTrack() {}\n\nTrackHubTrack.prototype.get = function (k) {\n if (this[k]) return this[k];else if (this._parent) return this._parent.get(k);\n};\n\nfunction TrackHubDB(hub) {\n this.hub = hub;\n}\n\nTrackHubDB.prototype.getTracks = function (callback) {\n var thisB = this;\n if (this._tracks) {\n return callback(this._tracks);\n }\n\n textXHR(this.absURL, function (trackFile, err) {\n if (err) {\n return callback(null, err);\n }\n\n // trackFile = trackFile.replace(/\\#.*/g, '');\n trackFile = trackFile.replace('\\\\\\n', ' ');\n\n var tracks = [];\n var tracksById = {};\n var stanzas = trackFile.split(THUB_STANZA_REGEXP);\n for (var s = 0; s < stanzas.length; ++s) {\n var toks = stanzas[s].replace(/\\#.*/g, '').split(THUB_PARSE_REGEXP);\n var track = new TrackHubTrack();\n track._db = thisB;\n for (var l = 0; l < toks.length - 2; l += 3) {\n var k = toks[l + 1],\n v = toks[l + 2];\n if (k.match(THUB_SUBGROUP_REGEXP)) {\n if (!track.subgroups) track.subgroups = {};\n var sgtoks = v.split(/\\s/);\n var sgtag = sgtoks[0];\n var sgrecord = { name: sgtoks[1], tags: [], titles: [] };\n for (var sgti = 2; sgti < sgtoks.length; ++sgti) {\n var grp = sgtoks[sgti].split(/=/);\n sgrecord.tags.push(grp[0]);\n sgrecord.titles.push(grp[1]);\n }\n track.subgroups[sgtag] = sgrecord;\n } else if (k === 'subGroups') {\n var sgtoks = v.split(/(\\w+)=(\\w+)/);\n track.sgm = {};\n for (var sgti = 0; sgti < sgtoks.length - 2; sgti += 3) {\n track.sgm[sgtoks[sgti + 1]] = sgtoks[sgti + 2];\n }\n } else {\n track[toks[l + 1]] = toks[l + 2];\n }\n }\n\n if (track.track && (track.type || track.container || track.view || track.bigDataUrl)) {\n tracks.push(track);\n tracksById[track.track] = track;\n } else {\n // console.log('skipping ', track);\n }\n }\n\n var toplevels = [];\n var composites = [];\n for (var ti = 0; ti < tracks.length; ++ti) {\n var track = tracks[ti];\n var top = true;\n if (track.parent) {\n var ptoks = track.parent.split(/\\s+/);\n var parent = tracksById[ptoks[0]];\n if (parent) {\n track._parent = parent;\n\n if (!parent.children) parent.children = [];\n parent.children.push(track);\n\n if (parent) top = false;\n } else {\n console.log(\"Couldn't find parent \" + ptoks[0] + '(' + track.parent + ')');\n }\n }\n if (track.compositeTrack) {\n composites.push(track);\n } else if (top) {\n toplevels.push(track);\n }\n }\n\n for (var ci = 0; ci < composites.length; ++ci) {\n var comp = composites[ci];\n if (!comp.children) continue;\n\n var parentOfViews = false;\n for (var ki = 0; ki < comp.children.length; ++ki) {\n var k = comp.children[ki];\n if (k.view) {\n k.shortLabel = comp.shortLabel + \": \" + k.shortLabel;\n toplevels.push(k);\n parentOfViews = true;\n }\n }\n if (!parentOfViews) toplevels.push(comp);\n }\n\n thisB._tracks = toplevels;\n return callback(thisB._tracks, null);\n }, { credentials: this.credentials, salt: true });\n};\n\nfunction connectTrackHub(hubURL, callback, opts) {\n opts = opts || {};\n opts.salt = true;\n\n textXHR(hubURL, function (hubFile, err) {\n if (err) {\n return callback(null, err);\n }\n\n var toks = hubFile.split(THUB_PARSE_REGEXP);\n var hub = new TrackHub(hubURL);\n if (opts.credentials) {\n hub.credentials = opts.credentials;\n }\n for (var l = 0; l < toks.length - 2; l += 3) {\n hub[toks[l + 1]] = toks[l + 2];\n }\n\n if (hub.genomesFile) {\n var genURL = relativeURL(hubURL, hub.genomesFile);\n textXHR(genURL, function (genFile, err) {\n if (err) {\n return callback(null, err);\n }\n\n var stanzas = genFile.split(THUB_STANZA_REGEXP);\n for (var s = 0; s < stanzas.length; ++s) {\n var toks = stanzas[s].split(THUB_PARSE_REGEXP);\n var gprops = new TrackHubDB(hub);\n if (opts.credentials) {\n gprops.credentials = opts.credentials;\n }\n\n for (var l = 0; l < toks.length - 2; l += 3) {\n gprops[toks[l + 1]] = toks[l + 2];\n }\n\n if (gprops.twoBitPath) {\n gprops.twoBitPath = relativeURL(genURL, gprops.twoBitPath);\n }\n\n if (gprops.genome && gprops.trackDb) {\n gprops.absURL = relativeURL(genURL, gprops.trackDb);\n hub.genomes[gprops.genome] = gprops;\n }\n }\n\n callback(hub);\n }, opts);\n } else {\n callback(null, 'No genomesFile');\n }\n }, opts);\n}\n\nTrackHubTrack.prototype.toDallianceSource = function () {\n var source = {\n name: this.shortLabel,\n desc: this.longLabel\n };\n if (this._db.mapping) {\n source.mapping = this._db.mapping;\n }\n\n var pennantIcon = this.get('pennantIcon');\n if (pennantIcon) {\n var ptoks = pennantIcon.split(/\\s+/);\n source.pennant = THUB_PENNANT_PREFIX + ptoks[0];\n }\n\n var searchTrix = this.get('searchTrix');\n if (searchTrix) {\n source.trixURI = relativeURL(this._db.absURL, searchTrix);\n }\n\n if (this.container == 'multiWig') {\n source.merge = 'concat';\n source.overlay = [];\n var children = this.children || [];\n source.style = [];\n source.noDownsample = true;\n\n for (var ci = 0; ci < children.length; ++ci) {\n var ch = children[ci];\n var cs = ch.toDallianceSource();\n source.overlay.push(cs);\n\n if (cs.style) {\n for (var si = 0; si < cs.style.length; ++si) {\n var style = cs.style[si];\n style.method = ch.shortLabel; // FIXME\n if (this.aggregate == 'transparentOverlay') style.style.ALPHA = 0.5;\n source.style.push(style);\n }\n }\n }\n return source;\n } else {\n var type = this.type;\n if (!type) {\n var p = this;\n while (p._parent && !p.type) {\n p = p._parent;\n }\n type = p.type;\n }\n if (!type) return;\n var typeToks = type.split(/\\s+/);\n if (typeToks[0] == 'bigBed' && this.bigDataUrl) {\n var bedTokens = typeToks[1] | 0;\n var bedPlus = typeToks[2] == '+';\n\n source.bwgURI = relativeURL(this._db.absURL, this.bigDataUrl);\n source.style = this.bigbedStyles();\n if (this._db.credentials) {\n source.credentials = true;\n }\n if (bedTokens >= 12 && bedPlus) source.collapseSuperGroups = true;\n return source;\n } else if (typeToks[0] == 'bigWig' && this.bigDataUrl) {\n source.bwgURI = relativeURL(this._db.absURL, this.bigDataUrl);\n source.style = this.bigwigStyles();\n source.noDownsample = true; // FIXME seems like a blunt instrument...\n\n if (this.yLineOnOff && this.yLineOnOff == 'on') {\n source.quantLeapThreshold = this.yLineMark !== undefined ? 1.0 * this.yLineMark : 0.0;\n }\n\n if (this._db.credentials) {\n source.credentials = true;\n }\n\n return source;\n } else if (typeToks[0] == 'bam' && this.bigDataUrl) {\n source.bamURI = relativeURL(this._db.absURL, this.bigDataUrl);\n if (this._db.credentials) {\n source.credentials = true;\n }\n return source;\n } else if (typeToks[0] == 'vcfTabix' && this.bigDataUrl) {\n source.uri = relativeURL(this._db.absURL, this.bigDataUrl);\n source.tier_type = 'tabix';\n source.payload = 'vcf';\n if (this._db.credentials) {\n source.credentials = true;\n }\n return source;\n } else {\n console.log('Unsupported ' + this.type);\n }\n }\n};\n\nTrackHubTrack.prototype.bigwigStyles = function () {\n var type = this.type;\n if (!type) {\n var p = this;\n while (p._parent && !p.type) {\n p = p._parent;\n }\n type = p.type;\n }\n if (!type) return;\n var typeToks = type.split(/\\s+/);\n\n var min, max;\n if (typeToks.length >= 3) {\n min = 1.0 * typeToks[1];\n max = 1.0 * typeToks[2];\n }\n\n var height;\n if (this.maxHeightPixels) {\n var mhpToks = this.maxHeightPixels.split(/:/);\n if (mhpToks.length == 3) {\n height = mhpToks[1] | 0;\n } else {\n console.log('maxHeightPixels should be of the form max:default:min');\n }\n }\n\n var gtype = 'bars';\n if (this.graphTypeDefault) {\n gtype = this.graphTypeDefault;\n }\n\n var color = 'black';\n var altColor = null;\n if (this.color) {\n color = 'rgb(' + this.color + ')';\n }\n if (this.altColor) {\n altColor = 'rgb(' + this.altColor + ')';\n }\n\n var stylesheet = new DASStylesheet();\n var wigStyle = new DASStyle();\n if (gtype == 'points') {\n wigStyle.glyph = 'POINT';\n } else {\n wigStyle.glyph = 'HISTOGRAM';\n }\n\n if (altColor) {\n wigStyle.COLOR1 = color;\n wigStyle.COLOR2 = altColor;\n } else {\n wigStyle.BGCOLOR = color;\n }\n wigStyle.HEIGHT = height || 30;\n if (min || max) {\n wigStyle.MIN = min;\n wigStyle.MAX = max;\n }\n stylesheet.pushStyle({ type: 'default' }, null, wigStyle);\n return stylesheet.styles;\n};\n\nTrackHubTrack.prototype.bigbedStyles = function () {\n var itemRgb = ('' + this.get('itemRgb')).toLowerCase() == 'on';\n var visibility = this.get('visibility') || 'full';\n var color = this.get('color');\n if (color) color = 'rgb(' + color + ')';else color = 'blue';\n\n var stylesheet = new DASStylesheet();\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = color;\n wigStyle.HEIGHT = visibility == 'full' || visibility == 'pack' ? 12 : 8;\n wigStyle.BUMP = visibility == 'full' || visibility == 'pack';\n wigStyle.LABEL = visibility == 'full' || visibility == 'pack';\n wigStyle.ZINDEX = 20;\n if (itemRgb) wigStyle.BGITEM = true;\n\n var cbs = this.get('colorByStrand');\n if (cbs) {\n var cbsToks = cbs.split(/\\s+/);\n\n var plus = shallowCopy(wigStyle);\n plus.BGCOLOR = 'rgb(' + cbsToks[0] + ')';\n stylesheet.pushStyle({ type: 'bigbed', orientation: '+' }, null, plus);\n\n var minus = shallowCopy(wigStyle);\n minus.BGCOLOR = 'rgb(' + cbsToks[1] + ')';\n stylesheet.pushStyle({ type: 'bigbed', orientation: '-' }, null, minus);\n } else {\n stylesheet.pushStyle({ type: 'bigbed' }, null, wigStyle);\n }\n\n var tlStyle = new DASStyle();\n tlStyle.glyph = 'BOX';\n tlStyle.FGCOLOR = 'black';\n if (itemRgb) tlStyle.BGITEM = true;\n tlStyle.BGCOLOR = 'red';\n tlStyle.HEIGHT = 10;\n tlStyle.BUMP = true;\n tlStyle.ZINDEX = 20;\n stylesheet.pushStyle({ type: 'translation' }, null, tlStyle);\n\n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({ type: 'transcript' }, null, tsStyle);\n\n return stylesheet.styles;\n};\n\nfunction THUB_COMPARE(g, h) {\n if (g.priority && h.priority) {\n return 1.0 * g.priority - 1.0 * h.priority;\n } else if (g.priority) {\n return 1;\n } else if (h.priority) {\n return -1;\n } else {\n return g.shortLabel.localeCompare(h.shortLabel);\n }\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n connectTrackHub: connectTrackHub,\n THUB_COMPARE: THUB_COMPARE\n };\n}\n\n},{\"./das\":10,\"./utils\":56}],50:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tier-actions.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n}\n\nBrowser.prototype.mergeSelectedTiers = function () {\n var sources = [];\n var styles = [];\n\n for (var sti = 0; sti < this.selectedTiers.length; ++sti) {\n var tier = this.tiers[this.selectedTiers[sti]];\n sources.push(shallowCopy(tier.dasSource));\n var ss = tier.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n var nsh = shallowCopy(sh);\n nsh.method = tier.dasSource.name.replace(/[()+*?]/g, '\\\\$&');\n nsh._methodRE = null;\n nsh.style = shallowCopy(sh.style);\n if (nsh.style.ZINDEX === undefined) nsh.style.ZINDEX = sti;\n\n if (tier.forceMin) {\n nsh.style.MIN = tier.forceMin;\n }\n if (tier.forceMax) {\n nsh.style.MAX = tier.forceMax;\n }\n\n styles.push(nsh);\n }\n }\n\n this.addTier({ name: 'Merged',\n merge: 'concat',\n overlay: sources,\n noDownsample: true,\n style: styles });\n\n this.setSelectedTier(this.tiers.length - 1);\n};\n\n},{\"./cbrowser\":6,\"./utils\":56}],51:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tier-edit.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n\n var das = require('./das');\n var isDasBooleanTrue = das.isDasBooleanTrue;\n var isDasBooleanNotFalse = das.isDasBooleanNotFalse;\n var copyStylesheet = das.copyStylesheet;\n\n var color = require('./color');\n var dasColourForName = color.dasColourForName;\n\n var sourceDataURI = require('./sourcecompare').sourceDataURI;\n}\n\nvar __dalliance_smallGlyphs = {\n DOT: true,\n EX: true,\n STAR: true,\n SQUARE: true,\n CROSS: true,\n TRIANGLE: true,\n PLIMSOLL: true\n};\n\nBrowser.prototype.openTierPanel = function (tier) {\n var b = this;\n\n if (this.uiMode === 'tier' && this.manipulatingTier === tier) {\n this.hideToolPanel();\n this.setUiMode('none');\n } else if (!tier) {\n return;\n } else {\n var setStyleColors = function setStyleColors(style) {\n if (style.BGGRAD) return;\n\n if (numColors == 1) {\n if (style.glyph == 'LINEPLOT' || __dalliance_smallGlyphs[style.glyph]) {\n style.FGCOLOR = tierColorField.value;\n } else {\n style.BGCOLOR = tierColorField.value;\n }\n style.COLOR1 = style.COLOR2 = style.COLOR3 = null;\n } else {\n style.COLOR1 = tierColorField.value;\n style.COLOR2 = tierColorField2.value;\n if (numColors > 2) {\n style.COLOR3 = tierColorField3.value;\n } else {\n style.COLOR3 = null;\n }\n }\n style._gradient = null;\n style._plusColor = tierPlusColorField.value;\n style._minusColor = tierMinusColorField.value;\n };\n\n var mutateStylesheet = function mutateStylesheet(visitor) {\n var nss = copyStylesheet(tier.stylesheet);\n var ssScale = tier.browser.zoomForCurrentScale();\n\n for (var i = 0; i < nss.styles.length; ++i) {\n var sh = nss.styles[i];\n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n\n visitor(sh.style);\n }\n\n return nss;\n };\n\n var changeColor = function changeColor(ev) {\n tier.mergeStylesheet(mutateStylesheet(setStyleColors));\n };\n\n this.manipulatingTier = tier;\n\n var tierForm = makeElement('div', null, { className: 'tier-edit' });\n\n var aboutBanner = makeElement('div', \"About '\" + (tier.config.Name || tier.dasSource.name) + \"'\", null, { background: 'gray', paddingBottom: '5px', marginBottom: '5px', textAlign: 'center' });\n tierForm.appendChild(aboutBanner);\n\n var about = makeElement('div', [makeElement('p', tier.dasSource.desc)]);\n var aboutNotes = [];\n var sduri = sourceDataURI(tier.dasSource);\n if (sduri && (sduri.indexOf('http://') == 0 || sduri.indexOf('https://') == 0 || sduri.indexOf('//') == 0) && sduri !== 'https://www.biodalliance.org/magic/no_uri') {\n aboutNotes.push(makeElement('li', makeElement('a', '(Download data)', { href: sduri })));\n }\n\n if (tier.dasSource.mapping) {\n var coords = this.chains[tier.dasSource.mapping].coords;\n aboutNotes.push(makeElement('li', 'Mapped from ' + coords.auth + coords.version));\n }\n\n if (aboutNotes.length > 0) {\n about.appendChild(makeElement('ul', aboutNotes));\n }\n\n tierForm.appendChild(about);\n\n var semanticBanner = makeElement('span', ' (styles for current zoom level)', null, { display: 'none' });\n var editBanner = makeElement('div', ['Edit', semanticBanner], null, { background: 'gray', paddingBottom: '5px', marginBottom: '5px', textAlign: 'center' });\n tierForm.appendChild(editBanner);\n\n var tierNameField = makeElement('input', null, { type: 'text' });\n var tierPinnedToggle = makeElement('input', null, { type: 'checkbox', disabled: this.disablePinning });\n\n var glyphField = makeElement('select');\n glyphField.appendChild(makeElement('option', 'Histogram', { value: 'HISTOGRAM' }));\n glyphField.appendChild(makeElement('option', 'Line Plot', { value: 'LINEPLOT' }));\n glyphField.appendChild(makeElement('option', 'Ribbon', { value: 'GRADIENT' }));\n glyphField.appendChild(makeElement('option', 'Scatter', { value: 'SCATTER' }));\n\n var tierColorField = makeElement('input', null, { type: 'text', value: '#dd00dd' });\n var tierColorField2 = makeElement('input', null, { type: 'text', value: '#dd00dd' });\n var tierColorField3 = makeElement('input', null, { type: 'text', value: '#dd00dd' });\n\n var tierPlusColorField = makeElement('input', null, { type: 'text', value: '#ffa07a' });\n var tierMinusColorField = makeElement('input', null, { type: 'text', value: '#87cefa' });\n\n try {\n tierColorField.type = tierColorField2.type = tierColorField3.type = 'color';\n tierPlusColorField.type = tierMinusColorField.type = 'color';\n } catch (e) {\n // IE throws if attempt to set type to 'color'.\n }\n\n var tierColorFields = [tierColorField, tierColorField2, tierColorField3];\n var colorListPlus = makeElement('i', null, { className: 'fa fa-plus-circle' });\n var colorListMinus = makeElement('i', null, { className: 'fa fa-minus-circle' });\n var numColors = 1;\n var colorListElement = makeElement('td', tierColorFields);\n var setNumColors = function setNumColors(n) {\n numColors = n;\n for (var i = 0; i < n; ++i) {\n tierColorFields[i].style.display = 'block';\n }for (var i = n; i < tierColorFields.length; ++i) {\n tierColorFields[i].style.display = 'none';\n }\n };\n colorListPlus.addEventListener('click', function (ev) {\n if (numColors < 3) {\n setNumColors(numColors + 1);\n changeColor(null);\n }\n }, false);\n colorListMinus.addEventListener('click', function (ev) {\n if (numColors > 1) {\n setNumColors(numColors - 1);\n changeColor(null);\n }\n }, false);\n\n var tierMinField = makeElement('input', null, { type: 'text', value: '0.0' });\n var tierMaxField = makeElement('input', null, { type: 'text', value: '10.0' });\n var tierMinToggle = makeElement('input', null, { type: 'checkbox' });\n var tierMaxToggle = makeElement('input', null, { type: 'checkbox' });\n\n var quantLeapToggle = makeElement('input', null, { type: 'checkbox', checked: tier.quantLeapThreshold !== undefined });\n var quantLeapThreshField = makeElement('input', null, { type: 'text', value: tier.quantLeapThreshold, disabled: !quantLeapToggle.checked });\n\n var tierHeightField = makeElement('input', null, { type: 'text', value: '50' });\n\n var bumpToggle = makeElement('input', null, { type: 'checkbox' });\n var bumpLimit = makeElement('input', null, { type: 'text' });\n var labelToggle = makeElement('input', null, { type: 'checkbox' });\n\n var mainStyle = null;\n if (tier.stylesheet.styles.length > 0) {\n var s = mainStyle = tier.stylesheet.styles[0].style;\n }\n\n var refresh = function refresh() {\n if (typeof tier.config.name === 'string') tierNameField.value = tier.config.name;else tierNameField.value = tier.dasSource.name;\n\n tierPinnedToggle.checked = tier.pinned;\n\n if (tier.forceHeight) {\n tierHeightField.value = '' + tier.forceHeight;\n } else if (mainStyle && mainStyle.HEIGHT) {\n tierHeightField.value = '' + mainStyle.HEIGHT;\n }\n\n if (typeof tier.quantLeapThreshold == 'number') {\n quantLeapToggle.checked = true;\n quantLeapThreshField.disabled = false;\n if (parseFloat(quantLeapThreshField.value) != tier.quantLeapThreshold) quantLeapThreshField.value = tier.quantLeapThreshold;\n } else {\n quantLeapToggle.checked = false;\n quantLeapThreshField.disabled = true;\n }\n\n if (typeof tier.subtierMax == 'number') {\n bumpLimit.value = '' + tier.subtierMax;\n } else {\n bumpLimit.value = '' + (tier.dasSource.subtierMax || tier.browser.defaultSubtierMax);\n }\n\n if (tier.stylesheet.styles.length > 0) {\n var s = null;\n var isQuantitative = false,\n isSimpleQuantitative = false;\n var ssScale = tier.browser.zoomForCurrentScale();\n var activeStyleCount = 0;\n\n for (var si = 0; si < tier.stylesheet.styles.length; ++si) {\n var sh = tier.stylesheet.styles[si];\n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n ++activeStyleCount;\n var ss = tier.stylesheet.styles[si].style;\n\n if (!s) {\n s = mainStyle = ss;\n }\n\n if (ss.glyph == 'LINEPLOT' || ss.glyph == 'HISTOGRAM' || ss.glyph == 'GRADIENT' || isDasBooleanTrue(ss.SCATTER)) {\n if (!isQuantitative) s = mainStyle = ss;\n isQuantitative = true;\n }\n }\n if (!s) {\n return;\n }\n\n semanticBanner.style.display = activeStyleCount == tier.stylesheet.styles.length ? 'none' : 'inline';\n\n isSimpleQuantitative = isQuantitative && activeStyleCount == 1;\n var isGradient = s.COLOR2 || s.BGGRAD;\n\n if (isQuantitative) {\n minRow.style.display = 'table-row';\n maxRow.style.display = 'table-row';\n bumpRow.style.display = 'none';\n labelRow.style.display = 'none';\n } else {\n minRow.style.display = 'none';\n maxRow.style.display = 'none';\n bumpRow.style.display = 'table-row';\n bumpToggle.checked = isDasBooleanTrue(mainStyle.BUMP);\n bumpLimit.disabled = !isDasBooleanTrue(mainStyle.BUMP);\n labelRow.style.display = 'table-row';\n labelToggle.checked = isDasBooleanTrue(mainStyle.LABEL);\n }\n\n if (isSimpleQuantitative) {\n styleRow.style.display = 'table-row';\n colorRow.style.display = 'table-row';\n } else {\n styleRow.style.display = 'none';\n colorRow.style.display = 'none';\n }\n\n var numColors = 1;\n if (s.COLOR1) {\n tierColorField.value = dasColourForName(s.COLOR1).toHexString();\n if (s.COLOR2) {\n tierColorField2.value = dasColourForName(s.COLOR2).toHexString();\n if (s.COLOR3) {\n tierColorField3.value = dasColourForName(s.COLOR3).toHexString();\n numColors = 3;\n } else {\n numColors = 2;\n }\n }\n } else {\n if (s.glyph == 'LINEPLOT' || s.glyph == 'DOT' && s.FGCOLOR) {\n tierColorField.value = dasColourForName(s.FGCOLOR).toHexString();\n } else if (s.BGCOLOR) {\n tierColorField.value = dasColourForName(s.BGCOLOR).toHexString();\n }\n }\n setNumColors(numColors);\n\n if (s._plusColor) tierPlusColorField.value = dasColourForName(s._plusColor).toHexString() || s._plusColor;\n if (s._minusColor) tierMinusColorField.value = dasColourForName(s._minusColor).toHexString() || s._minusColor;\n if (isDasBooleanTrue(s.SCATTER)) {\n glyphField.value = 'SCATTER';\n } else {\n glyphField.value = s.glyph;\n }\n\n var setMinValue, setMaxValue;\n if (s.MIN !== undefined) {\n var x = parseFloat(s.MIN);\n if (!isNaN(x)) setMinValue = x;\n }\n if (!tier.forceMinDynamic && (s.MIN !== undefined || tier.forceMin !== undefined)) {\n tierMinToggle.checked = true;\n tierMinField.disabled = false;\n } else {\n tierMinToggle.checked = false;\n tierMinField.disabled = true;\n }\n\n if (s.MAX !== undefined) {\n var x = parseFloat(s.MAX);\n if (!isNaN(x)) setMaxValue = x;\n }\n if (!tier.forceMaxDynamic && (s.MAX !== undefined || tier.forceMax !== undefined)) {\n tierMaxToggle.checked = true;\n tierMaxField.disabled = false;\n } else {\n tierMaxToggle.checked = false;\n tierMaxField.disabled = true;\n }\n\n if (tier.forceMin != undefined) {\n setMinValue = tier.forceMin;\n }\n if (tier.forceMax != undefined) {\n setMaxValue = tier.forceMax;\n }\n if (typeof setMinValue == 'number' && setMinValue != parseFloat(tierMinField.value)) {\n tierMinField.value = setMinValue;\n }\n if (typeof setMaxValue == 'number' && setMaxValue != parseFloat(tierMaxField.value)) {\n tierMaxField.value = setMaxValue;\n }\n\n var seqStyle = getSeqStyle(tier.stylesheet);\n if (seqStyle) {\n seqMismatchRow.style.display = 'table-row';\n seqMismatchToggle.checked = seqStyle.__SEQCOLOR === 'mismatch';\n seqInsertRow.style.display = 'table-row';\n seqInsertToggle.checked = isDasBooleanTrue(seqStyle.__INSERTIONS);\n seqIgnoreQualsRow.style.display = 'table-row';\n seqIgnoreQualsToggle.checked = seqStyle.__disableQuals === undefined || seqStyle.__disableQuals === false;\n console.log(seqStyle.__disableQuals);\n } else {\n seqMismatchRow.style.display = 'none';\n seqInsertRow.style.display = 'none';\n seqIgnoreQualsRow.style.display = 'none';\n }\n\n if (seqStyle && seqMismatchToggle.checked && !isSimpleQuantitative) {\n plusStrandColorRow.style.display = 'table-row';\n minusStrandColorRow.style.display = 'table-row';\n } else {\n plusStrandColorRow.style.display = 'none';\n minusStrandColorRow.style.display = 'none';\n }\n }\n\n if (isQuantitative && tier.browser.sourceAdapterIsCapable(tier.featureSource, 'quantLeap')) quantLeapRow.style.display = 'table-row';else quantLeapRow.style.display = 'none';\n };\n\n var seqMismatchToggle = makeElement('input', null, { type: 'checkbox' });\n var seqMismatchRow = makeElement('tr', [makeElement('th', 'Highlight mismatches & strands'), makeElement('td', seqMismatchToggle)]);\n seqMismatchToggle.addEventListener('change', function (ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__SEQCOLOR = seqMismatchToggle.checked ? 'mismatch' : 'base';\n tier.mergeStylesheet(nss);\n });\n\n var seqInsertToggle = makeElement('input', null, { type: 'checkbox' });\n var seqInsertRow = makeElement('tr', [makeElement('th', 'Show insertions'), makeElement('td', seqInsertToggle)]);\n seqInsertToggle.addEventListener('change', function (ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__INSERTIONS = seqInsertToggle.checked ? 'yes' : 'no';\n tier.mergeStylesheet(nss);\n });\n\n var seqIgnoreQualsToggle = makeElement('input', null, { type: 'checkbox' });\n var seqIgnoreQualsRow = makeElement('tr', [makeElement('th', 'Reflect base quality as base color transparency'), makeElement('td', seqIgnoreQualsToggle)]);\n seqIgnoreQualsToggle.addEventListener('change', function (ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__disableQuals = !seqIgnoreQualsToggle.checked;\n console.log(seqStyle.__disableQuals);\n tier.mergeStylesheet(nss);\n });\n\n var styleRow = makeElement('tr', [makeElement('th', 'Style'), makeElement('td', glyphField)]);\n var colorRow = makeElement('tr', [makeElement('th', ['Colour(s)', colorListPlus, colorListMinus]), colorListElement]);\n var plusStrandColorRow = makeElement('tr', [makeElement('th', 'Plus Strand Color'), makeElement('td', tierPlusColorField)]);\n var minusStrandColorRow = makeElement('tr', [makeElement('th', 'Minus Strand Color'), makeElement('td', tierMinusColorField)]);\n var minRow = makeElement('tr', [makeElement('th', 'Min value'), makeElement('td', [tierMinToggle, ' ', tierMinField])]);\n var maxRow = makeElement('tr', [makeElement('th', 'Max value'), makeElement('td', [tierMaxToggle, ' ', tierMaxField])]);\n var quantLeapRow = makeElement('tr', [makeElement('th', 'Threshold leap:'), makeElement('td', [quantLeapToggle, ' ', quantLeapThreshField])]);\n var bumpRow = makeElement('tr', [makeElement('th', 'Bump overlaps'), makeElement('td', [bumpToggle, ' limit: ', bumpLimit])]);\n var labelRow = makeElement('tr', [makeElement('th', 'Label features'), makeElement('td', labelToggle)]);\n\n var tierTable = makeElement('table', [makeElement('tr', [makeElement('th', 'Name', {}, { width: '150px', textAlign: 'right' }), tierNameField]), makeElement('tr', [makeElement('th', 'Pin to top'), tierPinnedToggle]), makeElement('tr', [makeElement('th', 'Height'), makeElement('td', tierHeightField)]), styleRow, colorRow, plusStrandColorRow, minusStrandColorRow, minRow, maxRow, quantLeapRow, bumpRow, labelRow, seqMismatchRow, seqInsertRow, seqIgnoreQualsRow]);\n\n refresh();\n\n tierForm.appendChild(tierTable);\n\n var resetButton = makeElement('button', 'Reset track', { className: 'btn' }, { marginLeft: 'auto', marginRight: 'auto', display: 'block' });\n resetButton.addEventListener('click', function (ev) {\n tier.setConfig({});\n }, false);\n tierForm.appendChild(resetButton);\n\n tierNameField.addEventListener('input', function (ev) {\n tier.mergeConfig({ name: tierNameField.value });\n }, false);\n\n tierPinnedToggle.addEventListener('change', function (ev) {\n tier.mergeConfig({ pinned: tierPinnedToggle.checked });\n }, false);\n\n for (var ci = 0; ci < tierColorFields.length; ++ci) {\n tierColorFields[ci].addEventListener('change', changeColor, false);\n }\n\n tierPlusColorField.addEventListener('change', changeColor, false);\n tierMinusColorField.addEventListener('change', changeColor, false);\n\n glyphField.addEventListener('change', function (ev) {\n var nss = mutateStylesheet(function (ts) {\n if (glyphField.value === 'SCATTER') {\n ts.SCATTER = true;\n ts.glyph = 'DOT';\n ts.SIZE = '3';\n } else {\n ts.glyph = glyphField.value;\n ts.SCATTER = undefined;\n }\n setStyleColors(ts);\n });\n tier.mergeStylesheet(nss);\n }, false);\n\n tierMinToggle.addEventListener('change', function (ev) {\n var conf = { forceMinDynamic: !tierMinToggle.checked };\n tierMinField.disabled = !tierMinToggle.checked;\n var x = parseFloat(tierMinField.value);\n if (tierMinToggle.checked && typeof x == 'number' && !isNaN(x)) conf.forceMin = parseFloat(x);\n tier.mergeConfig(conf);\n });\n tierMinField.addEventListener('input', function (ev) {\n var x = parseFloat(tierMinField.value);\n if (typeof x == 'number' && !isNaN(x)) tier.mergeConfig({ forceMin: x });\n }, false);\n\n tierMaxToggle.addEventListener('change', function (ev) {\n var conf = { forceMaxDynamic: !tierMaxToggle.checked };\n tierMaxField.disabled = !tierMaxToggle.checked;\n var x = parseFloat(tierMaxField.value);\n if (tierMaxToggle.checked && typeof x == 'number' && !isNaN(x)) conf.forceMax = parseFloat(x);\n tier.mergeConfig(conf);\n });\n tierMaxField.addEventListener('input', function (ev) {\n var x = parseFloat(tierMaxField.value);\n if (typeof x == 'number' && !isNaN(x)) tier.mergeConfig({ forceMax: x });\n }, false);\n\n tierHeightField.addEventListener('input', function (ev) {\n var x = parseFloat(tierHeightField.value);\n if (typeof x == 'number' && !isNaN(x)) tier.mergeConfig({ height: Math.min(500, x | 0) });\n }, false);\n\n var updateQuant = function updateQuant() {\n quantLeapThreshField.disabled = !quantLeapToggle.checked;\n if (quantLeapToggle.checked) {\n var x = parseFloat(quantLeapThreshField.value);\n if (typeof x == 'number' && !isNaN(x)) {\n tier.mergeConfig({ quantLeapThreshold: parseFloat(quantLeapThreshField.value) });\n }\n } else {\n tier.mergeConfig({ quantLeapThreshold: null });\n }\n };\n quantLeapToggle.addEventListener('change', function (ev) {\n updateQuant();\n }, false);\n quantLeapThreshField.addEventListener('input', function (ev) {\n updateQuant();\n }, false);\n\n labelToggle.addEventListener('change', function (ev) {\n var nss = mutateStylesheet(function (style) {\n style.LABEL = labelToggle.checked ? 'yes' : 'no';\n });\n tier.mergeStylesheet(nss);\n }, false);\n bumpToggle.addEventListener('change', function (ev) {\n var nss = mutateStylesheet(function (style) {\n style.BUMP = bumpToggle.checked ? 'yes' : 'no';\n });\n tier.mergeStylesheet(nss);\n }, false);\n bumpLimit.addEventListener('input', function (ev) {\n var x = parseInt(bumpLimit.value);\n if (typeof x == 'number' && x > 0) {\n tier.mergeConfig({ subtierMax: x });\n }\n }, false);\n\n this.showToolPanel(tierForm);\n this.setUiMode('tier');\n\n tier.addTierListener(refresh);\n\n var currentScale = tier.browser.scale;\n tier.browser.addViewListener(function () {\n if (tier.browser.scale != currentScale) {\n currentScale = tier.browser.scale;\n refresh();\n }\n });\n }\n};\n\nfunction getSeqStyle(stylesheet) {\n for (var si = 0; si < stylesheet.styles.length; ++si) {\n var ss = stylesheet.styles[si].style;\n if (ss.glyph === '__SEQUENCE') {\n return ss;\n }\n }\n}\n\n},{\"./cbrowser\":6,\"./color\":9,\"./das\":10,\"./sourcecompare\":40,\"./utils\":56}],52:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// tier.js: (try) to encapsulate the functionality of a browser tier.\n//\n\n\"use strict\";\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\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n var shallowCopy = utils.shallowCopy;\n var pushnew = utils.pushnew;\n var miniJSONify = utils.miniJSONify;\n var arrayIndexOf = utils.arrayIndexOf;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n\n var sha1 = require('./sha1');\n var b64_sha1 = sha1.b64_sha1;\n\n var style = require('./style');\n var StyleFilter = style.StyleFilter;\n var StyleFilterSet = style.StyleFilterSet;\n\n var sc = require('./sourcecompare');\n var sourceDataURI = sc.sourceDataURI;\n\n var Promise = require('es6-promise').Promise;\n\n var sortFeatures = require('./features').sortFeatures;\n}\n\nvar __tier_idSeed = 0;\n\nfunction DasTier(browser, source, config, background) {\n var _this = this;\n\n this.config = config || {};\n this.id = 'tier' + ++__tier_idSeed;\n this.browser = browser;\n this.dasSource = shallowCopy(source);\n this.background = background;\n\n this.viewport = makeElement('canvas', null, { width: '' + ((this.browser.featurePanelWidth | 0) + 2000),\n height: \"30\",\n className: 'viewport_12_5' }, { position: 'inline-block',\n margin: '0px', border: '0px' });\n this.viewportHolder = makeElement('div', this.viewport, { className: 'viewport-holder_12_5' }, { background: background,\n position: 'absolute',\n padding: '0px', margin: '0px',\n border: '0px',\n left: '-1000px',\n minHeight: '200px' });\n this.overlay = makeElement('canvas', null, { width: +(this.browser.featurePanelWidth | 0),\n height: \"30\",\n className: 'viewport-overlay' });\n\n this.notifier = makeElement('div', '', { className: 'notifier' });\n this.notifierHolder = makeElement('div', this.notifier, { className: 'notifier-holder' });\n this.quantOverlay = makeElement('canvas', null, { width: '50', height: \"56\",\n className: 'quant-overlay' });\n\n this.removeButton = makeElement('i', null, { className: 'fa fa-times' });\n this.bumpButton = makeElement('i', null, { className: 'fa fa-plus-circle' });\n this.loaderButton = browser.makeLoader(16);\n this.loaderButton.style.display = 'none';\n this.infoElement = makeElement('div', this.dasSource.desc, { className: 'track-label-info' });\n this.nameButton = makeElement('div', [], { className: 'tier-tab' });\n this.nameButton.appendChild(this.removeButton);\n if (source.pennant) {\n this.nameButton.appendChild(makeElement('img', null, { src: source.pennant, width: '16', height: '16' }));\n } else if (source.mapping) {\n var version = null;\n if (this.browser.chains[source.mapping]) version = this.browser.chains[source.mapping].coords.version;\n if (version) this.nameButton.appendChild(makeElement('span', '' + version, null, { fontSize: '8pt', background: 'black', color: 'white', paddingLeft: '3px', paddingRight: '3px', paddingTop: '1px', paddingBottom: '1px', marginLeft: '2px', borderRadius: '10px' }));\n }\n this.nameElement = makeElement('span', source.name);\n this.nameButton.appendChild(makeElement('span', [this.nameElement, this.infoElement], { className: 'track-name-holder' }));\n this.nameButton.appendChild(this.bumpButton);\n this.nameButton.appendChild(this.loaderButton);\n\n this.label = makeElement('span', [this.nameButton], { className: 'btn-group track-label' });\n\n var classes = 'tier' + (source.className ? ' ' + source.className : '');\n this.row = makeElement('div', [this.viewportHolder, this.overlay, this.quantOverlay], { className: classes });\n\n if (!background) {\n this.row.style.background = 'none';\n }\n\n if (!browser.noDefaultLabels) this.row.appendChild(this.label);\n this.row.appendChild(this.notifierHolder);\n\n this.layoutHeight = 25;\n this.bumped = true;\n this.styleIdSeed = 0;\n if (source.quantLeapThreshold) {\n this.quantLeapThreshold = source.quantLeapThreshold;\n }\n if (this.dasSource.collapseSuperGroups) {\n this.bumped = false;\n }\n this.layoutWasDone = false;\n\n if (source.featureInfoPlugin) {\n this.addFeatureInfoPlugin(source.featureInfoPlugin);\n }\n\n this.initSources();\n\n var thisB = this;\n if (this.featureSource && this.featureSource.getDefaultFIPs && !source.noSourceFeatureInfo) {\n this.featureSource.getDefaultFIPs(function (fip) {\n if (fip) thisB.addFeatureInfoPlugin(fip);\n });\n }\n\n if (this.featureSource && this.featureSource.addReadinessListener) {\n this.readinessListener = function (ready) {\n thisB.notify(ready, -1);\n };\n this.featureSource.addReadinessListener(this.readinessListener);\n }\n\n if (this.featureSource && this.featureSource.addActivityListener) {\n this.activityListener = function (busy) {\n if (busy > 0) {\n thisB.loaderButton.style.display = 'inline-block';\n } else {\n thisB.loaderButton.style.display = 'none';\n }\n thisB.browser.pingActivity();\n };\n this.featureSource.addActivityListener(this.activityListener);\n }\n\n this.listeners = [];\n this.featuresLoadedListeners = [];\n this.firstRenderPromise = new Promise(function (resolve, reject) {\n return _this._resolveFirstRenderPromise = resolve;\n });\n}\n\nDasTier.prototype.destroy = function () {\n if (this.featureSource.removeReadinessListener) {\n this.featureSource.removeReadinessListener(this.readinessListener);\n }\n if (this.featureSource.removeActivityListener) {\n this.featureSource.removeActivityListener(this.activityListener);\n }\n};\n\nDasTier.prototype.setBackground = function (b) {\n this.background = b;\n this.viewportHolder.style.background = b;\n};\n\nDasTier.prototype.toString = function () {\n return this.id;\n};\n\nDasTier.prototype.addFeatureInfoPlugin = function (p) {\n if (!this.featureInfoPlugins) this.featureInfoPlugins = [];\n this.featureInfoPlugins.push(p);\n};\n\nDasTier.prototype.init = function () {\n var tier = this;\n return new Promise(function (resolve, reject) {\n\n if (tier.dasSource.style) {\n tier.setStylesheet({ styles: tier.dasSource.style });\n resolve(tier);\n } else {\n tier.status = 'Fetching stylesheet';\n tier.fetchStylesheet(function (ss, err) {\n if (err || !ss) {\n tier.error = 'No stylesheet';\n var ss = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n ss.pushStyle({ type: 'default' }, null, defStyle);\n tier.setStylesheet(ss);\n } else {\n tier.setStylesheet(ss);\n if (ss.geneHint) {\n tier.dasSource.collapseSuperGroups = true;\n tier.bumped = false;\n tier.updateLabel();\n }\n tier._updateFromConfig();\n }\n resolve(tier);\n });\n }\n });\n};\n\nDasTier.prototype.setStylesheet = function (ss) {\n this.baseStylesheet = shallowCopy(ss);\n for (var si = 0; si < this.baseStylesheet.styles.length; ++si) {\n var sh = this.baseStylesheet.styles[si] = shallowCopy(this.baseStylesheet.styles[si]);\n sh._methodRE = sh._labelRE = sh._typeRE = null;\n sh.style = shallowCopy(sh.style);\n sh.style.id = 'style' + ++this.styleIdSeed;\n }\n this.baseStylesheetValidity = b64_sha1(miniJSONify(this.baseStylesheet));\n this._updateFromConfig();\n};\n\nDasTier.prototype.getSource = function () {\n return this.featureSource;\n};\n\nDasTier.prototype.getDesiredTypes = function (scale) {\n var sfs = this.getActiveStyleFilters(scale);\n if (sfs) return sfs.typeList();\n};\n\nDasTier.prototype.getActiveStyleFilters = function (scale) {\n var ssScale = this.browser.zoomForCurrentScale();\n\n if (this.stylesheet) {\n var styles = new StyleFilterSet();\n var ss = this.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n if (!sh.zoom || sh.zoom == ssScale) {\n styles.add(new StyleFilter(sh.type, sh.method, sh.label));\n }\n }\n return styles;\n }\n};\n\nDasTier.prototype.needsSequence = function (scale) {\n var sourceConfigNeedsSeq = function sourceConfigNeedsSeq(s) {\n if (s.bamURI || s.bamBlob || s.bwgURI || s.bwgBlob) {\n return true;\n } else if (s.overlay) {\n return s.overlay.some(sourceConfigNeedsSeq);\n } else {\n return false;\n }\n };\n\n if (this.sequenceSource && scale < 5) {\n return true;\n } else if (sourceConfigNeedsSeq(this.dasSource) && scale < 20) {\n return true;\n }\n return false;\n};\n\nDasTier.prototype.setFeatures = function (chr, coverage, scale, features, sequence) {\n this.currentFeatures = features;\n this.currentSequence = sequence;\n this.knownChr = chr;\n this.knownCoverage = coverage;\n\n // only notify features loaded, if they are valid\n if (features) {\n sortFeatures(this);\n this.notifyFeaturesLoaded();\n }\n};\n\nDasTier.prototype.draw = function () {\n console.log(\"Use browser.getTierRenderer(tier).drawTier(tier)\");\n};\n\nDasTier.prototype.findNextFeature = function (chr, pos, dir, fedge, callback) {\n if (this.quantLeapThreshold) {\n var width = this.browser.viewEnd - this.browser.viewStart + 1;\n pos = pos + width * dir / 2 | 0;\n this.featureSource.quantFindNextFeature(chr, pos, dir, this.quantLeapThreshold, callback);\n } else {\n if (this.knownCoverage && pos >= this.knownCoverage.min() && pos <= this.knownCoverage.max()) {\n if (this.currentFeatures) {\n var bestFeature = null;\n for (var fi = 0; fi < this.currentFeatures.length; ++fi) {\n var f = this.currentFeatures[fi];\n if (!f.min || !f.max) {\n continue;\n }\n if (f.parents && f.parents.length > 0) {\n continue;\n }\n if (dir < 0) {\n if (fedge == 1 && f.max >= pos && f.min < pos) {\n if (!bestFeature || f.min > bestFeature.min || f.min == bestFeature.min && f.max < bestFeature.max) {\n bestFeature = f;\n }\n } else if (f.max < pos) {\n if (!bestFeature || f.max > bestFeature.max || f.max == bestFeature.max && f.min < bestFeature.min || f.min == bestFeature.mmin && bestFeature.max >= pos) {\n bestFeature = f;\n }\n }\n } else {\n if (fedge == 1 && f.min <= pos && f.max > pos) {\n if (!bestFeature || f.max < bestFeature.max || f.max == bestFeature.max && f.min > bestFeature.min) {\n bestFeature = f;\n }\n } else if (f.min > pos) {\n if (!bestFeature || f.min < bestFeature.min || f.min == bestFeature.min && f.max > bestFeature.max || f.max == bestFeature.max && bestFeature.min <= pos) {\n bestFeature = f;\n }\n }\n }\n }\n if (bestFeature) {\n return callback(bestFeature);\n }\n if (dir < 0) {\n pos = this.browser.knownSpace.min;\n } else {\n pos = this.browser.knownSpace.max;\n }\n }\n }\n\n this.trySourceFNF(chr, pos, dir, callback);\n }\n};\n\nDasTier.prototype.trySourceFNF = function (chr, pos, dir, callback) {\n var self = this;\n this.featureSource.findNextFeature(chr, pos, dir, function (feature) {\n if (!feature) callback(feature);\n\n var ss = self.browser.getSequenceSource();\n if (!ss) // We're probably in trouble, but return anyway.\n callback(feature);\n\n ss.getSeqInfo(feature.segment, function (si) {\n if (si) callback(feature);else self.trySourceFNF(feature.segment, dir > 0 ? 10000000000 : 0, dir, callback);\n });\n });\n};\n\nDasTier.prototype.updateLabel = function () {\n this.bumpButton.className = this.bumped ? 'fa fa-minus-circle' : 'fa fa-plus-circle';\n if (this.dasSource.collapseSuperGroups) {\n this.bumpButton.style.display = 'inline-block';\n } else {\n this.bumpButton.style.display = 'none';\n }\n};\n\nDasTier.prototype.updateHeight = function () {\n this.currentHeight = Math.max(Math.max(this.layoutHeight, this.label.clientHeight + 2), this.browser.minTierHeight);\n this.row.style.height = '' + this.currentHeight + 'px';\n this.browser.updateHeight();\n};\n\nDasTier.prototype.drawOverlay = function () {\n var t = this;\n var b = this.browser;\n var retina = b.retina && window.devicePixelRatio > 1;\n\n t.overlay.height = t.viewport.height;\n t.overlay.width = retina ? b.featurePanelWidth * 2 : b.featurePanelWidth;\n\n var g = t.overlay.getContext('2d');\n if (retina) {\n g.scale(2, 2);\n }\n\n var origin = b.viewStart;\n var visStart = b.viewStart;\n var visEnd = b.viewEnd;\n\n if (this.overlayLabelCanvas) {\n var offset = (this.glyphCacheOrigin - this.browser.viewStart) * this.browser.scale;\n g.save();\n g.translate(offset, 0);\n var drawStart = -offset + 2;\n if (this.dasSource.tierGroup) drawStart += 15;\n this.overlayLabelCanvas.draw(g, drawStart, b.featurePanelWidth - offset);\n g.restore();\n }\n\n for (var hi = 0; hi < b.highlights.length; ++hi) {\n var h = b.highlights[hi];\n if ((h.chr === b.chr || h.chr === 'chr' + b.chr) && h.min < visEnd && h.max > visStart) {\n g.globalAlpha = b.defaultHighlightAlpha;\n g.fillStyle = b.defaultHighlightFill;\n g.fillRect((h.min - origin) * b.scale, 0, (h.max - h.min) * b.scale, t.overlay.height);\n }\n }\n\n // t.oorigin = b.viewStart;\n t.overlay.style.width = b.featurePanelWidth;\n t.overlay.style.height = t.viewport.style.height;\n t.overlay.style.left = '0px';\n};\n\nDasTier.prototype.updateStatus = function (status) {\n var self = this;\n if (status) {\n this.status = status;\n this._notifierToStatus();\n var sd = sourceDataURI(this.dasSource);\n if (window.location.protocol === 'https:' && sourceDataURI(this.dasSource).indexOf('http:') == 0 && !this.checkedHTTP) {\n this.checkedHTTP = true;\n this.browser.canFetchPlainHTTP().then(function (can) {\n if (!can) {\n self.warnHTTP = true;\n self._notifierToStatus();\n }\n });\n }\n } else {\n if (this.status) {\n this.status = null;\n this._notifierToStatus();\n }\n }\n};\n\nDasTier.prototype.notify = function (message, timeout) {\n if (typeof timeout !== 'number') timeout = 2000;\n\n if (this.notifierFadeTimeout) {\n clearTimeout(this.notifierFadeTimeout);\n this.notifierFadeTimeout = null;\n }\n\n if (message) {\n this._notifierOn(message);\n if (timeout > 0) {\n var thisB = this;\n this.notifierFadeTimeout = setTimeout(function () {\n thisB._notifierToStatus();\n }, timeout);\n }\n } else {\n this._notifierToStatus();\n }\n};\n\nDasTier.prototype._notifierOn = function (message, warnHTTP) {\n removeChildren(this.notifier);\n if (warnHTTP) {\n this.notifier.appendChild(makeElement('span', [makeElement('a', '[HTTP Warning] ', { href: this.browser.httpWarningURL, target: \"_blank\" }), message]));\n } else {\n this.notifier.textContent = message;\n }\n this.notifier.style.opacity = 0.8;\n};\n\nDasTier.prototype._notifierOff = function () {\n this.notifier.style.opacity = 0;\n};\n\nDasTier.prototype._notifierToStatus = function () {\n if (this.status) {\n this._notifierOn(this.status, this.warnHTTP);\n } else {\n this._notifierOff();\n }\n};\n\nDasTier.prototype.setConfig = function (config) {\n this.config = config || {};\n this._updateFromConfig();\n this.notifyTierListeners();\n};\n\nDasTier.prototype.mergeStylesheet = function (newStyle) {\n this.mergeConfig({\n stylesheet: newStyle,\n stylesheetValidity: this.baseStylesheetValidity\n });\n};\n\nDasTier.prototype.mergeConfig = function (newConfig) {\n for (var k in newConfig) {\n this.config[k] = newConfig[k];\n }\n this._updateFromConfig();\n this.notifyTierListeners();\n};\n\nDasTier.prototype._updateFromConfig = function () {\n var needsRefresh = false;\n var needsReorder = false;\n\n if (typeof this.config.name === 'string') this.nameElement.textContent = this.config.name;else this.nameElement.textContent = this.dasSource.name;\n\n var wantedHeight = this.config.height || this.dasSource.forceHeight;\n if (wantedHeight != this.forceHeight) {\n this.forceHeight = wantedHeight;\n needsRefresh = true;\n }\n\n if (this.forceMinDynamic != this.config.forceMinDynamic) {\n this.forceMinDynamic = this.config.forceMinDynamic;\n needsRefresh = true;\n }\n\n var forceMin = this.config.forceMin != undefined ? this.config.forceMin : this.dasSource.forceMin;\n if (this.forceMin != forceMin) {\n this.forceMin = forceMin;\n needsRefresh = true;\n }\n\n if (this.forceMaxDynamic != this.config.forceMaxDynamic) {\n this.forceMaxDynamic = this.config.forceMaxDynamic;\n needsRefresh = true;\n }\n\n var forceMax = this.config.forceMax != undefined ? this.config.forceMax : this.dasSource.forceMax;\n if (this.forceMax != forceMax) {\n this.forceMax = forceMax;\n needsRefresh = true;\n }\n\n var quantLeapThreshold = null;\n if (this.config.quantLeapThreshold !== undefined) quantLeapThreshold = this.config.quantLeapThreshold;else if (this.dasSource.quantLeapThreshold !== undefined) quantLeapThreshold = this.dasSource.quantLeapThreshold;\n if (quantLeapThreshold != this.quantLeapThreshold) {\n this.quantLeapThreshold = quantLeapThreshold;\n needsRefresh = true;\n }\n\n // Possible FIXME -- are there cases where style IDs need to be reassigned?\n var stylesheet = null;\n if (this.config.stylesheetValidity == this.baseStylesheetValidity) stylesheet = this.config.stylesheet;\n stylesheet = stylesheet || this.baseStylesheet;\n if (this.stylesheet !== stylesheet) {\n this.stylesheet = stylesheet;\n needsRefresh = true;\n }\n\n var wantedPinned = this.config.pinned !== undefined ? this.config.pinned : this.dasSource.pinned;\n if (wantedPinned !== this.pinned) {\n this.pinned = wantedPinned;\n needsReorder = true;\n }\n\n var wantedSubtierMax = _typeof(this.config.subtierMax === 'number') ? this.config.subtierMax : this.dasSource.subtierMax || this.browser.defaultSubtierMax;\n if (wantedSubtierMax != this.subtierMax) {\n this.subtierMax = wantedSubtierMax;\n needsRefresh = true;\n }\n\n var wantedBumped;\n if (this.config.bumped !== undefined) {\n wantedBumped = this.config.bumped;\n } else if (this.dasSource.bumped !== undefined) {\n wantedBumped = this.dasSource.bumped;\n } else {\n wantedBumped = this.dasSource.collapseSuperGroups ? false : true;\n }\n if (wantedBumped !== this.bumped) {\n this.bumped = wantedBumped;\n needsRefresh = true;\n this.updateLabel();\n }\n\n if (needsRefresh) this.scheduleRedraw();\n\n if (needsReorder) this.browser.reorderTiers();\n};\n\nDasTier.prototype.scheduleRedraw = function () {\n if (!this.currentFeatures) return;\n\n var tier = this;\n\n if (!this.redrawTimeout) {\n this.redrawTimeout = setTimeout(function () {\n sortFeatures(tier); // Some render actions mutate the results of this,\n // => need to re-run before refreshing.\n var renderer = tier.browser.getTierRenderer(tier);\n renderer.drawTier(tier);\n tier.redrawTimeout = null;\n }, 10);\n }\n};\nDasTier.prototype.clearTierListeners = function () {\n this.listeners = [];\n};\n\nDasTier.prototype.addTierListener = function (l) {\n this.listeners.push(l);\n};\n\nDasTier.prototype.removeTierListener = function (l) {\n var idx = arrayIndexOf(this.listeners, l);\n if (idx >= 0) {\n this.listeners.splice(idx, 1);\n }\n};\n\nDasTier.prototype.notifyTierListeners = function (change) {\n for (var li = 0; li < this.listeners.length; ++li) {\n try {\n this.listeners[li](change);\n } catch (e) {\n console.log(e);\n }\n }\n this.browser.notifyTier();\n};\n\nDasTier.prototype.clearFeaturesLoadedListeners = function () {\n this.featuresLoadedListeners = [];\n};\n\nDasTier.prototype.addFeaturesLoadedListener = function (handler) {\n this.featuresLoadedListeners.push(handler);\n};\n\nDasTier.prototype.removeFeaturesLoadedListener = function (handler) {\n var idx = arrayIndexOf(this.featuresLoadedListeners, handler);\n if (idx >= 0) {\n this.featuresLoadedListeners.splice(idx, 1);\n }\n};\n\nDasTier.prototype.notifyFeaturesLoaded = function () {\n for (var li = 0; li < this.featuresLoadedListeners.length; ++li) {\n try {\n this.featuresLoadedListeners[li].call(this);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nDasTier.prototype.wasRendered = function () {\n this._resolveFirstRenderPromise();\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n DasTier: DasTier\n };\n\n // Imported for side effects\n var fd = require('./feature-draw');\n}\n\n},{\"./das\":10,\"./feature-draw\":20,\"./features\":22,\"./sha1\":38,\"./sourcecompare\":40,\"./style\":42,\"./utils\":56,\"es6-promise\":384}],53:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// track-adder.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var sc = require('./sourcecompare');\n var sourcesAreEqual = sc.sourcesAreEqual;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n var Observed = utils.Observed;\n\n var thub = require('./thub');\n var THUB_COMPARE = thub.THUB_COMPARE;\n var connectTrackHub = thub.connectTrackHub;\n\n var domui = require('./domui');\n var makeTreeTableSection = domui.makeTreeTableSection;\n\n var probeResource = require('./probe').probeResource;\n\n // Most of this could disappear if we leave all probing to the probe module...\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n var readInt = bin.readInt;\n\n var lh3utils = require('./lh3utils');\n var unbgzf = lh3utils.unbgzf;\n\n var bam = require('./bam');\n var BAM_MAGIC = bam.BAM_MAGIC;\n var BAI_MAGIC = bam.BAI_MAGIC;\n\n var tbi = require('./tabix');\n var TABIX_MAGIC = tbi.TABIX_MAGIC;\n\n var das = require('./das');\n var DASSource = das.DASSource;\n var DASSegment = das.DASSegment;\n var DASRegistry = das.DASRegistry;\n var coordsMatch = das.coordsMatch;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nBrowser.prototype.currentlyActive = function (source) {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (sourcesAreEqual(this.tiers[ti].dasSource, source)) return this.tiers[ti];\n }\n return false;\n};\n\nBrowser.prototype.makeButton = function (name, tooltip) {\n var regButton = makeElement('a', name, { href: '#' });\n if (tooltip) {\n this.makeTooltip(regButton, tooltip);\n }\n return makeElement('li', regButton);\n};\n\nfunction activateButton(addModeButtons, which) {\n for (var i = 0; i < addModeButtons.length; ++i) {\n var b = addModeButtons[i];\n if (b === which) {\n b.classList.add('active');\n } else {\n b.classList.remove('active');\n }\n }\n}\n\nBrowser.prototype.showTrackAdder = function (ev) {\n if (this.uiMode === 'add') {\n this.hideToolPanel();\n this.setUiMode('none');\n return;\n }\n\n var thisB = this;\n\n var popup = makeElement('div', null, { className: 'dalliance' }, { width: '100%', display: 'inline-block', boxSizing: 'border-box', MozBoxSizing: 'border-box', verticalAlign: 'top', paddingRight: '15px' });\n\n var addModeButtons = [];\n var makeStab, makeStabObserver;\n\n if (!this.noRegistryTabs) {\n var regButton = this.makeButton('Registry', 'Browse compatible datasources from the DAS registry');\n addModeButtons.push(regButton);\n\n for (var m in this.mappableSources) {\n var mf = function mf(mm) {\n var mapButton = thisB.makeButton(thisB.chains[mm].srcTag, 'Browse datasources mapped from ' + thisB.chains[mm].srcTag);\n addModeButtons.push(mapButton);\n mapButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n activateButton(addModeButtons, mapButton);\n makeStab(thisB.mappableSources[mm], mm);\n }, false);\n };mf(m);\n }\n }\n\n var groupedDefaults = {};\n for (var si = 0; si < this.defaultSources.length; ++si) {\n var s = this.defaultSources[si];\n var g = s.group || 'Defaults';\n if (groupedDefaults[g]) {\n groupedDefaults[g].push(s);\n } else {\n groupedDefaults[g] = [s];\n }\n }\n\n var makeHubButton = function makeHubButton(tdb) {\n var hub = tdb.hub;\n var hubMenuButton = makeElement('i', null, { className: 'fa fa-list-alt' }, { cursor: 'context-menu' });\n var label = hub.altLabel || hub.shortLabel || 'Unknown';\n if (tdb.mapping) label = label + ' (' + tdb.genome + ')';\n var hbContent = makeElement('span', [label, ' ', hubMenuButton]);\n var hubButton = thisB.makeButton(hbContent, hub.longLabel);\n hubButton.hub = tdb;\n addModeButtons.push(hubButton);\n\n hubButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n activateButton(addModeButtons, hubButton);\n removeChildren(stabHolder);\n var loader = thisB.makeLoader(24);\n loader.style.marginLeft = 'auto';\n loader.style.marginRight = 'auto';\n loader.style.marginTop = '100px';\n stabHolder.appendChild(makeElement('div', loader, null, { textAlign: 'center' }));\n\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n\n tdb.getTracks(function (tracks, err) {\n if (err) {\n console.log(err);\n }\n\n makeHubStab(tracks);\n });\n }, false);\n\n hubMenuButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n\n var removeHubItem = makeElement('li', makeElement('a', 'Remove hub'));\n var allOnItem = makeElement('li', makeElement('a', 'Enable all'));\n var allOffItem = makeElement('li', makeElement('a', 'Disable all'));\n var hubMenu = makeElement('ul', [removeHubItem, allOnItem, allOffItem], { className: 'dropdown-menu' }, { display: 'block' });\n\n var mx = ev.clientX,\n my = ev.clientY;\n mx += document.documentElement.scrollLeft || document.body.scrollLeft;\n my += document.documentElement.scrollTop || document.body.scrollTop;\n\n hubMenu.style.position = 'absolute';\n hubMenu.style.top = '' + (my + 10) + 'px';\n hubMenu.style.left = '' + (mx - 30) + 'px';\n thisB.hPopupHolder.appendChild(hubMenu);\n\n var clickCatcher = function clickCatcher(ev) {\n console.log('cc');\n document.body.removeEventListener('click', clickCatcher, true);\n thisB.hPopupHolder.removeChild(hubMenu);\n };\n document.body.addEventListener('click', clickCatcher, true);\n\n removeHubItem.addEventListener('click', function (ev) {\n for (var hi = 0; hi < thisB.hubObjects.length; ++hi) {\n if (thisB.hubObjects[hi].absURL == tdb.absURL) {\n thisB.hubObjects.splice(hi, 1);\n break;\n }\n }\n for (var hi = 0; hi < thisB.hubs.length; ++hi) {\n var hc = thisB.hubs[hi];\n if (typeof hc === 'string') hc = { url: hc };\n if (hc.url == tdb.hub.url && !hc.genome || hc.genome == tdb.genome) {\n thisB.hubs.splice(hi, 1);\n break;\n }\n }\n\n thisB.notifyTier();\n\n modeButtonHolder.removeChild(hubButton);\n activateButton(addModeButtons, addHubButton);\n switchToHubConnectMode();\n }, false);\n\n allOnItem.addEventListener('click', function (ev) {\n tdb.getTracks(function (tracks, err) {\n if (err) {\n console.log(err);\n }\n\n for (var ti = 0; ti < tracks.length; ++ti) {\n var ds = tracks[ti].toDallianceSource();\n if (!thisB.currentlyActive(ds)) {\n thisB.addTier(ds);\n }\n }\n });\n }, false);\n\n allOffItem.addEventListener('click', function (ev) {\n tdb.getTracks(function (tracks, err) {\n if (err) {\n console.log(err);\n }\n\n for (var ti = 0; ti < tracks.length; ++ti) {\n var ds = tracks[ti].toDallianceSource();\n if (thisB.currentlyActive(ds)) {\n thisB.removeTier(ds);\n }\n }\n });\n }, false);\n }, false);\n\n return hubButton;\n };\n\n var firstDefButton = null;\n var firstDefSources = null;\n for (var g in groupedDefaults) {\n (function (g, ds) {\n var defButton = thisB.makeButton(g, 'Browse the default set of data for this browser');\n defButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n activateButton(addModeButtons, defButton);\n makeStab(new Observed(ds));\n }, false);\n addModeButtons.push(defButton);\n\n if (!firstDefButton || thisB.defaultTrackAdderTab && thisB.defaultTrackAdderTab == g) {\n firstDefButton = defButton;\n firstDefSources = ds;\n }\n })(g, groupedDefaults[g]);\n }\n var custButton = this.makeButton('DAS', 'Add data using the DAS protocol');\n addModeButtons.push(custButton);\n var binButton = this.makeButton('Files', 'Add data from files on disk or the web');\n addModeButtons.push(binButton);\n\n for (var hi = 0; hi < this.hubObjects.length; ++hi) {\n var hub = this.hubObjects[hi];\n makeHubButton(hub);\n }\n\n var addHubButton = this.makeButton('+', 'Connect to a new track-hub');\n addModeButtons.push(addHubButton);\n\n var modeButtonHolder = makeElement('ul', addModeButtons, { className: 'nav nav-tabs' }, { marginBottom: '0px' });\n popup.appendChild(modeButtonHolder);\n\n var custURL, custName, custCS, custQuant, custFile, custUser, custPass;\n var customMode = false;\n var dataToFinalize = null;\n\n var asform = makeElement('form', null, {}, { display: 'inline-block', width: '100%' });\n asform.addEventListener('submit', function (ev) {\n ev.stopPropagation();ev.preventDefault();\n doAdd();\n return false;\n }, true);\n var stabHolder = makeElement('div');\n stabHolder.style.position = 'relative';\n stabHolder.style.overflow = 'scroll';\n // stabHolder.style.height = '500px';\n asform.appendChild(stabHolder);\n\n var __mapping;\n var __sourceHolder;\n\n makeStab = function makeStab(msources, mapping) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n if (__sourceHolder) {\n __sourceHolder.removeListener(makeStabObserver);\n }\n __mapping = mapping;\n __sourceHolder = msources;\n __sourceHolder.addListenerAndFire(makeStabObserver);\n };\n\n makeStabObserver = function makeStabObserver(msources) {\n customMode = false;\n var buttons = [];\n removeChildren(stabHolder);\n if (!msources) {\n stabHolder.appendChild(makeElement('p', 'Dalliance was unable to retrieve data source information from the DAS registry, please try again later'));\n return;\n }\n\n var stabBody = makeElement('tbody', null, { className: 'table table-striped table-condensed' }, { width: '100%' });\n var stab = makeElement('table', stabBody, { className: 'table table-striped table-condensed' }, { width: '100%', tableLayout: 'fixed' });\n var idx = 0;\n\n var sources = [];\n for (var i = 0; i < msources.length; ++i) {\n sources.push(msources[i]);\n }\n\n sources.sort(function (a, b) {\n return a.name.toLowerCase().trim().localeCompare(b.name.toLowerCase().trim());\n });\n\n for (var i = 0; i < sources.length; ++i) {\n var source = sources[i];\n var r = makeElement('tr');\n\n var bd = makeElement('td', null, {}, { width: '30px' });\n bd.style.textAlign = 'center';\n if (!source.props || source.props.cors) {\n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = source;\n b.id = 'sourcecb' + i;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n // b.checked = thisB.currentlyActive(source);\n bd.appendChild(b);\n buttons.push(b);\n b.addEventListener('change', function (ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n } else {\n bd.appendChild(document.createTextNode('!'));\n thisB.makeTooltip(bd, makeElement('span', [\"This data source isn't accessible because it doesn't support \", makeElement('a', \"CORS\", { href: 'http://www.w3.org/TR/cors/' }), \".\"]));\n }\n r.appendChild(bd);\n var ld = makeElement('label', null, { htmlFor: 'sourcecb' + i });\n ld.appendChild(document.createTextNode(source.name));\n if (source.desc && source.desc.length > 0) {\n thisB.makeTooltip(ld, source.desc);\n }\n r.appendChild(makeElement('td', ld));\n stabBody.appendChild(r);\n ++idx;\n }\n\n var setChecks = function setChecks() {\n for (var bi = 0; bi < buttons.length; ++bi) {\n var b = buttons[bi];\n var t = thisB.currentlyActive(b.dalliance_source);\n if (t) {\n b.checked = true;\n } else {\n b.checked = false;\n }\n }\n };\n setChecks();\n thisB.addTierListener(function (l) {\n setChecks();\n });\n\n stabHolder.appendChild(stab);\n };\n\n function makeHubStab(tracks) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n\n customMode = false;\n removeChildren(stabHolder);\n\n var buttonIdSeed = 0;\n\n var ttab = makeElement('div', null, {}, { width: '100%' });\n var sources = [];\n for (var i = 0; i < tracks.length; ++i) {\n sources.push(tracks[i]);\n }\n\n sources.sort(function (a, b) {\n return a.shortLabel.toLowerCase().trim().localeCompare(b.shortLabel.toLowerCase().trim());\n });\n\n var groups = [];\n var tops = [];\n\n for (var ti = 0; ti < sources.length; ++ti) {\n var track = sources[ti];\n if (track.children && track.children.length > 0 && track.container != 'multiWig') {\n groups.push(track);\n } else {\n tops.push(track);\n }\n }\n if (tops.length > 0) {\n groups.push({\n shortLabel: 'Others',\n priority: -100000000,\n children: tops });\n }\n\n groups.sort(THUB_COMPARE);\n\n var buttons = [];\n for (var gi = 0; gi < groups.length; ++gi) {\n var group = groups[gi];\n var dg = group;\n if (!dg.dimensions && dg._parent && dg._parent.dimensions) dg = dg._parent;\n\n var dprops = {};\n if (dg.dimensions) {\n var dtoks = dg.dimensions.split(/(\\w+)=(\\w+)/);\n for (var dti = 0; dti < dtoks.length - 2; dti += 3) {\n dprops[dtoks[dti + 1]] = dtoks[dti + 2];\n }\n }\n\n if (dprops.dimX && dprops.dimY) {\n var dimX = dprops.dimX,\n dimY = dprops.dimY;\n var sgX = dg.subgroups[dimX];\n var sgY = dg.subgroups[dimY];\n\n var trks = {};\n for (var ci = 0; ci < group.children.length; ++ci) {\n var child = group.children[ci];\n var vX = child.sgm[dimX],\n vY = child.sgm[dimY];\n if (!trks[vX]) trks[vX] = {};\n trks[vX][vY] = child;\n }\n\n var matrix = makeElement('table', null, { className: 'table table-striped table-condensed' }, { tableLayout: 'fixed' });\n {\n var header = makeElement('tr');\n header.appendChild(makeElement('th', null, {}, { width: '150px', height: '100px' })); // blank corner element\n for (var si = 0; si < sgX.titles.length; ++si) {\n var h = makeElement('th', makeElement('div', sgX.titles[si], {}, { transform: 'rotate(-60deg)',\n transformOrigin: '0% 100%',\n webkitTransform: 'rotate(-60deg) translate(20px,10px)',\n webkitTransformOrigin: '0% 100%',\n textAlign: 'left' }), {}, { width: '35px',\n height: '100px',\n verticalAlign: 'bottom' });\n header.appendChild(h);\n }\n matrix.appendChild(header);\n }\n\n var mbody = makeElement('tbody', null, { className: 'table table-striped table-condensed' });\n for (var yi = 0; yi < sgY.titles.length; ++yi) {\n var vY = sgY.tags[yi];\n var row = makeElement('tr');\n row.appendChild(makeElement('th', sgY.titles[yi]), {});\n\n for (var xi = 0; xi < sgX.titles.length; ++xi) {\n var vX = sgX.tags[xi];\n var cell = makeElement('td');\n if (trks[vX] && trks[vX][vY]) {\n var track = trks[vX][vY];\n var ds = track.toDallianceSource();\n if (!ds) continue;\n\n var r = makeElement('tr');\n var bd = makeElement('td');\n bd.style.textAlign = 'center';\n\n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = ds;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n buttons.push(b);\n cell.appendChild(b);\n b.addEventListener('change', function (ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n }\n row.appendChild(cell);\n }\n mbody.appendChild(row);\n }\n matrix.appendChild(mbody);\n ttab.appendChild(makeTreeTableSection(group.shortLabel, matrix, gi == 0));\n } else {\n var stabBody = makeElement('tbody', null, { className: 'table table-striped table-condensed' });\n var stab = makeElement('table', stabBody, { className: 'table table-striped table-condensed' }, { width: '100%', tableLayout: 'fixed' });\n var idx = 0;\n\n group.children.sort(THUB_COMPARE);\n for (var i = 0; i < group.children.length; ++i) {\n var buttonId = 'hb' + ++buttonIdSeed;\n\n var track = group.children[i];\n var ds = track.toDallianceSource();\n if (!ds) continue;\n\n var r = makeElement('tr');\n var bd = makeElement('td', null, {}, { width: '30px' });\n bd.style.textAlign = 'center';\n\n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = ds;\n b.id = buttonId;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n buttons.push(b);\n bd.appendChild(b);\n b.addEventListener('change', function (ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n\n r.appendChild(bd);\n var ld = makeElement('label', null, { htmlFor: buttonId });\n ld.appendChild(document.createTextNode(track.shortLabel));\n if (track.longLabel && track.longLabel.length > 0) {\n thisB.makeTooltip(ld, track.longLabel);\n }\n r.appendChild(makeElement('td', ld));\n stabBody.appendChild(r);\n ++idx;\n }\n\n if (groups.length > 1 || group.shortLabel !== 'Others') {\n ttab.appendChild(makeTreeTableSection(group.shortLabel, stab, gi == 0));\n } else {\n ttab.appendChild(stab);\n }\n }\n }\n\n var setChecks = function setChecks() {\n for (var bi = 0; bi < buttons.length; ++bi) {\n var b = buttons[bi];\n var t = thisB.currentlyActive(b.dalliance_source);\n if (t) {\n b.checked = true;\n b.disabled = t.sequenceSource != null;\n } else {\n b.checked = false;\n }\n }\n };\n setChecks();\n thisB.addTierListener(function (l) {\n setChecks();\n });\n\n stabHolder.appendChild(ttab);\n }\n\n if (regButton) {\n regButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n activateButton(addModeButtons, regButton);\n makeStab(thisB.availableSources);\n }, false);\n }\n\n binButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n switchToBinMode();\n }, false);\n addHubButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n switchToHubConnectMode();\n }, false);\n\n function switchToBinMode() {\n activateButton(addModeButtons, binButton);\n customMode = 'bin';\n\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n removeChildren(stabHolder);\n var pageHolder = makeElement('div', null, {}, { paddingLeft: '10px', paddingRight: '10px' });\n pageHolder.appendChild(makeElement('h3', 'Add custom URL-based data'));\n pageHolder.appendChild(makeElement('p', ['You can add indexed binary data hosted on an web server that supports CORS (', makeElement('a', 'full details', { href: 'http://www.biodalliance.org/bin.html' }), '). Currently supported formats are bigwig, bigbed, and indexed BAM.']));\n\n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(document.createTextNode('URL: '));\n custURL = makeElement('input', '', { size: 80, value: 'http://www.biodalliance.org/datasets/ensGene.bb' }, { width: '100%' });\n pageHolder.appendChild(custURL);\n\n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(makeElement('b', '- or -'));\n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(document.createTextNode('File: '));\n custFile = makeElement('input', null, { type: 'file', multiple: 'multiple' });\n pageHolder.appendChild(custFile);\n\n pageHolder.appendChild(makeElement('p', 'Clicking the \"Add\" button below will initiate a series of test queries.'));\n\n stabHolder.appendChild(pageHolder);\n custURL.focus();\n }\n\n function switchToHubConnectMode() {\n activateButton(addModeButtons, addHubButton);\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n customMode = 'hub-connect';\n refreshButton.style.visibility = 'hidden';\n\n removeChildren(stabHolder);\n\n var pageHolder = makeElement('div', null, {}, { paddingLeft: '10px', paddingRight: '10px' });\n pageHolder.appendChild(makeElement('h3', 'Connect to a track hub.'));\n pageHolder.appendChild(makeElement('p', ['Enter the top-level URL (usually points to a file called \"hub.txt\") of a UCSC-style track hub']));\n\n custURL = makeElement('input', '', { size: 120, value: 'http://www.biodalliance.org/datasets/testhub/hub.txt' }, { width: '100%' });\n pageHolder.appendChild(custURL);\n\n stabHolder.appendChild(pageHolder);\n\n custURL.focus();\n }\n\n custButton.addEventListener('click', function (ev) {\n ev.preventDefault();ev.stopPropagation();\n switchToCustomMode();\n }, false);\n\n function switchToCustomMode() {\n activateButton(addModeButtons, custButton);\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n customMode = 'das';\n\n removeChildren(stabHolder);\n\n var customForm = makeElement('div', null, {}, { paddingLeft: '10px', paddingRight: '10px' });\n customForm.appendChild(makeElement('h3', 'Add custom DAS data'));\n customForm.appendChild(makeElement('p', 'This interface is intended for adding custom or lab-specific data. Public data can be added more easily via the registry interface.'));\n\n customForm.appendChild(document.createTextNode('URL: '));\n customForm.appendChild(makeElement('br'));\n custURL = makeElement('input', '', { size: 80, value: 'http://www.derkholm.net:8080/das/medipseq_reads/' }, { width: '100%' });\n customForm.appendChild(custURL);\n\n customForm.appendChild(makeElement('p', 'Clicking the \"Add\" button below will initiate a series of test queries. If the source is password-protected, you may be prompted to enter credentials.'));\n stabHolder.appendChild(customForm);\n\n custURL.focus();\n }\n\n var addButton = makeElement('button', 'Add', { className: 'btn btn-primary' });\n addButton.addEventListener('click', function (ev) {\n ev.stopPropagation();ev.preventDefault();\n doAdd();\n }, false);\n\n function doAdd() {\n if (customMode) {\n if (customMode === 'das') {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n var nds = new DASSource({ name: 'temporary', uri: curi });\n tryAddDAS(nds);\n } else if (customMode === 'bin') {\n var fileList = custFile.files;\n\n if (fileList && fileList.length > 0) {\n tryAddMultiple(fileList);\n } else {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n var source = { uri: curi };\n var lcuri = curi.toLowerCase();\n if (lcuri.indexOf(\"https://www.encodeproject.org/\") == 0 && lcuri.indexOf(\"@@download\") >= 0) {\n source.transport = 'encode';\n }\n tryAddBin(source);\n }\n } else if (customMode === 'reset') {\n switchToCustomMode();\n } else if (customMode === 'reset-bin') {\n switchToBinMode();\n } else if (customMode === 'reset-hub') {\n switchToHubConnectMode();\n } else if (customMode === 'prompt-bai') {\n var fileList = custFile.files;\n if (fileList && fileList.length > 0 && fileList[0]) {\n dataToFinalize.baiBlob = fileList[0];\n completeBAM(dataToFinalize);\n } else {\n promptForBAI(dataToFinalize);\n }\n } else if (customMode === 'prompt-tbi') {\n var fileList = custFile.files;\n if (fileList && fileList.length > 0 && fileList[0]) {\n dataToFinalize.indexBlob = fileList[0];\n completeTabixVCF(dataToFinalize);\n } else {\n promptForTabix(dataToFinalize);\n }\n } else if (customMode === 'finalize' || customMode === 'finalize-bin') {\n dataToFinalize.name = custName.value;\n var m = custCS.value;\n if (m != '__default__') {\n dataToFinalize.mapping = m;\n } else {\n dataToFinalize.mapping = undefined;\n }\n if (custQuant) {\n dataToFinalize.maxbins = custQuant.checked;\n }\n\n if (custUser.value.length > 1 && custPass.value.length > 1) {\n dataToFinalize.xUser = custUser.value;\n dataToFinalize.xPass = custPass.value;\n }\n\n thisB.addTier(dataToFinalize);\n\n if (customMode == 'finalize-bin') switchToBinMode();else switchToCustomMode();\n } else if (customMode === 'hub-connect') {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n\n tryAddHub(curi);\n } else if (customMode === 'multiple') {\n for (var mi = 0; mi < multipleSet.length; ++mi) {\n var s = multipleSet[mi];\n if (s.hidden) continue;\n\n if (s.tier_type == 'bam' && !s.indexBlob && !s.indexUri) continue;\n if (s.tier_type == 'tabix' && !s.indexBlob && !s.indexUri) continue;\n\n var nds = makeSourceConfig(s);\n if (nds) {\n nds.noPersist = true;\n thisB.addTier(nds);\n }\n }\n\n switchToBinMode();\n }\n } else {\n thisB.removeAllPopups();\n }\n };\n\n function tryAddHub(curi, opts, retry) {\n opts = opts || {};\n for (var hi = 0; hi < thisB.hubObjects.length; ++hi) {\n var h = thisB.hubObjects[hi];\n if (h.hub.url == curi) {\n for (var bi = 0; bi < addModeButtons.length; ++bi) {\n if (addModeButtons[bi].hub == h) {\n activateButton(addModeButtons, addModeButtons[bi]);\n }\n }\n h.getTracks(function (tracks, err) {\n if (err) {\n console.log(err);\n }\n makeHubStab(tracks);\n });\n return;\n }\n }\n\n connectTrackHub(curi, function (hub, err) {\n if (err) {\n if (!retry) {\n return tryAddHub(curi, { credentials: true }, true);\n }\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Error connecting to track hub'));\n stabHolder.appendChild(makeElement('p', err));\n customMode = 'reset-hub';\n return;\n } else {\n var bestHub = null;\n var bestHubButton = null;\n for (var genome in hub.genomes) {\n var mapping = null;\n var okay = false;\n\n if (genome == thisB.coordSystem.ucscName) {\n okay = true;\n } else {\n for (var mid in thisB.chains) {\n var m = thisB.chains[mid];\n if (genome == m.coords.ucscName) {\n mapping = mid;\n okay = true;\n }\n }\n }\n\n if (okay) {\n var hc = { url: curi, genome: genome };\n if (opts.credentials) hc.credentials = true;\n if (mapping) {\n hc.mapping = mapping;\n hub.genomes[genome].mapping = mapping;\n }\n thisB.hubs.push(hc);\n thisB.hubObjects.push(hub.genomes[genome]);\n\n var hubButton = makeHubButton(hub.genomes[genome]);\n modeButtonHolder.appendChild(hubButton);\n\n if (!mapping || !bestHub) {\n bestHub = hub.genomes[genome];\n bestHubButton = hubButton;\n }\n }\n }\n\n if (bestHub) {\n thisB.notifyTier();\n activateButton(addModeButtons, bestHubButton);\n bestHub.getTracks(function (tracks, err) {\n makeHubStab(tracks);\n });\n } else {\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'No data for this genome'));\n stabHolder.appendChild(makeElement('p', 'This URL appears to be a valid track-hub, but it doesn\\'t contain any data for the coordinate system of this browser'));\n stabHolder.appendChild(makeElement('p', 'coordSystem.ucscName = ' + thisB.coordSystem.ucscName));\n customMode = 'reset-hub';\n return;\n }\n }\n }, opts);\n }\n\n var tryAddDAS = function tryAddDAS(nds, retry) {\n var knownSpace = thisB.knownSpace;\n if (!knownSpace) {\n alert(\"Can't confirm track-addition to an uninit browser.\");\n return;\n }\n var tsm = Math.max(knownSpace.min, (knownSpace.min + knownSpace.max - 100) / 2) | 0;\n var testSegment = new DASSegment(knownSpace.chr, tsm, Math.min(tsm + 99, knownSpace.max));\n nds.features(testSegment, {}, function (features, status) {\n if (status) {\n if (!retry) {\n nds.credentials = true;\n tryAddDAS(nds, true);\n } else {\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Custom data not found'));\n stabHolder.appendChild(makeElement('p', 'DAS uri: ' + nds.uri + ' is not answering features requests'));\n customMode = 'reset';\n return;\n }\n } else {\n var nameExtractPattern = new RegExp('/([^/]+)/?$');\n var match = nameExtractPattern.exec(nds.uri);\n if (match) {\n nds.name = match[1];\n }\n\n tryAddDASxSources(nds);\n return;\n }\n });\n };\n\n function tryAddDASxSources(nds, retry) {\n var uri = nds.uri;\n if (retry) {\n var match = /(.+)\\/[^\\/]+\\/?/.exec(uri);\n if (match) {\n uri = match[1] + '/sources';\n }\n }\n function sqfail() {\n if (!retry) {\n return tryAddDASxSources(nds, true);\n } else {\n return addDasCompletionPage(nds);\n }\n }\n new DASRegistry(uri, { credentials: nds.credentials }).sources(function (sources) {\n if (!sources || sources.length == 0) {\n return sqfail();\n }\n\n var fs = null;\n if (sources.length == 1) {\n fs = sources[0];\n } else {\n for (var i = 0; i < sources.length; ++i) {\n if (sources[i].uri === nds.uri) {\n fs = sources[i];\n break;\n }\n }\n }\n\n var coordsDetermined = false,\n quantDetermined = false;\n if (fs) {\n nds.name = fs.name;\n nds.desc = fs.desc;\n if (fs.maxbins) {\n nds.maxbins = true;\n } else {\n nds.maxbins = false;\n }\n if (fs.capabilities) {\n nds.capabilities = fs.capabilities;\n }\n quantDetermined = true;\n\n if (fs.coords && fs.coords.length == 1) {\n var coords = fs.coords[0];\n if (coordsMatch(coords, thisB.coordSystem)) {\n coordsDetermined = true;\n } else if (thisB.chains) {\n for (var k in thisB.chains) {\n if (coordsMatch(coords, thisB.chains[k].coords)) {\n nds.mapping = k;\n coordsDetermined = true;\n }\n }\n }\n }\n }\n return addDasCompletionPage(nds, coordsDetermined, quantDetermined);\n }, function () {\n return sqfail();\n });\n }\n\n var makeSourceConfig = function makeSourceConfig(s) {\n var nds = { name: s.name };\n if (s.credentials) nds.credentials = s.credentials;\n\n if (s.mapping && s.mapping != '__default__') nds.mapping = s.mapping;\n\n if (s.transport) nds.transport = s.transport;\n\n if (s.tier_type == 'bwg') {\n if (s.blob) nds.bwgBlob = s.blob;else if (s.uri) nds.bwgURI = s.uri;\n return nds;\n } else if (s.tier_type == 'bam') {\n if (s.blob) {\n nds.bamBlob = s.blob;\n nds.baiBlob = s.indexBlob;\n } else {\n nds.bamURI = s.uri;\n nds.baiURI = s.indexUri;\n }\n return nds;\n } else if (s.tier_type == 'tabix') {\n nds.tier_type = 'tabix';\n nds.payload = s.payload;\n if (s.blob) {\n nds.blob = s.blob;\n nds.indexBlob = s.indexBlob;\n } else {\n nds.uri = s.uri;\n nds.indexUri = s.indexUri;\n }\n return nds;\n } else if (s.tier_type == 'memstore') {\n nds.tier_type = 'memstore';\n nds.payload = s.payload;\n if (s.blob) nds.blob = s.blob;else nds.uri = s.uri;\n return nds;\n }\n };\n\n var tryAddBin = function tryAddBin(source) {\n probeResource(source, function (source, err) {\n if (err) {\n removeChildren(stabHolder);\n var tabError = makeElement('div');\n tabError.appendChild(makeElement('h2', \"Couldn't access custom data\"));\n tabError.appendChild(makeElement('p', '' + err));\n stabHolder.appendChild(tabError);\n console.log(source);\n if (window.location.protocol === 'https:' && source.uri.indexOf('http:') == 0) {\n thisB.canFetchPlainHTTP().then(function (can) {\n if (!can) {\n tabError.appendChild(makeElement('p', [makeElement('strong', 'HTTP warning: '), 'you may not be able to access HTTP resources from an instance of Biodalliance which you are accessing via HTTPS.', makeElement('a', '[More info]', { href: thisB.httpWarningURL, target: \"_blank\" })]));\n }\n });\n }\n customMode = 'reset-bin';\n } else {\n var nds = makeSourceConfig(source);\n if (source.tier_type == 'bam') {\n return completeBAM(nds);\n } else if (source.tier_type == 'tabix') {\n return completeTabixVCF(nds);\n } else {\n return addDasCompletionPage(nds, false, false, true);\n }\n }\n });\n };\n\n function promptForBAI(nds) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n customMode = 'prompt-bai';\n stabHolder.appendChild(makeElement('h2', 'Select an index file'));\n stabHolder.appendChild(makeElement('p', 'Dalliance requires a BAM index (.bai) file when displaying BAM data. These normally accompany BAM files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file'));\n\n stabHolder.appendChild(document.createTextNode('Index file: '));\n custFile = makeElement('input', null, { type: 'file' });\n stabHolder.appendChild(custFile);\n dataToFinalize = nds;\n }\n\n function promptForTabix(nds) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n customMode = 'prompt-tbi';\n stabHolder.appendChild(makeElement('h2', 'Select an index file'));\n stabHolder.appendChild(makeElement('p', 'Dalliance requires a Tabix index (.tbi) file when displaying VCF data. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file'));\n\n stabHolder.appendChild(document.createTextNode('Index file: '));\n custFile = makeElement('input', null, { type: 'file' });\n stabHolder.appendChild(custFile);\n dataToFinalize = nds;\n }\n\n function completeBAM(nds) {\n var indexF;\n if (nds.baiBlob) indexF = new BlobFetchable(nds.baiBlob);else if (nds.transport == 'encode') indexF = new EncodeFetchable(nds.bamURI + '.bai');else indexF = new URLFetchable(nds.bamURI + '.bai', { credentials: nds.credentials });\n\n indexF.slice(0, 256).fetch(function (r) {\n var hasBAI = false;\n if (r) {\n var ba = new Uint8Array(r);\n var magic2 = readInt(ba, 0);\n hasBAI = magic2 == BAI_MAGIC;\n }\n if (hasBAI) {\n return addDasCompletionPage(nds, false, false, true);\n } else {\n return binFormatErrorPage('You have selected a valid BAM file, but a corresponding index (.bai) file was not found. Please index your BAM (samtools index) and place the BAI file in the same directory');\n }\n });\n }\n\n function completeTabixVCF(nds) {\n var indexF;\n if (nds.indexBlob) {\n indexF = new BlobFetchable(nds.indexBlob);\n } else {\n indexF = new URLFetchable(nds.uri + '.tbi');\n }\n indexF.slice(0, 1 << 16).fetch(function (r) {\n var hasTabix = false;\n if (r) {\n var ba = new Uint8Array(r);\n if (ba[0] == 31 || ba[1] == 139) {\n var unc = unbgzf(r);\n ba = new Uint8Array(unc);\n var m2 = readInt(ba, 0);\n hasTabix = m2 == TABIX_MAGIC;\n }\n }\n if (hasTabix) {\n return addDasCompletionPage(nds, false, false, true);\n } else {\n return binFormatErrorPage('You have selected a valid VCF file, but a corresponding index (.tbi) file was not found. Please index your VCF (\"tabix -p vcf -f myfile.vcf.gz\") and place the .tbi file in the same directory');\n }\n });\n }\n\n function binFormatErrorPage(message) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n message = message || 'Custom data format not recognized';\n stabHolder.appendChild(makeElement('h2', 'Error adding custom data'));\n stabHolder.appendChild(makeElement('p', message));\n stabHolder.appendChild(makeElement('p', 'Currently supported formats are bigBed, bigWig, and BAM.'));\n customMode = 'reset-bin';\n return;\n }\n\n var addDasCompletionPage = function addDasCompletionPage(nds, coordsDetermined, quantDetermined, quantIrrelevant) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Add custom data: step 2'));\n stabHolder.appendChild(document.createTextNode('Label: '));\n custName = makeElement('input', '', { value: nds.name });\n stabHolder.appendChild(custName);\n\n // stabHolder.appendChild(document.createTextNode('User: '));\n custUser = makeElement('input', '');\n // stabHolder.appendChild(custUser);\n //stabHolder.appendChild(document.createTextNode('Pass: '));\n custPass = makeElement('input', '');\n // stabHolder.appendChild(custPass);\n\n\n stabHolder.appendChild(makeElement('br'));\n stabHolder.appendChild(makeElement('br'));\n stabHolder.appendChild(makeElement('h4', 'Coordinate system: '));\n custCS = makeElement('select', null);\n custCS.appendChild(makeElement('option', thisB.nameForCoordSystem(thisB.coordSystem), { value: '__default__' }));\n if (thisB.chains) {\n for (var csk in thisB.chains) {\n var cs = thisB.chains[csk].coords;\n custCS.appendChild(makeElement('option', thisB.nameForCoordSystem(cs), { value: csk }));\n }\n }\n custCS.value = nds.mapping || '__default__';\n stabHolder.appendChild(custCS);\n\n if (coordsDetermined) {\n stabHolder.appendChild(makeElement('p', \"(Based on server response, probably doesn't need changing.)\"));\n } else {\n stabHolder.appendChild(makeElement('p', [makeElement('b', 'Warning: '), \"unable to determine the correct value from server responses. Please check carefully.\"]));\n stabHolder.appendChild(makeElement('p', \"If you don't see the mapping you're looking for, please contact [email protected]\"));\n }\n\n if (!quantIrrelevant) {\n stabHolder.appendChild(document.createTextNode('Quantitative: '));\n custQuant = makeElement('input', null, { type: 'checkbox', checked: true });\n if (typeof nds.maxbins !== 'undefined') {\n custQuant.checked = nds.maxbins;\n }\n stabHolder.appendChild(custQuant);\n if (quantDetermined) {\n stabHolder.appendChild(makeElement('p', \"(Based on server response, probably doesn't need changing.)\"));\n } else {\n stabHolder.appendChild(makeElement('p', [makeElement('b', \"Warning: \"), \"unable to determine correct value. If in doubt, leave checked.\"]));\n }\n }\n\n if (nds.bwgBlob) {\n stabHolder.appendChild(makeElement('p', [makeElement('b', 'Warning: '), 'data added from local file. Due to the browser security model, the track will disappear if you reload Dalliance.']));\n }\n\n custName.focus();\n\n if (customMode === 'bin' || customMode === 'prompt-bai' || customMode === 'prompt-tbi') customMode = 'finalize-bin';else customMode = 'finalize';\n dataToFinalize = nds;\n };\n\n var multipleSet = null;\n var tryAddMultiple = function tryAddMultiple(fileList) {\n var newSources = multipleSet = [];\n customMode = 'multiple';\n for (var fi = 0; fi < fileList.length; ++fi) {\n var f = fileList[fi];\n if (f) {\n newSources.push({ blob: f });\n }\n }\n\n for (var fi = 0; fi < newSources.length; ++fi) {\n probeMultiple(newSources[fi]);\n }\n updateMultipleStatus();\n };\n\n var probeMultiple = function probeMultiple(ns) {\n probeResource(ns, function (source, err) {\n if (err) {\n source.error = err;\n }\n\n var usedIndices = [];\n var bams = {},\n tabixes = {};\n for (var si = 0; si < multipleSet.length; ++si) {\n var s = multipleSet[si];\n if (s.tier_type == 'bam' && !s.indexBlob) {\n bams[s.blob.name] = s;\n }\n if (s.tier_type == 'tabix' && !s.indexBlob) {\n tabixes[s.blob.name] = s;\n }\n }\n\n for (var si = 0; si < multipleSet.length; ++si) {\n var s = multipleSet[si];\n if (s.tier_type === 'bai') {\n var baiPattern = new RegExp('(.+)\\\\.bai$');\n var match = baiPattern.exec(s.blob.name);\n if (match && bams[match[1]]) {\n bams[match[1]].indexBlob = s.blob;\n usedIndices.push(si);\n }\n } else if (s.tier_type === 'tabix-index') {\n var tbiPattern = new RegExp('(.+)\\\\.tbi$');\n var match = tbiPattern.exec(s.blob.name);\n if (match && tabixes[match[1]]) {\n tabixes[match[1]].indexBlob = s.blob;\n usedIndices.push(si);\n }\n }\n }\n\n for (var bi = usedIndices.length - 1; bi >= 0; --bi) {\n multipleSet.splice(usedIndices[bi], 1);\n }\n\n updateMultipleStatus();\n });\n };\n\n var updateMultipleStatus = function updateMultipleStatus() {\n removeChildren(stabHolder);\n var needsIndex = false;\n var multTable = makeElement('table', multipleSet.filter(function (s) {\n return !s.hidden;\n }).map(function (s) {\n var row = makeElement('tr');\n row.appendChild(makeElement('td', s.name || s.blob.name));\n var typeContent;\n if (s.error) {\n typeContent = makeElement('span', 'Error', null, { color: 'red' });\n } else if (s.tier_type) {\n typeContent = s.payload || s.tier_type;\n } else {\n typeContent = thisB.makeLoader(16);\n }\n\n var ccs;\n var state = 'unknown';\n if (s.tier_type == 'bwg' || s.tier_type == 'memstore') {\n state = 'okay';\n } else if (s.tier_type == 'bam') {\n state = s.indexBlob ? 'okay' : 'needs-index';\n } else if (s.tier_type == 'tabix') {\n state = s.indexBlob ? 'okay' : 'needs-index';\n }\n\n if (state == 'okay') {\n ccs = makeElement('select', null, null, { width: '150px' });\n ccs.appendChild(makeElement('option', thisB.nameForCoordSystem(thisB.coordSystem), { value: '__default__' }));\n if (thisB.chains) {\n for (var csk in thisB.chains) {\n var cs = thisB.chains[csk].coords;\n ccs.appendChild(makeElement('option', thisB.nameForCoordSystem(cs), { value: csk }));\n }\n }\n ccs.value = s.mapping || '__default__';\n\n ccs.addEventListener('change', function (ev) {\n s.mapping = ccs.value;\n console.log(s);\n }, false);\n } else if (state == 'needs-index') {\n ccs = makeElement('span', 'Needs index', {}, { color: 'red' });\n needsIndex = true;\n }\n\n return makeElement('tr', [makeElement('td', s.name || s.blob.name), makeElement('td', typeContent), makeElement('td', ccs)]);\n }), { className: 'table table-striped table-condensed' });\n stabHolder.appendChild(multTable);\n\n if (needsIndex) {\n stabHolder.appendChild(makeElement('p', 'Some of these files are missing required index (.bai or .tbi) files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate index file'));\n stabHolder.appendChild(document.createTextNode('Index file(s): '));\n var indexFile = makeElement('input', null, { type: 'file', multiple: 'multiple' });\n stabHolder.appendChild(indexFile);\n indexFile.addEventListener('change', function (ev) {\n console.log('fileset changed');\n var fileList = indexFile.files || [];\n for (var fi = 0; fi < fileList.length; ++fi) {\n var f = fileList[fi];\n if (f) {\n var ns = { blob: f, hidden: true };\n multipleSet.push(ns);\n probeMultiple(ns);\n }\n }\n }, false);\n }\n };\n\n var canButton = makeElement('button', 'Cancel', { className: 'btn' });\n canButton.addEventListener('click', function (ev) {\n ev.stopPropagation();ev.preventDefault();\n if (customMode === 'finalize-bin') switchToBinMode();else switchToCustomMode();\n }, false);\n\n var refreshButton = makeElement('button', 'Refresh', { className: 'btn' });\n refreshButton.addEventListener('click', function (ev) {\n ev.stopPropagation();ev.preventDefault();\n thisB.queryRegistry(__mapping);\n }, false);\n this.makeTooltip(refreshButton, 'Click to re-fetch data from the DAS registry');\n\n var buttonHolder = makeElement('div', [addButton, ' ', canButton, ' ', refreshButton]);\n buttonHolder.style.margin = '10px';\n asform.appendChild(buttonHolder);\n\n popup.appendChild(asform);\n makeStab(thisB.availableSources);\n\n this.showToolPanel(popup);\n this.setUiMode('add');\n\n if (firstDefButton) {\n activateButton(addModeButtons, firstDefButton);\n makeStab(new Observed(firstDefSources));\n }\n};\n\n},{\"./bam\":1,\"./bin\":4,\"./cbrowser\":6,\"./das\":10,\"./domui\":12,\"./encode\":14,\"./lh3utils\":26,\"./probe\":32,\"./sourcecompare\":40,\"./tabix\":47,\"./thub\":49,\"./utils\":56}],54:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// trix.js: UCSC-style free text indices\n//\n\n\"use strict\";\n\nfunction connectTrix(ix, ixx, callback) {\n ixx.fetchAsText(function (ixxData) {\n if (!ixxData) return callback(null, \"Couldn't fetch index-index\");\n\n var toks = ixxData.split(/(.+)([0-9A-F]{10})\\n/);\n\n var keys = [];\n var offsets = [];\n for (var ti = 1; ti < toks.length; ti += 3) {\n keys.push(toks[ti]);\n offsets.push(parseInt(toks[ti + 1], 16));\n }\n\n return callback(new TrixIndex(keys, offsets, ix));\n });\n}\n\nfunction TrixIndex(keys, offsets, ix) {\n this.keys = keys;\n this.offsets = offsets;\n this.ix = ix;\n}\n\nTrixIndex.prototype.lookup = function (query, callback) {\n var ixslice;\n\n var qtag = (query + ' ').substring(0, 5).toLowerCase();\n for (var i = 0; i < this.keys.length; ++i) {\n if (qtag.localeCompare(this.keys[i]) < 0) {\n ixslice = this.ix.slice(this.offsets[i - 1], this.offsets[i] - this.offsets[i - 1]);\n break;\n }\n }\n\n if (!ixslice) {\n ixslice = this.ix.slice(this.offsets[this.offsets.length - 1]);\n }\n\n ixslice.fetchAsText(function (ist) {\n var lines = ist.split('\\n');\n for (var li = 0; li < lines.length; ++li) {\n if (lines[li].indexOf(query.toLowerCase() + ' ') == 0) {\n return callback(lines[li].split(' '));\n }\n }\n return callback(null);\n });\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n connectTrix: connectTrix\n };\n}\n\n},{}],55:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// twoBit.js: packed-binary reference sequences\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var bin = require('./bin');\n var readInt = bin.readInt;\n var readIntBE = bin.readIntBE;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n}\n\nvar TWOBIT_MAGIC = 0x1a412743;\nvar TWOBIT_MAGIC_BE = 0x4327411a;\nvar HEADER_BLOCK_SIZE = 12500;\n\nfunction TwoBitFile() {}\n\nfunction makeTwoBit(fetchable, cnt) {\n var tb = new TwoBitFile();\n tb.data = fetchable;\n var headerBlockSize = HEADER_BLOCK_SIZE;\n var headerBlocksFetched = 0;\n\n tb.data.slice(0, headerBlockSize).fetch(function (r) {\n if (!r) {\n return cnt(null, \"Couldn't access data\");\n }\n var ba = new Uint8Array(r);\n var magic = readInt(ba, 0);\n if (magic == TWOBIT_MAGIC) {\n tb.readInt = readInt;\n } else if (magic == TWOBIT_MAGIC_BE) {\n tb.readInt = readIntBE;\n } else {\n return cnt(null, \"Not a .2bit file, magic=0x\" + magic.toString(16));\n }\n\n var version = tb.readInt(ba, 4);\n if (version != 0) {\n return cnt(null, 'Unsupported version ' + version);\n }\n\n tb.seqCount = tb.readInt(ba, 8);\n tb.seqDict = {};\n\n var p = 16,\n i = 0;\n var o = 0; // Offset of the current block if we need to fetch multiple header blocks.\n\n var parseSeqInfo = function parseSeqInfo() {\n while (i < tb.seqCount) {\n var ns = ba[p];\n if (p + ns + 6 >= ba.length) {\n headerBlocksFetched += headerBlockSize;\n headerBlockSize = Math.max(HEADER_BLOCK_SIZE, Math.floor(headerBlocksFetched * tb.seqCount / i));\n return tb.data.slice(o + p, headerBlockSize).fetch(function (r) {\n o += p;\n p = 0;\n ba = new Uint8Array(r);\n parseSeqInfo();\n });\n } else {\n ++p;\n var name = '';\n for (var j = 1; j <= ns; ++j) {\n name += String.fromCharCode(ba[p++]);\n }\n var offset = tb.readInt(ba, p);\n p += 4;\n tb.seqDict[name] = new TwoBitSeq(tb, offset);\n ++i;\n }\n }\n return cnt(tb);\n };\n\n parseSeqInfo();\n });\n}\n\nTwoBitFile.prototype.getSeq = function (chr) {\n var seq = this.seqDict[chr];\n if (!seq) {\n seq = this.seqDict['chr' + chr];\n }\n return seq;\n};\n\nTwoBitFile.prototype.fetch = function (chr, min, max, cnt) {\n var seq = this.getSeq(chr);\n if (!seq) {\n return cnt(null, \"Couldn't find \" + chr);\n } else if (max <= min) {\n return cnt('');\n } else {\n seq.fetch(min, max, cnt);\n }\n};\n\nfunction TwoBitSeq(tbf, offset) {\n this.tbf = tbf;\n this.offset = offset;\n}\n\nTwoBitSeq.prototype.init = function (cnt) {\n if (this.seqOffset) {\n return cnt();\n }\n\n var thisB = this;\n thisB.tbf.data.slice(thisB.offset, 8).fetch(function (r1) {\n if (!r1) {\n return cnt('Fetch failed');\n }\n var ba = new Uint8Array(r1);\n thisB._length = thisB.tbf.readInt(ba, 0);\n thisB.nBlockCnt = thisB.tbf.readInt(ba, 4);\n thisB.tbf.data.slice(thisB.offset + 8, thisB.nBlockCnt * 8 + 4).fetch(function (r2) {\n if (!r2) {\n return cnt('Fetch failed');\n }\n var ba = new Uint8Array(r2);\n var nbs = null;\n for (var b = 0; b < thisB.nBlockCnt; ++b) {\n var nbMin = thisB.tbf.readInt(ba, b * 4);\n var nbLen = thisB.tbf.readInt(ba, (b + thisB.nBlockCnt) * 4);\n var nb = new Range(nbMin, nbMin + nbLen - 1);\n if (!nbs) {\n nbs = nb;\n } else {\n nbs = union(nbs, nb);\n }\n }\n thisB.nBlocks = nbs;\n thisB.mBlockCnt = thisB.tbf.readInt(ba, thisB.nBlockCnt * 8);\n thisB.seqLength = (thisB._length + 3) / 4 | 0;\n thisB.seqOffset = thisB.offset + 16 + (thisB.nBlockCnt + thisB.mBlockCnt) * 8;\n return cnt();\n });\n });\n};\n\nvar TWOBIT_TABLE = ['T', 'C', 'A', 'G'];\n\nTwoBitSeq.prototype.fetch = function (min, max, cnt) {\n --min;--max; // Switch to zero-based.\n var thisB = this;\n this.init(function (error) {\n if (error) {\n return cnt(null, error);\n }\n\n var fetchMin = min >> 2;\n var fetchMax = max + 3 >> 2;\n if (fetchMin < 0 || fetchMax > thisB.seqLength) {\n return cnt('Coordinates out of bounds: ' + min + ':' + max);\n }\n\n thisB.tbf.data.slice(thisB.seqOffset + fetchMin, fetchMax - fetchMin).salted().fetch(function (r) {\n if (r == null) {\n return cnt('SeqFetch failed');\n }\n var seqData = new Uint8Array(r);\n\n var nSpans = [];\n if (thisB.nBlocks) {\n var intr = intersection(new Range(min, max), thisB.nBlocks);\n if (intr) {\n nSpans = intr.ranges();\n }\n }\n\n var seqstr = '';\n var ptr = min;\n function fillSeq(fsm) {\n while (ptr <= fsm) {\n var bb = (ptr >> 2) - fetchMin;\n var ni = ptr & 0x3;\n var bv = seqData[bb];\n var n;\n if (ni == 0) {\n n = bv >> 6 & 0x3;\n } else if (ni == 1) {\n n = bv >> 4 & 0x3;\n } else if (ni == 2) {\n n = bv >> 2 & 0x3;\n } else {\n n = bv & 0x3;\n }\n seqstr += TWOBIT_TABLE[n];\n ++ptr;\n }\n }\n\n for (var b = 0; b < nSpans.length; ++b) {\n var nb = nSpans[b];\n if (ptr > nb.min()) {\n throw 'N mismatch...';\n }\n if (ptr < nb.min()) {\n fillSeq(nb.min() - 1);\n }\n while (ptr <= nb.max()) {\n seqstr += 'N';\n ++ptr;\n }\n }\n if (ptr <= max) {\n fillSeq(max);\n }\n return cnt(seqstr);\n });\n });\n};\n\nTwoBitSeq.prototype.length = function (cnt) {\n var thisB = this;\n this.init(function (error) {\n if (error) {\n return cnt(null, error);\n } else {\n return cnt(thisB._length);\n }\n });\n};\n\nif (typeof module !== 'undefined') {\n module.exports = {\n makeTwoBit: makeTwoBit\n };\n}\n\n},{\"./bin\":4,\"./spans\":41}],56:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// utils.js: odds, sods, and ends.\n//\n\n\"use strict\";\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\nif (typeof require !== 'undefined') {\n var sha1 = require('./sha1');\n var b64_sha1 = sha1.b64_sha1;\n}\n\nvar NUM_REGEXP = new RegExp('[0-9]+');\n\nfunction stringToNumbersArray(str) {\n var nums = new Array();\n var m;\n while (m = NUM_REGEXP.exec(str)) {\n nums.push(m[0]);\n str = str.substring(m.index + m[0].length);\n }\n return nums;\n}\n\nvar STRICT_NUM_REGEXP = new RegExp('^[0-9]+$');\n\nfunction stringToInt(str) {\n str = str.replace(new RegExp(',', 'g'), '');\n if (!STRICT_NUM_REGEXP.test(str)) {\n return null;\n }\n return str | 0;\n}\n\nfunction pushnew(a, v) {\n for (var i = 0; i < a.length; ++i) {\n if (a[i] == v) {\n return;\n }\n }\n a.push(v);\n}\n\nfunction pusho(obj, k, v) {\n if (obj[k]) {\n obj[k].push(v);\n } else {\n obj[k] = [v];\n }\n}\n\nfunction pushnewo(obj, k, v) {\n var a = obj[k];\n if (a) {\n for (var i = 0; i < a.length; ++i) {\n // indexOf requires JS16 :-(.\n if (a[i] == v) {\n return;\n }\n }\n a.push(v);\n } else {\n obj[k] = [v];\n }\n}\n\nfunction pick(a, b, c, d) {\n if (a) {\n return a;\n } else if (b) {\n return b;\n } else if (c) {\n return c;\n } else if (d) {\n return d;\n }\n}\n\nfunction pushnew(l, o) {\n for (var i = 0; i < l.length; ++i) {\n if (l[i] == o) {\n return;\n }\n }\n l.push(o);\n}\n\nfunction arrayIndexOf(a, x) {\n if (!a) {\n return -1;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] === x) {\n return i;\n }\n }\n return -1;\n}\n\nfunction arrayRemove(a, x) {\n var i = arrayIndexOf(a, x);\n if (i >= 0) {\n a.splice(i, 1);\n return true;\n }\n return false;\n}\n\n//\n// DOM utilities\n//\n\n\nfunction makeElement(tag, children, attribs, styles) {\n var ele = document.createElement(tag);\n if (children) {\n if (!(children instanceof Array)) {\n children = [children];\n }\n for (var i = 0; i < children.length; ++i) {\n var c = children[i];\n if (c) {\n if (typeof c == 'string') {\n c = document.createTextNode(c);\n } else if (typeof c == 'number') {\n c = document.createTextNode('' + c);\n }\n ele.appendChild(c);\n }\n }\n }\n\n if (attribs) {\n for (var l in attribs) {\n try {\n ele[l] = attribs[l];\n } catch (e) {\n console.log('error setting ' + l);\n throw e;\n }\n }\n }\n if (styles) {\n for (var l in styles) {\n ele.style[l] = styles[l];\n }\n }\n return ele;\n}\n\nfunction makeElementNS(namespace, tag, children, attribs) {\n var ele = document.createElementNS(namespace, tag);\n if (children) {\n if (!(children instanceof Array)) {\n children = [children];\n }\n for (var i = 0; i < children.length; ++i) {\n var c = children[i];\n if (typeof c == 'string') {\n c = document.createTextNode(c);\n }\n ele.appendChild(c);\n }\n }\n\n setAttrs(ele, attribs);\n return ele;\n}\n\nvar attr_name_cache = {};\n\nfunction setAttr(node, key, value) {\n var attr = attr_name_cache[key];\n if (!attr) {\n var _attr = '';\n for (var c = 0; c < key.length; ++c) {\n var cc = key.substring(c, c + 1);\n var lcc = cc.toLowerCase();\n if (lcc != cc) {\n _attr = _attr + '-' + lcc;\n } else {\n _attr = _attr + cc;\n }\n }\n attr_name_cache[key] = _attr;\n attr = _attr;\n }\n node.setAttribute(attr, value);\n}\n\nfunction setAttrs(node, attribs) {\n if (attribs) {\n for (var l in attribs) {\n setAttr(node, l, attribs[l]);\n }\n }\n}\n\nfunction removeChildren(node) {\n if (!node || !node.childNodes) {\n return;\n }\n\n while (node.childNodes.length > 0) {\n node.removeChild(node.firstChild);\n }\n}\n\n//\n// WARNING: not for general use!\n//\n\nfunction miniJSONify(o, exc) {\n if (typeof o === 'undefined') {\n return 'undefined';\n } else if (o == null) {\n return 'null';\n } else if (typeof o == 'string') {\n return \"'\" + o + \"'\";\n } else if (typeof o == 'number') {\n return \"\" + o;\n } else if (typeof o == 'boolean') {\n return \"\" + o;\n } else if ((typeof o === 'undefined' ? 'undefined' : _typeof(o)) == 'object') {\n if (o instanceof Array) {\n var s = null;\n for (var i = 0; i < o.length; ++i) {\n s = (s == null ? '' : s + ', ') + miniJSONify(o[i], exc);\n }\n return '[' + (s ? s : '') + ']';\n } else {\n exc = exc || {};\n var s = null;\n for (var k in o) {\n if (exc[k]) continue;\n if (k != undefined && typeof o[k] != 'function') {\n s = (s == null ? '' : s + ', ') + k + ': ' + miniJSONify(o[k], exc);\n }\n }\n return '{' + (s ? s : '') + '}';\n }\n } else {\n return typeof o === 'undefined' ? 'undefined' : _typeof(o);\n }\n}\n\nfunction shallowCopy(o) {\n var n = {};\n for (var k in o) {\n n[k] = o[k];\n }\n return n;\n}\n\nfunction Observed(x) {\n this.value = x;\n this.listeners = [];\n}\n\nObserved.prototype.addListener = function (f) {\n this.listeners.push(f);\n};\n\nObserved.prototype.addListenerAndFire = function (f) {\n this.listeners.push(f);\n f(this.value);\n};\n\nObserved.prototype.removeListener = function (f) {\n arrayRemove(this.listeners, f);\n};\n\nObserved.prototype.get = function () {\n return this.value;\n};\n\nObserved.prototype.set = function (x) {\n this.value = x;\n for (var i = 0; i < this.listeners.length; ++i) {\n this.listeners[i](x);\n }\n};\n\nfunction Awaited() {\n this.queue = [];\n}\n\nAwaited.prototype.provide = function (x) {\n if (this.res !== undefined) {\n throw \"Resource has already been provided.\";\n }\n\n this.res = x;\n for (var i = 0; i < this.queue.length; ++i) {\n this.queue[i](x);\n }\n this.queue = null; // avoid leaking closures.\n};\n\nAwaited.prototype.await = function (f) {\n if (this.res !== undefined) {\n f(this.res);\n return this.res;\n } else {\n this.queue.push(f);\n }\n};\n\nvar __dalliance_saltSeed = 0;\n\nfunction saltURL(url) {\n return url + '?salt=' + b64_sha1('' + Date.now() + ',' + ++__dalliance_saltSeed);\n}\n\nfunction textXHR(url, callback, opts) {\n if (opts && opts.salt) url = saltURL(url);\n\n try {\n var timeout;\n if (opts && opts.timeout) {\n timeout = setTimeout(function () {\n console.log('timing out ' + url);\n req.abort();\n return callback(null, 'Timeout');\n }, opts.timeout);\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState == 4) {\n if (timeout) clearTimeout(timeout);\n if (req.status < 200 || req.status >= 300) {\n callback(null, 'Error code ' + req.status);\n } else {\n callback(req.responseText);\n }\n }\n };\n\n req.open('GET', url, true);\n req.responseType = 'text';\n\n if (opts && opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n } catch (e) {\n callback(null, 'Exception ' + e);\n }\n}\n\nfunction relativeURL(base, rel) {\n // FIXME quite naive -- good enough for trackhubs?\n\n if (rel.indexOf('http:') == 0 || rel.indexOf('https:') == 0) {\n return rel;\n }\n\n var li = base.lastIndexOf('/');\n if (li >= 0) {\n return base.substr(0, li + 1) + rel;\n } else {\n return rel;\n }\n}\n\nvar AMINO_ACID_TRANSLATION = {\n 'TTT': 'F',\n 'TTC': 'F',\n 'TTA': 'L',\n 'TTG': 'L',\n 'CTT': 'L',\n 'CTC': 'L',\n 'CTA': 'L',\n 'CTG': 'L',\n 'ATT': 'I',\n 'ATC': 'I',\n 'ATA': 'I',\n 'ATG': 'M',\n 'GTT': 'V',\n 'GTC': 'V',\n 'GTA': 'V',\n 'GTG': 'V',\n 'TCT': 'S',\n 'TCC': 'S',\n 'TCA': 'S',\n 'TCG': 'S',\n 'CCT': 'P',\n 'CCC': 'P',\n 'CCA': 'P',\n 'CCG': 'P',\n 'ACT': 'T',\n 'ACC': 'T',\n 'ACA': 'T',\n 'ACG': 'T',\n 'GCT': 'A',\n 'GCC': 'A',\n 'GCA': 'A',\n 'GCG': 'A',\n 'TAT': 'Y',\n 'TAC': 'Y',\n 'TAA': '*', // stop\n 'TAG': '*', // stop\n 'CAT': 'H',\n 'CAC': 'H',\n 'CAA': 'Q',\n 'CAG': 'Q',\n 'AAT': 'N',\n 'AAC': 'N',\n 'AAA': 'K',\n 'AAG': 'K',\n 'GAT': 'D',\n 'GAC': 'D',\n 'GAA': 'E',\n 'GAG': 'E',\n 'TGT': 'C',\n 'TGC': 'C',\n 'TGA': '*', // stop\n 'TGG': 'W',\n 'CGT': 'R',\n 'CGC': 'R',\n 'CGA': 'R',\n 'CGG': 'R',\n 'AGT': 'S',\n 'AGC': 'S',\n 'AGA': 'R',\n 'AGG': 'R',\n 'GGT': 'G',\n 'GGC': 'G',\n 'GGA': 'G',\n 'GGG': 'G'\n};\n\nfunction resolveUrlToPage(rel) {\n return makeElement('a', null, { href: rel }).href;\n}\n\n//\n// Missing APIs\n// \n\nif (!('trim' in String.prototype)) {\n String.prototype.trim = function () {\n return this.replace(/^\\s+/, '').replace(/\\s+$/, '');\n };\n}\n\nif (typeof module !== 'undefined') {\n module.exports = {\n textXHR: textXHR,\n relativeURL: relativeURL,\n resolveUrlToPage: resolveUrlToPage,\n shallowCopy: shallowCopy,\n pusho: pusho,\n pushnew: pushnew,\n pushnewo: pushnewo,\n arrayIndexOf: arrayIndexOf,\n pick: pick,\n\n makeElement: makeElement,\n makeElementNS: makeElementNS,\n removeChildren: removeChildren,\n\n miniJSONify: miniJSONify,\n\n Observed: Observed,\n Awaited: Awaited,\n\n AMINO_ACID_TRANSLATION: AMINO_ACID_TRANSLATION\n };\n}\n\n},{\"./sha1\":38}],57:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// vcf.js\n//\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerParserFactory = sa.registerParserFactory;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n}\n\nfunction VCFParser() {\n this.info = [];\n}\n\nvar VCF_INFO_RE = /([^;=]+)(=([^;]+))?;?/;\nvar VCF_INFO_HEADER = /##INFO=<([^>]+)>/;\nvar VCF_INFO_HEADER_TOK = /([^,=]+)=([^,]+|\"[^\"]+\"),?/;\n\nVCFParser.prototype.createSession = function (sink) {\n return new VCFParseSession(this, sink);\n};\n\nfunction VCFParseSession(parser, sink) {\n this.parser = parser;\n this.sink = sink;\n}\n\nVCFParseSession.prototype.parse = function (line) {\n if (line.length == 0) return;\n if (line[0] == '#') {\n if (line.length > 1 && line[1] == '#') {\n var m = VCF_INFO_HEADER.exec(line);\n if (m) {\n var toks = m[1].split(VCF_INFO_HEADER_TOK);\n var id = null,\n desc = null;\n for (var ti = 0; ti < toks.length - 1; ti += 3) {\n var key = toks[ti + 1];\n var value = toks[ti + 2].replace(/\"/g, '');\n if (key == 'ID') {\n id = value;\n } else if (key == 'Description') {\n desc = value;\n }\n }\n if (id && desc) {\n this.parser.info.push({ id: id,\n desc: desc });\n }\n }\n return;\n } else {\n return;\n }\n }\n\n var toks = line.split('\\t');\n var f = new DASFeature();\n f.segment = toks[0];\n f.id = toks[2];\n f.refAllele = toks[3];\n f.altAlleles = toks[4].split(',');\n f.min = parseInt(toks[1]);\n f.max = f.min + f.refAllele.length - 1;\n\n var infoToks = toks[7].split(VCF_INFO_RE);\n f.info = {};\n for (var ti = 0; ti < infoToks.length; ti += 4) {\n f.info[infoToks[ti + 1]] = infoToks[ti + 3];\n }\n\n var alt = f.altAlleles[0];\n var ref = f.refAllele;\n if (alt.length > ref.length) {\n f.type = \"insertion\";\n if (alt.indexOf(ref) == 0) {\n f.insertion = alt.substr(ref.length);\n f.min += ref.length;\n f.max = f.min - 1; // Effectively \"between\" bases.\n } else {\n f.insertion = alt;\n }\n } else if (alt.length < ref.length) {\n f.type = \"deletion\";\n } else {\n f.type = 'substitution';\n }\n\n this.sink(f);\n};\n\nVCFParseSession.prototype.flush = function () {};\n\nVCFParser.prototype.getStyleSheet = function (callback) {\n var stylesheet = new DASStylesheet();\n\n {\n var varStyle = new DASStyle();\n varStyle.glyph = '__INSERTION';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(50,80,255)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({ type: 'insertion' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(255, 60, 60)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({ type: 'deletion' }, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(50,80,255)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({ type: 'default' }, null, varStyle);\n }\n\n return callback(stylesheet);\n};\n\nVCFParser.prototype.getDefaultFIPs = function (callback) {\n var self = this;\n var fip = function fip(feature, featureInfo) {\n featureInfo.add(\"Ref. allele\", feature.refAllele);\n featureInfo.add(\"Alt. alleles\", feature.altAlleles.join(','));\n\n if (feature.info) {\n for (var ii = 0; ii < self.info.length; ++ii) {\n var info = self.info[ii];\n var val = feature.info[info.id];\n if (val !== undefined) {\n featureInfo.add(info.desc, val);\n }\n }\n }\n };\n callback(fip);\n};\n\ndalliance_registerParserFactory('vcf', function () {\n return new VCFParser();\n});\n\n},{\"./das\":10,\"./sourceadapters\":39}],58:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// version.js\n//\n\n\"use strict\";\n\nvar VERSION = {\n CONFIG: 5,\n MAJOR: 0,\n MINOR: 13,\n MICRO: 7,\n BRANCH: 'MOLGENIS'\n};\n\nVERSION.toString = function () {\n var vs = '' + this.MAJOR + '.' + this.MINOR + '.' + this.MICRO;\n if (this.PATCH) {\n vs = vs + this.PATCH;\n }\n if (this.BRANCH && this.BRANCH != '') {\n vs = vs + '-' + this.BRANCH;\n }\n return vs;\n};\n\nif (typeof module !== 'undefined') {\n module.exports = VERSION;\n}\n\n},{}],59:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// zoomslider.js: custom slider component\n//\n\n\n\"use strict\";\n\nif (typeof require !== 'undefined') {\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n}\n\nfunction makeZoomSlider(opts) {\n opts = opts || {};\n\n var minPos = 0,\n maxPos = opts.width || 200;\n var min = 0,\n max = 200;\n var pos = 50,\n pos2 = 100;\n var labels = [];\n var track = makeElement('hr', null, { className: 'slider-track' }, { width: '' + (maxPos | 0) + 'px' });\n var thumb = makeElement('hr', null, { className: 'slider-thumb active' });\n var thumb2 = makeElement('hr', null, { className: 'slider-thumb' });\n var slider = makeElement('div', [track, thumb, thumb2], { className: 'slider' }, { width: '' + ((maxPos | 0) + 10) + 'px' });\n\n slider.removeLabels = function () {\n for (var li = 0; li < labels.length; ++li) {\n slider.removeChild(labels[li]);\n }\n labels = [];\n };\n\n slider.addLabel = function (val, txt) {\n var pos = minPos + (val - min) * (maxPos - minPos) / (max - min) | 0;\n var label = makeElement('div', txt, { className: 'slider-label' }, {\n left: '' + (minPos + (val - min) * (maxPos - minPos) / (max - min) | 0) + 'px'\n });\n slider.appendChild(label);\n labels.push(label);\n };\n\n var onChange = document.createEvent('HTMLEvents');\n onChange.initEvent('change', true, false);\n\n function setPos(np) {\n np = Math.min(np, maxPos);\n np = Math.max(np, minPos);\n pos = np;\n thumb.style.left = '' + pos + 'px';\n }\n\n function setPos2(np) {\n np = Math.min(np, maxPos);\n np = Math.max(np, minPos);\n pos2 = np;\n thumb2.style.left = '' + pos2 + 'px';\n }\n\n Object.defineProperty(slider, 'value', {\n get: function get() {\n return min + (pos - minPos) * (max - min) / (maxPos - minPos);\n },\n set: function set(v) {\n var np = minPos + (v - min) * (maxPos - minPos) / (max - min);\n setPos(np);\n }\n });\n\n Object.defineProperty(slider, 'value2', {\n get: function get() {\n return min + (pos2 - minPos) * (max - min) / (maxPos - minPos);\n },\n set: function set(v) {\n var np = minPos + (v - min) * (maxPos - minPos) / (max - min);\n setPos2(np);\n }\n });\n\n Object.defineProperty(slider, 'active', {\n get: function get() {\n return thumb.classList.contains('active') ? 1 : 2;\n },\n set: function set(x) {\n if (x == 1) {\n thumb.classList.add('active');\n thumb2.classList.remove('active');\n } else {\n thumb2.classList.add('active');\n thumb.classList.remove('active');\n }\n }\n });\n\n Object.defineProperty(slider, 'min', {\n get: function get() {\n return min;\n },\n set: function set(v) {\n min = v;\n }\n });\n\n Object.defineProperty(slider, 'max', {\n get: function get() {\n return max;\n },\n set: function set(v) {\n max = v;\n }\n });\n\n var offset;\n var which;\n\n var thumbMouseDown = function thumbMouseDown(ev) {\n which = this == thumb ? 1 : 2;\n if (which != slider.active) {\n slider.active = which;\n slider.dispatchEvent(onChange);\n }\n ev.stopPropagation();ev.preventDefault();\n window.addEventListener('mousemove', thumbDragHandler, false);\n window.addEventListener('mouseup', thumbDragEndHandler, false);\n offset = ev.clientX - (which == 1 ? pos : pos2);\n };\n\n thumb.addEventListener('mousedown', thumbMouseDown, false);\n thumb2.addEventListener('mousedown', thumbMouseDown, false);\n\n var thumbDragHandler = function thumbDragHandler(ev) {\n if (which == 1) setPos(ev.clientX - offset);else setPos2(ev.clientX - offset);\n slider.dispatchEvent(onChange);\n };\n\n var thumbDragEndHandler = function thumbDragEndHandler(ev) {\n window.removeEventListener('mousemove', thumbDragHandler, false);\n window.removeEventListener('mouseup', thumbDragEndHandler, false);\n };\n\n return slider;\n}\n\nif (typeof module !== 'undefined') {\n module.exports = makeZoomSlider;\n}\n\n},{\"./utils\":56}],60:[function(require,module,exports){\n(function (global){\n\"use strict\";\n\nrequire(\"core-js/shim\");\n\nrequire(\"regenerator-runtime/runtime\");\n\nrequire(\"core-js/fn/regexp/escape\");\n\nif (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = \"defineProperty\";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, \"padLeft\", \"\".padStart);\ndefine(String.prototype, \"padRight\", \"\".padEnd);\n\n\"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\".split(\",\").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"core-js/fn/regexp/escape\":61,\"core-js/shim\":383,\"regenerator-runtime/runtime\":388}],61:[function(require,module,exports){\nrequire('../../modules/core.regexp.escape');\nmodule.exports = require('../../modules/_core').RegExp.escape;\n\n},{\"../../modules/_core\":82,\"../../modules/core.regexp.escape\":186}],62:[function(require,module,exports){\nmodule.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n},{}],63:[function(require,module,exports){\nvar cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n\n},{\"./_cof\":77}],64:[function(require,module,exports){\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n},{\"./_hide\":101,\"./_wks\":184}],65:[function(require,module,exports){\nmodule.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n},{}],66:[function(require,module,exports){\nvar isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n},{\"./_is-object\":110}],67:[function(require,module,exports){\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n},{\"./_to-absolute-index\":170,\"./_to-length\":174,\"./_to-object\":175}],68:[function(require,module,exports){\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n\n},{\"./_to-absolute-index\":170,\"./_to-length\":174,\"./_to-object\":175}],69:[function(require,module,exports){\nvar forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n\n},{\"./_for-of\":98}],70:[function(require,module,exports){\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n},{\"./_to-absolute-index\":170,\"./_to-iobject\":173,\"./_to-length\":174}],71:[function(require,module,exports){\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n},{\"./_array-species-create\":74,\"./_ctx\":84,\"./_iobject\":106,\"./_to-length\":174,\"./_to-object\":175}],72:[function(require,module,exports){\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n\n},{\"./_a-function\":62,\"./_iobject\":106,\"./_to-length\":174,\"./_to-object\":175}],73:[function(require,module,exports){\nvar isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n},{\"./_is-array\":108,\"./_is-object\":110,\"./_wks\":184}],74:[function(require,module,exports){\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n\n},{\"./_array-species-constructor\":73}],75:[function(require,module,exports){\n'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n\n},{\"./_a-function\":62,\"./_invoke\":105,\"./_is-object\":110}],76:[function(require,module,exports){\n// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n},{\"./_cof\":77,\"./_wks\":184}],77:[function(require,module,exports){\nvar toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n},{}],78:[function(require,module,exports){\n'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n},{\"./_an-instance\":65,\"./_ctx\":84,\"./_descriptors\":88,\"./_for-of\":98,\"./_iter-define\":114,\"./_iter-step\":116,\"./_meta\":124,\"./_object-create\":129,\"./_object-dp\":130,\"./_redefine-all\":149,\"./_set-species\":156,\"./_validate-collection\":181}],79:[function(require,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n\n},{\"./_array-from-iterable\":69,\"./_classof\":76}],80:[function(require,module,exports){\n'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n},{\"./_an-instance\":65,\"./_an-object\":66,\"./_array-methods\":71,\"./_for-of\":98,\"./_has\":100,\"./_is-object\":110,\"./_meta\":124,\"./_redefine-all\":149,\"./_validate-collection\":181}],81:[function(require,module,exports){\n'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n},{\"./_an-instance\":65,\"./_export\":92,\"./_fails\":94,\"./_for-of\":98,\"./_global\":99,\"./_inherit-if-required\":104,\"./_is-object\":110,\"./_iter-detect\":115,\"./_meta\":124,\"./_redefine\":150,\"./_redefine-all\":149,\"./_set-to-string-tag\":157}],82:[function(require,module,exports){\nvar core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n},{}],83:[function(require,module,exports){\n'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n},{\"./_object-dp\":130,\"./_property-desc\":148}],84:[function(require,module,exports){\n// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n},{\"./_a-function\":62}],85:[function(require,module,exports){\n'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n\n},{\"./_fails\":94}],86:[function(require,module,exports){\n'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n\n},{\"./_an-object\":66,\"./_to-primitive\":176}],87:[function(require,module,exports){\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n},{}],88:[function(require,module,exports){\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n},{\"./_fails\":94}],89:[function(require,module,exports){\nvar isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n},{\"./_global\":99,\"./_is-object\":110}],90:[function(require,module,exports){\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n},{}],91:[function(require,module,exports){\n// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n\n},{\"./_object-gops\":136,\"./_object-keys\":139,\"./_object-pie\":140}],92:[function(require,module,exports){\nvar global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n},{\"./_core\":82,\"./_ctx\":84,\"./_global\":99,\"./_hide\":101,\"./_redefine\":150}],93:[function(require,module,exports){\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n\n},{\"./_wks\":184}],94:[function(require,module,exports){\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n},{}],95:[function(require,module,exports){\n'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n\n},{\"./_defined\":87,\"./_fails\":94,\"./_hide\":101,\"./_redefine\":150,\"./_wks\":184}],96:[function(require,module,exports){\n'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n\n},{\"./_an-object\":66}],97:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n\n},{\"./_ctx\":84,\"./_is-array\":108,\"./_is-object\":110,\"./_to-length\":174,\"./_wks\":184}],98:[function(require,module,exports){\nvar ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n},{\"./_an-object\":66,\"./_ctx\":84,\"./_is-array-iter\":107,\"./_iter-call\":112,\"./_to-length\":174,\"./core.get-iterator-method\":185}],99:[function(require,module,exports){\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n},{}],100:[function(require,module,exports){\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n},{}],101:[function(require,module,exports){\nvar dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n},{\"./_descriptors\":88,\"./_object-dp\":130,\"./_property-desc\":148}],102:[function(require,module,exports){\nvar document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n\n},{\"./_global\":99}],103:[function(require,module,exports){\nmodule.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n},{\"./_descriptors\":88,\"./_dom-create\":89,\"./_fails\":94}],104:[function(require,module,exports){\nvar isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n\n},{\"./_is-object\":110,\"./_set-proto\":155}],105:[function(require,module,exports){\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n},{}],106:[function(require,module,exports){\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n},{\"./_cof\":77}],107:[function(require,module,exports){\n// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n},{\"./_iterators\":117,\"./_wks\":184}],108:[function(require,module,exports){\n// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n\n},{\"./_cof\":77}],109:[function(require,module,exports){\n// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n},{\"./_is-object\":110}],110:[function(require,module,exports){\nmodule.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n},{}],111:[function(require,module,exports){\n// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n},{\"./_cof\":77,\"./_is-object\":110,\"./_wks\":184}],112:[function(require,module,exports){\n// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n\n},{\"./_an-object\":66}],113:[function(require,module,exports){\n'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n},{\"./_hide\":101,\"./_object-create\":129,\"./_property-desc\":148,\"./_set-to-string-tag\":157,\"./_wks\":184}],114:[function(require,module,exports){\n'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n},{\"./_export\":92,\"./_has\":100,\"./_hide\":101,\"./_iter-create\":113,\"./_iterators\":117,\"./_library\":118,\"./_object-gpo\":137,\"./_redefine\":150,\"./_set-to-string-tag\":157,\"./_wks\":184}],115:[function(require,module,exports){\nvar ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n\n},{\"./_wks\":184}],116:[function(require,module,exports){\nmodule.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n\n},{}],117:[function(require,module,exports){\nmodule.exports = {};\n\n},{}],118:[function(require,module,exports){\nmodule.exports = false;\n\n},{}],119:[function(require,module,exports){\n// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n\n},{}],120:[function(require,module,exports){\n// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n\n},{\"./_math-sign\":123}],121:[function(require,module,exports){\n// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n\n},{}],122:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n\n},{}],123:[function(require,module,exports){\n// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n\n},{}],124:[function(require,module,exports){\nvar META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n},{\"./_fails\":94,\"./_has\":100,\"./_is-object\":110,\"./_object-dp\":130,\"./_uid\":180}],125:[function(require,module,exports){\nvar Map = require('./es6.map');\nvar $export = require('./_export');\nvar shared = require('./_shared')('metadata');\nvar store = shared.store || (shared.store = new (require('./es6.weak-map'))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n\n},{\"./_export\":92,\"./_shared\":159,\"./es6.map\":216,\"./es6.weak-map\":322}],126:[function(require,module,exports){\nvar global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if (Observer) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n\n},{\"./_cof\":77,\"./_global\":99,\"./_task\":169}],127:[function(require,module,exports){\n'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n},{\"./_a-function\":62}],128:[function(require,module,exports){\n'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n\n},{\"./_fails\":94,\"./_iobject\":106,\"./_object-gops\":136,\"./_object-keys\":139,\"./_object-pie\":140,\"./_to-object\":175}],129:[function(require,module,exports){\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n},{\"./_an-object\":66,\"./_dom-create\":89,\"./_enum-bug-keys\":90,\"./_html\":102,\"./_object-dps\":131,\"./_shared-key\":158}],130:[function(require,module,exports){\nvar anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n},{\"./_an-object\":66,\"./_descriptors\":88,\"./_ie8-dom-define\":103,\"./_to-primitive\":176}],131:[function(require,module,exports){\nvar dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n},{\"./_an-object\":66,\"./_descriptors\":88,\"./_object-dp\":130,\"./_object-keys\":139}],132:[function(require,module,exports){\n'use strict';\n// Forced replacement prototype accessors methods\nmodule.exports = require('./_library') || !require('./_fails')(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete require('./_global')[K];\n});\n\n},{\"./_fails\":94,\"./_global\":99,\"./_library\":118}],133:[function(require,module,exports){\nvar pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n},{\"./_descriptors\":88,\"./_has\":100,\"./_ie8-dom-define\":103,\"./_object-pie\":140,\"./_property-desc\":148,\"./_to-iobject\":173,\"./_to-primitive\":176}],134:[function(require,module,exports){\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n},{\"./_object-gopn\":135,\"./_to-iobject\":173}],135:[function(require,module,exports){\n// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n\n},{\"./_enum-bug-keys\":90,\"./_object-keys-internal\":138}],136:[function(require,module,exports){\nexports.f = Object.getOwnPropertySymbols;\n\n},{}],137:[function(require,module,exports){\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n},{\"./_has\":100,\"./_shared-key\":158,\"./_to-object\":175}],138:[function(require,module,exports){\nvar has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n},{\"./_array-includes\":70,\"./_has\":100,\"./_shared-key\":158,\"./_to-iobject\":173}],139:[function(require,module,exports){\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n},{\"./_enum-bug-keys\":90,\"./_object-keys-internal\":138}],140:[function(require,module,exports){\nexports.f = {}.propertyIsEnumerable;\n\n},{}],141:[function(require,module,exports){\n// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n},{\"./_core\":82,\"./_export\":92,\"./_fails\":94}],142:[function(require,module,exports){\nvar getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n\n},{\"./_object-keys\":139,\"./_object-pie\":140,\"./_to-iobject\":173}],143:[function(require,module,exports){\n// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n},{\"./_an-object\":66,\"./_global\":99,\"./_object-gopn\":135,\"./_object-gops\":136}],144:[function(require,module,exports){\nvar $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n\n},{\"./_global\":99,\"./_string-trim\":167,\"./_string-ws\":168}],145:[function(require,module,exports){\nvar $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n\n},{\"./_global\":99,\"./_string-trim\":167,\"./_string-ws\":168}],146:[function(require,module,exports){\nmodule.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n\n},{}],147:[function(require,module,exports){\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n},{\"./_an-object\":66,\"./_is-object\":110,\"./_new-promise-capability\":127}],148:[function(require,module,exports){\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n},{}],149:[function(require,module,exports){\nvar redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n\n},{\"./_redefine\":150}],150:[function(require,module,exports){\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n},{\"./_core\":82,\"./_global\":99,\"./_has\":100,\"./_hide\":101,\"./_uid\":180}],151:[function(require,module,exports){\nmodule.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n\n},{}],152:[function(require,module,exports){\n// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n},{}],153:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n\n},{\"./_a-function\":62,\"./_ctx\":84,\"./_export\":92,\"./_for-of\":98}],154:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n\n},{\"./_export\":92}],155:[function(require,module,exports){\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n},{\"./_an-object\":66,\"./_ctx\":84,\"./_is-object\":110,\"./_object-gopd\":133}],156:[function(require,module,exports){\n'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n\n},{\"./_descriptors\":88,\"./_global\":99,\"./_object-dp\":130,\"./_wks\":184}],157:[function(require,module,exports){\nvar def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n},{\"./_has\":100,\"./_object-dp\":130,\"./_wks\":184}],158:[function(require,module,exports){\nvar shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n},{\"./_shared\":159,\"./_uid\":180}],159:[function(require,module,exports){\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n\n},{\"./_global\":99}],160:[function(require,module,exports){\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n},{\"./_a-function\":62,\"./_an-object\":66,\"./_wks\":184}],161:[function(require,module,exports){\n'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n\n},{\"./_fails\":94}],162:[function(require,module,exports){\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n},{\"./_defined\":87,\"./_to-integer\":172}],163:[function(require,module,exports){\n// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n},{\"./_defined\":87,\"./_is-regexp\":111}],164:[function(require,module,exports){\nvar $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n\n},{\"./_defined\":87,\"./_export\":92,\"./_fails\":94}],165:[function(require,module,exports){\n// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n},{\"./_defined\":87,\"./_string-repeat\":166,\"./_to-length\":174}],166:[function(require,module,exports){\n'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n\n},{\"./_defined\":87,\"./_to-integer\":172}],167:[function(require,module,exports){\nvar $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n\n},{\"./_defined\":87,\"./_export\":92,\"./_fails\":94,\"./_string-ws\":168}],168:[function(require,module,exports){\nmodule.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n\n},{}],169:[function(require,module,exports){\nvar ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n},{\"./_cof\":77,\"./_ctx\":84,\"./_dom-create\":89,\"./_global\":99,\"./_html\":102,\"./_invoke\":105}],170:[function(require,module,exports){\nvar toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n},{\"./_to-integer\":172}],171:[function(require,module,exports){\n// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n\n},{\"./_to-integer\":172,\"./_to-length\":174}],172:[function(require,module,exports){\n// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n},{}],173:[function(require,module,exports){\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n},{\"./_defined\":87,\"./_iobject\":106}],174:[function(require,module,exports){\n// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n},{\"./_to-integer\":172}],175:[function(require,module,exports){\n// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n},{\"./_defined\":87}],176:[function(require,module,exports){\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n},{\"./_is-object\":110}],177:[function(require,module,exports){\n'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n\n},{\"./_an-instance\":65,\"./_array-copy-within\":67,\"./_array-fill\":68,\"./_array-includes\":70,\"./_array-methods\":71,\"./_classof\":76,\"./_ctx\":84,\"./_descriptors\":88,\"./_export\":92,\"./_fails\":94,\"./_global\":99,\"./_has\":100,\"./_hide\":101,\"./_is-array-iter\":107,\"./_is-object\":110,\"./_iter-detect\":115,\"./_iterators\":117,\"./_library\":118,\"./_object-create\":129,\"./_object-dp\":130,\"./_object-gopd\":133,\"./_object-gopn\":135,\"./_object-gpo\":137,\"./_property-desc\":148,\"./_redefine-all\":149,\"./_set-species\":156,\"./_species-constructor\":160,\"./_to-absolute-index\":170,\"./_to-index\":171,\"./_to-integer\":172,\"./_to-length\":174,\"./_to-object\":175,\"./_to-primitive\":176,\"./_typed\":179,\"./_typed-buffer\":178,\"./_uid\":180,\"./_wks\":184,\"./core.get-iterator-method\":185,\"./es6.array.iterator\":197}],178:[function(require,module,exports){\n'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n\n},{\"./_an-instance\":65,\"./_array-fill\":68,\"./_descriptors\":88,\"./_fails\":94,\"./_global\":99,\"./_hide\":101,\"./_library\":118,\"./_object-dp\":130,\"./_object-gopn\":135,\"./_redefine-all\":149,\"./_set-to-string-tag\":157,\"./_to-index\":171,\"./_to-integer\":172,\"./_to-length\":174,\"./_typed\":179}],179:[function(require,module,exports){\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n\n},{\"./_global\":99,\"./_hide\":101,\"./_uid\":180}],180:[function(require,module,exports){\nvar id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n},{}],181:[function(require,module,exports){\nvar isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n\n},{\"./_is-object\":110}],182:[function(require,module,exports){\nvar global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n\n},{\"./_core\":82,\"./_global\":99,\"./_library\":118,\"./_object-dp\":130,\"./_wks-ext\":183}],183:[function(require,module,exports){\nexports.f = require('./_wks');\n\n},{\"./_wks\":184}],184:[function(require,module,exports){\nvar store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n},{\"./_global\":99,\"./_shared\":159,\"./_uid\":180}],185:[function(require,module,exports){\nvar classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n},{\"./_classof\":76,\"./_core\":82,\"./_iterators\":117,\"./_wks\":184}],186:[function(require,module,exports){\n// https://github.com/benjamingr/RexExp.escape\nvar $export = require('./_export');\nvar $re = require('./_replacer')(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n\n},{\"./_export\":92,\"./_replacer\":151}],187:[function(require,module,exports){\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n\n},{\"./_add-to-unscopables\":64,\"./_array-copy-within\":67,\"./_export\":92}],188:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n\n},{\"./_array-methods\":71,\"./_export\":92,\"./_strict-method\":161}],189:[function(require,module,exports){\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n\n},{\"./_add-to-unscopables\":64,\"./_array-fill\":68,\"./_export\":92}],190:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n\n},{\"./_array-methods\":71,\"./_export\":92,\"./_strict-method\":161}],191:[function(require,module,exports){\n'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n},{\"./_add-to-unscopables\":64,\"./_array-methods\":71,\"./_export\":92}],192:[function(require,module,exports){\n'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n},{\"./_add-to-unscopables\":64,\"./_array-methods\":71,\"./_export\":92}],193:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n\n},{\"./_array-methods\":71,\"./_export\":92,\"./_strict-method\":161}],194:[function(require,module,exports){\n'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n},{\"./_create-property\":83,\"./_ctx\":84,\"./_export\":92,\"./_is-array-iter\":107,\"./_iter-call\":112,\"./_iter-detect\":115,\"./_to-length\":174,\"./_to-object\":175,\"./core.get-iterator-method\":185}],195:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n\n},{\"./_array-includes\":70,\"./_export\":92,\"./_strict-method\":161}],196:[function(require,module,exports){\n// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n\n},{\"./_export\":92,\"./_is-array\":108}],197:[function(require,module,exports){\n'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n},{\"./_add-to-unscopables\":64,\"./_iter-define\":114,\"./_iter-step\":116,\"./_iterators\":117,\"./_to-iobject\":173}],198:[function(require,module,exports){\n'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n\n},{\"./_export\":92,\"./_iobject\":106,\"./_strict-method\":161,\"./_to-iobject\":173}],199:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n\n},{\"./_export\":92,\"./_strict-method\":161,\"./_to-integer\":172,\"./_to-iobject\":173,\"./_to-length\":174}],200:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n\n},{\"./_array-methods\":71,\"./_export\":92,\"./_strict-method\":161}],201:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n},{\"./_create-property\":83,\"./_export\":92,\"./_fails\":94}],202:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n\n},{\"./_array-reduce\":72,\"./_export\":92,\"./_strict-method\":161}],203:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n\n},{\"./_array-reduce\":72,\"./_export\":92,\"./_strict-method\":161}],204:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n\n},{\"./_cof\":77,\"./_export\":92,\"./_fails\":94,\"./_html\":102,\"./_to-absolute-index\":170,\"./_to-length\":174}],205:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n\n},{\"./_array-methods\":71,\"./_export\":92,\"./_strict-method\":161}],206:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n\n},{\"./_a-function\":62,\"./_export\":92,\"./_fails\":94,\"./_strict-method\":161,\"./_to-object\":175}],207:[function(require,module,exports){\nrequire('./_set-species')('Array');\n\n},{\"./_set-species\":156}],208:[function(require,module,exports){\n// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n\n},{\"./_export\":92}],209:[function(require,module,exports){\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n\n},{\"./_date-to-iso-string\":85,\"./_export\":92}],210:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n\n},{\"./_export\":92,\"./_fails\":94,\"./_to-object\":175,\"./_to-primitive\":176}],211:[function(require,module,exports){\nvar TO_PRIMITIVE = require('./_wks')('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));\n\n},{\"./_date-to-primitive\":86,\"./_hide\":101,\"./_wks\":184}],212:[function(require,module,exports){\nvar DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n require('./_redefine')(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n\n},{\"./_redefine\":150}],213:[function(require,module,exports){\n// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n\n},{\"./_bind\":75,\"./_export\":92}],214:[function(require,module,exports){\n'use strict';\nvar isObject = require('./_is-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar HAS_INSTANCE = require('./_wks')('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n\n},{\"./_is-object\":110,\"./_object-dp\":130,\"./_object-gpo\":137,\"./_wks\":184}],215:[function(require,module,exports){\nvar dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n\n},{\"./_descriptors\":88,\"./_object-dp\":130}],216:[function(require,module,exports){\n'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n},{\"./_collection\":81,\"./_collection-strong\":78,\"./_validate-collection\":181}],217:[function(require,module,exports){\n// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n\n},{\"./_export\":92,\"./_math-log1p\":121}],218:[function(require,module,exports){\n// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n\n},{\"./_export\":92}],219:[function(require,module,exports){\n// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n\n},{\"./_export\":92}],220:[function(require,module,exports){\n// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n\n},{\"./_export\":92,\"./_math-sign\":123}],221:[function(require,module,exports){\n// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n\n},{\"./_export\":92}],222:[function(require,module,exports){\n// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n\n},{\"./_export\":92}],223:[function(require,module,exports){\n// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n\n},{\"./_export\":92,\"./_math-expm1\":119}],224:[function(require,module,exports){\n// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n\n},{\"./_export\":92,\"./_math-fround\":120}],225:[function(require,module,exports){\n// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n\n},{\"./_export\":92}],226:[function(require,module,exports){\n// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n\n},{\"./_export\":92,\"./_fails\":94}],227:[function(require,module,exports){\n// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n\n},{\"./_export\":92}],228:[function(require,module,exports){\n// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n\n},{\"./_export\":92,\"./_math-log1p\":121}],229:[function(require,module,exports){\n// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n\n},{\"./_export\":92}],230:[function(require,module,exports){\n// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n\n},{\"./_export\":92,\"./_math-sign\":123}],231:[function(require,module,exports){\n// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n\n},{\"./_export\":92,\"./_fails\":94,\"./_math-expm1\":119}],232:[function(require,module,exports){\n// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n\n},{\"./_export\":92,\"./_math-expm1\":119}],233:[function(require,module,exports){\n// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n\n},{\"./_export\":92}],234:[function(require,module,exports){\n'use strict';\nvar global = require('./_global');\nvar has = require('./_has');\nvar cof = require('./_cof');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar toPrimitive = require('./_to-primitive');\nvar fails = require('./_fails');\nvar gOPN = require('./_object-gopn').f;\nvar gOPD = require('./_object-gopd').f;\nvar dP = require('./_object-dp').f;\nvar $trim = require('./_string-trim').trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = require('./_descriptors') ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n require('./_redefine')(global, NUMBER, $Number);\n}\n\n},{\"./_cof\":77,\"./_descriptors\":88,\"./_fails\":94,\"./_global\":99,\"./_has\":100,\"./_inherit-if-required\":104,\"./_object-create\":129,\"./_object-dp\":130,\"./_object-gopd\":133,\"./_object-gopn\":135,\"./_redefine\":150,\"./_string-trim\":167,\"./_to-primitive\":176}],235:[function(require,module,exports){\n// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n\n},{\"./_export\":92}],236:[function(require,module,exports){\n// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n\n},{\"./_export\":92,\"./_global\":99}],237:[function(require,module,exports){\n// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n\n},{\"./_export\":92,\"./_is-integer\":109}],238:[function(require,module,exports){\n// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n\n},{\"./_export\":92}],239:[function(require,module,exports){\n// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n\n},{\"./_export\":92,\"./_is-integer\":109}],240:[function(require,module,exports){\n// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n\n},{\"./_export\":92}],241:[function(require,module,exports){\n// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n\n},{\"./_export\":92}],242:[function(require,module,exports){\nvar $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n\n},{\"./_export\":92,\"./_parse-float\":144}],243:[function(require,module,exports){\nvar $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n\n},{\"./_export\":92,\"./_parse-int\":145}],244:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toInteger = require('./_to-integer');\nvar aNumberValue = require('./_a-number-value');\nvar repeat = require('./_string-repeat');\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !require('./_fails')(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n\n},{\"./_a-number-value\":63,\"./_export\":92,\"./_fails\":94,\"./_string-repeat\":166,\"./_to-integer\":172}],245:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $fails = require('./_fails');\nvar aNumberValue = require('./_a-number-value');\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n\n},{\"./_a-number-value\":63,\"./_export\":92,\"./_fails\":94}],246:[function(require,module,exports){\n// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n\n},{\"./_export\":92,\"./_object-assign\":128}],247:[function(require,module,exports){\nvar $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n\n},{\"./_export\":92,\"./_object-create\":129}],248:[function(require,module,exports){\nvar $export = require('./_export');\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') });\n\n},{\"./_descriptors\":88,\"./_export\":92,\"./_object-dps\":131}],249:[function(require,module,exports){\nvar $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n\n},{\"./_descriptors\":88,\"./_export\":92,\"./_object-dp\":130}],250:[function(require,module,exports){\n// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n\n},{\"./_is-object\":110,\"./_meta\":124,\"./_object-sap\":141}],251:[function(require,module,exports){\n// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n\n},{\"./_object-gopd\":133,\"./_object-sap\":141,\"./_to-iobject\":173}],252:[function(require,module,exports){\n// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n\n},{\"./_object-gopn-ext\":134,\"./_object-sap\":141}],253:[function(require,module,exports){\n// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n\n},{\"./_object-gpo\":137,\"./_object-sap\":141,\"./_to-object\":175}],254:[function(require,module,exports){\n// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n\n},{\"./_is-object\":110,\"./_object-sap\":141}],255:[function(require,module,exports){\n// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n\n},{\"./_is-object\":110,\"./_object-sap\":141}],256:[function(require,module,exports){\n// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n\n},{\"./_is-object\":110,\"./_object-sap\":141}],257:[function(require,module,exports){\n// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n\n},{\"./_export\":92,\"./_same-value\":152}],258:[function(require,module,exports){\n// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n\n},{\"./_object-keys\":139,\"./_object-sap\":141,\"./_to-object\":175}],259:[function(require,module,exports){\n// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n\n},{\"./_is-object\":110,\"./_meta\":124,\"./_object-sap\":141}],260:[function(require,module,exports){\n// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n\n},{\"./_is-object\":110,\"./_meta\":124,\"./_object-sap\":141}],261:[function(require,module,exports){\n// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n\n},{\"./_export\":92,\"./_set-proto\":155}],262:[function(require,module,exports){\n'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n\n},{\"./_classof\":76,\"./_redefine\":150,\"./_wks\":184}],263:[function(require,module,exports){\nvar $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n\n},{\"./_export\":92,\"./_parse-float\":144}],264:[function(require,module,exports){\nvar $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n\n},{\"./_export\":92,\"./_parse-int\":145}],265:[function(require,module,exports){\n'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value);\n if (domain) domain.exit();\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n if (promise._h == 1) return false;\n var chain = promise._a || promise._c;\n var i = 0;\n var reaction;\n while (chain.length > i) {\n reaction = chain[i++];\n if (reaction.fail || !isUnhandled(reaction.promise)) return false;\n } return true;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n\n},{\"./_a-function\":62,\"./_an-instance\":65,\"./_classof\":76,\"./_core\":82,\"./_ctx\":84,\"./_export\":92,\"./_for-of\":98,\"./_global\":99,\"./_is-object\":110,\"./_iter-detect\":115,\"./_library\":118,\"./_microtask\":126,\"./_new-promise-capability\":127,\"./_perform\":146,\"./_promise-resolve\":147,\"./_redefine-all\":149,\"./_set-species\":156,\"./_set-to-string-tag\":157,\"./_species-constructor\":160,\"./_task\":169,\"./_wks\":184}],266:[function(require,module,exports){\n// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n\n},{\"./_a-function\":62,\"./_an-object\":66,\"./_export\":92,\"./_fails\":94,\"./_global\":99}],267:[function(require,module,exports){\n// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n\n},{\"./_a-function\":62,\"./_an-object\":66,\"./_bind\":75,\"./_export\":92,\"./_fails\":94,\"./_global\":99,\"./_is-object\":110,\"./_object-create\":129}],268:[function(require,module,exports){\n// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_fails\":94,\"./_object-dp\":130,\"./_to-primitive\":176}],269:[function(require,module,exports){\n// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_object-gopd\":133}],270:[function(require,module,exports){\n'use strict';\n// 26.1.5 Reflect.enumerate(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\nrequire('./_iter-create')(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_iter-create\":113}],271:[function(require,module,exports){\n// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_object-gopd\":133}],272:[function(require,module,exports){\n// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_object-gpo\":137}],273:[function(require,module,exports){\n// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_has\":100,\"./_is-object\":110,\"./_object-gopd\":133,\"./_object-gpo\":137}],274:[function(require,module,exports){\n// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n\n},{\"./_export\":92}],275:[function(require,module,exports){\n// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92}],276:[function(require,module,exports){\n// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n\n},{\"./_export\":92,\"./_own-keys\":143}],277:[function(require,module,exports){\n// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n},{\"./_an-object\":66,\"./_export\":92}],278:[function(require,module,exports){\n// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n\n},{\"./_export\":92,\"./_set-proto\":155}],279:[function(require,module,exports){\n// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_has\":100,\"./_is-object\":110,\"./_object-dp\":130,\"./_object-gopd\":133,\"./_object-gpo\":137,\"./_property-desc\":148}],280:[function(require,module,exports){\nvar global = require('./_global');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar dP = require('./_object-dp').f;\nvar gOPN = require('./_object-gopn').f;\nvar isRegExp = require('./_is-regexp');\nvar $flags = require('./_flags');\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () {\n re2[require('./_wks')('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n require('./_redefine')(global, 'RegExp', $RegExp);\n}\n\nrequire('./_set-species')('RegExp');\n\n},{\"./_descriptors\":88,\"./_fails\":94,\"./_flags\":96,\"./_global\":99,\"./_inherit-if-required\":104,\"./_is-regexp\":111,\"./_object-dp\":130,\"./_object-gopn\":135,\"./_redefine\":150,\"./_set-species\":156,\"./_wks\":184}],281:[function(require,module,exports){\n// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n\n},{\"./_descriptors\":88,\"./_flags\":96,\"./_object-dp\":130}],282:[function(require,module,exports){\n// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n\n},{\"./_fix-re-wks\":95}],283:[function(require,module,exports){\n// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n\n},{\"./_fix-re-wks\":95}],284:[function(require,module,exports){\n// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n\n},{\"./_fix-re-wks\":95}],285:[function(require,module,exports){\n// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n\n},{\"./_fix-re-wks\":95,\"./_is-regexp\":111}],286:[function(require,module,exports){\n'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n\n},{\"./_an-object\":66,\"./_descriptors\":88,\"./_fails\":94,\"./_flags\":96,\"./_redefine\":150,\"./es6.regexp.flags\":281}],287:[function(require,module,exports){\n'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n},{\"./_collection\":81,\"./_collection-strong\":78,\"./_validate-collection\":181}],288:[function(require,module,exports){\n'use strict';\n// B.2.3.2 String.prototype.anchor(name)\nrequire('./_string-html')('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n\n},{\"./_string-html\":164}],289:[function(require,module,exports){\n'use strict';\n// B.2.3.3 String.prototype.big()\nrequire('./_string-html')('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n\n},{\"./_string-html\":164}],290:[function(require,module,exports){\n'use strict';\n// B.2.3.4 String.prototype.blink()\nrequire('./_string-html')('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n\n},{\"./_string-html\":164}],291:[function(require,module,exports){\n'use strict';\n// B.2.3.5 String.prototype.bold()\nrequire('./_string-html')('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n\n},{\"./_string-html\":164}],292:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n\n},{\"./_export\":92,\"./_string-at\":162}],293:[function(require,module,exports){\n// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n\n},{\"./_export\":92,\"./_fails-is-regexp\":93,\"./_string-context\":163,\"./_to-length\":174}],294:[function(require,module,exports){\n'use strict';\n// B.2.3.6 String.prototype.fixed()\nrequire('./_string-html')('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n\n},{\"./_string-html\":164}],295:[function(require,module,exports){\n'use strict';\n// B.2.3.7 String.prototype.fontcolor(color)\nrequire('./_string-html')('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n\n},{\"./_string-html\":164}],296:[function(require,module,exports){\n'use strict';\n// B.2.3.8 String.prototype.fontsize(size)\nrequire('./_string-html')('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n\n},{\"./_string-html\":164}],297:[function(require,module,exports){\nvar $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n\n},{\"./_export\":92,\"./_to-absolute-index\":170}],298:[function(require,module,exports){\n// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n},{\"./_export\":92,\"./_fails-is-regexp\":93,\"./_string-context\":163}],299:[function(require,module,exports){\n'use strict';\n// B.2.3.9 String.prototype.italics()\nrequire('./_string-html')('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n\n},{\"./_string-html\":164}],300:[function(require,module,exports){\n'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n\n},{\"./_iter-define\":114,\"./_string-at\":162}],301:[function(require,module,exports){\n'use strict';\n// B.2.3.10 String.prototype.link(url)\nrequire('./_string-html')('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n\n},{\"./_string-html\":164}],302:[function(require,module,exports){\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n\n},{\"./_export\":92,\"./_to-iobject\":173,\"./_to-length\":174}],303:[function(require,module,exports){\nvar $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n\n},{\"./_export\":92,\"./_string-repeat\":166}],304:[function(require,module,exports){\n'use strict';\n// B.2.3.11 String.prototype.small()\nrequire('./_string-html')('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n\n},{\"./_string-html\":164}],305:[function(require,module,exports){\n// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\n},{\"./_export\":92,\"./_fails-is-regexp\":93,\"./_string-context\":163,\"./_to-length\":174}],306:[function(require,module,exports){\n'use strict';\n// B.2.3.12 String.prototype.strike()\nrequire('./_string-html')('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n\n},{\"./_string-html\":164}],307:[function(require,module,exports){\n'use strict';\n// B.2.3.13 String.prototype.sub()\nrequire('./_string-html')('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n\n},{\"./_string-html\":164}],308:[function(require,module,exports){\n'use strict';\n// B.2.3.14 String.prototype.sup()\nrequire('./_string-html')('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n\n},{\"./_string-html\":164}],309:[function(require,module,exports){\n'use strict';\n// 21.1.3.25 String.prototype.trim()\nrequire('./_string-trim')('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n\n},{\"./_string-trim\":167}],310:[function(require,module,exports){\n'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n replacer = args[1];\n if (typeof replacer == 'function') $replacer = replacer;\n if ($replacer || !isArray(replacer)) replacer = function (key, value) {\n if ($replacer) value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n},{\"./_an-object\":66,\"./_descriptors\":88,\"./_enum-keys\":91,\"./_export\":92,\"./_fails\":94,\"./_global\":99,\"./_has\":100,\"./_hide\":101,\"./_is-array\":108,\"./_library\":118,\"./_meta\":124,\"./_object-create\":129,\"./_object-dp\":130,\"./_object-gopd\":133,\"./_object-gopn\":135,\"./_object-gopn-ext\":134,\"./_object-gops\":136,\"./_object-keys\":139,\"./_object-pie\":140,\"./_property-desc\":148,\"./_redefine\":150,\"./_set-to-string-tag\":157,\"./_shared\":159,\"./_to-iobject\":173,\"./_to-primitive\":176,\"./_uid\":180,\"./_wks\":184,\"./_wks-define\":182,\"./_wks-ext\":183}],311:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var final = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < final) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n\n},{\"./_an-object\":66,\"./_export\":92,\"./_fails\":94,\"./_global\":99,\"./_is-object\":110,\"./_set-species\":156,\"./_species-constructor\":160,\"./_to-absolute-index\":170,\"./_to-length\":174,\"./_typed\":179,\"./_typed-buffer\":178}],312:[function(require,module,exports){\nvar $export = require('./_export');\n$export($export.G + $export.W + $export.F * !require('./_typed').ABV, {\n DataView: require('./_typed-buffer').DataView\n});\n\n},{\"./_export\":92,\"./_typed\":179,\"./_typed-buffer\":178}],313:[function(require,module,exports){\nrequire('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],314:[function(require,module,exports){\nrequire('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],315:[function(require,module,exports){\nrequire('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],316:[function(require,module,exports){\nrequire('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],317:[function(require,module,exports){\nrequire('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],318:[function(require,module,exports){\nrequire('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],319:[function(require,module,exports){\nrequire('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],320:[function(require,module,exports){\nrequire('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n\n},{\"./_typed-array\":177}],321:[function(require,module,exports){\nrequire('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n\n},{\"./_typed-array\":177}],322:[function(require,module,exports){\n'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n},{\"./_array-methods\":71,\"./_collection\":81,\"./_collection-weak\":80,\"./_fails\":94,\"./_is-object\":110,\"./_meta\":124,\"./_object-assign\":128,\"./_redefine\":150,\"./_validate-collection\":181}],323:[function(require,module,exports){\n'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n\n},{\"./_collection\":81,\"./_collection-weak\":80,\"./_validate-collection\":181}],324:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar aFunction = require('./_a-function');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatMap');\n\n},{\"./_a-function\":62,\"./_add-to-unscopables\":64,\"./_array-species-create\":74,\"./_export\":92,\"./_flatten-into-array\":97,\"./_to-length\":174,\"./_to-object\":175}],325:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar toInteger = require('./_to-integer');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatten');\n\n},{\"./_add-to-unscopables\":64,\"./_array-species-create\":74,\"./_export\":92,\"./_flatten-into-array\":97,\"./_to-integer\":172,\"./_to-length\":174,\"./_to-object\":175}],326:[function(require,module,exports){\n'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n\n},{\"./_add-to-unscopables\":64,\"./_array-includes\":70,\"./_export\":92}],327:[function(require,module,exports){\n// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = require('./_export');\nvar microtask = require('./_microtask')();\nvar process = require('./_global').process;\nvar isNode = require('./_cof')(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n\n},{\"./_cof\":77,\"./_export\":92,\"./_global\":99,\"./_microtask\":126}],328:[function(require,module,exports){\n// https://github.com/ljharb/proposal-is-error\nvar $export = require('./_export');\nvar cof = require('./_cof');\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n\n},{\"./_cof\":77,\"./_export\":92}],329:[function(require,module,exports){\n// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.G, { global: require('./_global') });\n\n},{\"./_export\":92,\"./_global\":99}],330:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\nrequire('./_set-collection-from')('Map');\n\n},{\"./_set-collection-from\":153}],331:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\nrequire('./_set-collection-of')('Map');\n\n},{\"./_set-collection-of\":154}],332:[function(require,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') });\n\n},{\"./_collection-to-json\":79,\"./_export\":92}],333:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n\n},{\"./_export\":92}],334:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n\n},{\"./_export\":92}],335:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n\n},{\"./_export\":92}],336:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar scale = require('./_math-scale');\nvar fround = require('./_math-fround');\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n\n},{\"./_export\":92,\"./_math-fround\":120,\"./_math-scale\":122}],337:[function(require,module,exports){\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n\n},{\"./_export\":92}],338:[function(require,module,exports){\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);\n }\n});\n\n},{\"./_export\":92}],339:[function(require,module,exports){\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n\n},{\"./_export\":92}],340:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n\n},{\"./_export\":92}],341:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n\n},{\"./_export\":92}],342:[function(require,module,exports){\n// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { scale: require('./_math-scale') });\n\n},{\"./_export\":92,\"./_math-scale\":122}],343:[function(require,module,exports){\n// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n\n},{\"./_export\":92}],344:[function(require,module,exports){\n// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n\n},{\"./_export\":92}],345:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n\n},{\"./_a-function\":62,\"./_descriptors\":88,\"./_export\":92,\"./_object-dp\":130,\"./_object-forced-pam\":132,\"./_to-object\":175}],346:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n\n},{\"./_a-function\":62,\"./_descriptors\":88,\"./_export\":92,\"./_object-dp\":130,\"./_object-forced-pam\":132,\"./_to-object\":175}],347:[function(require,module,exports){\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n\n},{\"./_export\":92,\"./_object-to-array\":142}],348:[function(require,module,exports){\n// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n\n},{\"./_create-property\":83,\"./_export\":92,\"./_object-gopd\":133,\"./_own-keys\":143,\"./_to-iobject\":173}],349:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n\n},{\"./_descriptors\":88,\"./_export\":92,\"./_object-forced-pam\":132,\"./_object-gopd\":133,\"./_object-gpo\":137,\"./_to-object\":175,\"./_to-primitive\":176}],350:[function(require,module,exports){\n'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n\n},{\"./_descriptors\":88,\"./_export\":92,\"./_object-forced-pam\":132,\"./_object-gopd\":133,\"./_object-gpo\":137,\"./_to-object\":175,\"./_to-primitive\":176}],351:[function(require,module,exports){\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n\n},{\"./_export\":92,\"./_object-to-array\":142}],352:[function(require,module,exports){\n'use strict';\n// https://github.com/zenparsing/es-observable\nvar $export = require('./_export');\nvar global = require('./_global');\nvar core = require('./_core');\nvar microtask = require('./_microtask')();\nvar OBSERVABLE = require('./_wks')('observable');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar anInstance = require('./_an-instance');\nvar redefineAll = require('./_redefine-all');\nvar hide = require('./_hide');\nvar forOf = require('./_for-of');\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\nrequire('./_set-species')('Observable');\n\n},{\"./_a-function\":62,\"./_an-instance\":65,\"./_an-object\":66,\"./_core\":82,\"./_export\":92,\"./_for-of\":98,\"./_global\":99,\"./_hide\":101,\"./_microtask\":126,\"./_redefine-all\":149,\"./_set-species\":156,\"./_wks\":184}],353:[function(require,module,exports){\n// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n\n},{\"./_core\":82,\"./_export\":92,\"./_global\":99,\"./_promise-resolve\":147,\"./_species-constructor\":160}],354:[function(require,module,exports){\n'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n\n},{\"./_export\":92,\"./_new-promise-capability\":127,\"./_perform\":146}],355:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125}],356:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125}],357:[function(require,module,exports){\nvar Set = require('./es6.set');\nvar from = require('./_array-from-iterable');\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n\n},{\"./_an-object\":66,\"./_array-from-iterable\":69,\"./_metadata\":125,\"./_object-gpo\":137,\"./es6.set\":287}],358:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125,\"./_object-gpo\":137}],359:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125}],360:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125}],361:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125,\"./_object-gpo\":137}],362:[function(require,module,exports){\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n\n},{\"./_an-object\":66,\"./_metadata\":125}],363:[function(require,module,exports){\nvar $metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n\n},{\"./_a-function\":62,\"./_an-object\":66,\"./_metadata\":125}],364:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n\n},{\"./_set-collection-from\":153}],365:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n\n},{\"./_set-collection-of\":154}],366:[function(require,module,exports){\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n\n},{\"./_collection-to-json\":79,\"./_export\":92}],367:[function(require,module,exports){\n'use strict';\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = require('./_export');\nvar $at = require('./_string-at')(true);\n\n$export($export.P, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n\n},{\"./_export\":92,\"./_string-at\":162}],368:[function(require,module,exports){\n'use strict';\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = require('./_export');\nvar defined = require('./_defined');\nvar toLength = require('./_to-length');\nvar isRegExp = require('./_is-regexp');\nvar getFlags = require('./_flags');\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\nrequire('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n\n},{\"./_defined\":87,\"./_export\":92,\"./_flags\":96,\"./_is-regexp\":111,\"./_iter-create\":113,\"./_to-length\":174}],369:[function(require,module,exports){\n'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n\n},{\"./_export\":92,\"./_string-pad\":165}],370:[function(require,module,exports){\n'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n\n},{\"./_export\":92,\"./_string-pad\":165}],371:[function(require,module,exports){\n'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n\n},{\"./_string-trim\":167}],372:[function(require,module,exports){\n'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n\n},{\"./_string-trim\":167}],373:[function(require,module,exports){\nrequire('./_wks-define')('asyncIterator');\n\n},{\"./_wks-define\":182}],374:[function(require,module,exports){\nrequire('./_wks-define')('observable');\n\n},{\"./_wks-define\":182}],375:[function(require,module,exports){\n// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.S, 'System', { global: require('./_global') });\n\n},{\"./_export\":92,\"./_global\":99}],376:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n\n},{\"./_set-collection-from\":153}],377:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n\n},{\"./_set-collection-of\":154}],378:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\nrequire('./_set-collection-from')('WeakSet');\n\n},{\"./_set-collection-from\":153}],379:[function(require,module,exports){\n// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\nrequire('./_set-collection-of')('WeakSet');\n\n},{\"./_set-collection-of\":154}],380:[function(require,module,exports){\nvar $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n\n},{\"./_global\":99,\"./_hide\":101,\"./_iterators\":117,\"./_object-keys\":139,\"./_redefine\":150,\"./_wks\":184,\"./es6.array.iterator\":197}],381:[function(require,module,exports){\nvar $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n\n},{\"./_export\":92,\"./_task\":169}],382:[function(require,module,exports){\n// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar navigator = global.navigator;\nvar slice = [].slice;\nvar MSIE = !!navigator && /MSIE .\\./.test(navigator.userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n\n},{\"./_export\":92,\"./_global\":99}],383:[function(require,module,exports){\nrequire('./modules/es6.symbol');\nrequire('./modules/es6.object.create');\nrequire('./modules/es6.object.define-property');\nrequire('./modules/es6.object.define-properties');\nrequire('./modules/es6.object.get-own-property-descriptor');\nrequire('./modules/es6.object.get-prototype-of');\nrequire('./modules/es6.object.keys');\nrequire('./modules/es6.object.get-own-property-names');\nrequire('./modules/es6.object.freeze');\nrequire('./modules/es6.object.seal');\nrequire('./modules/es6.object.prevent-extensions');\nrequire('./modules/es6.object.is-frozen');\nrequire('./modules/es6.object.is-sealed');\nrequire('./modules/es6.object.is-extensible');\nrequire('./modules/es6.object.assign');\nrequire('./modules/es6.object.is');\nrequire('./modules/es6.object.set-prototype-of');\nrequire('./modules/es6.object.to-string');\nrequire('./modules/es6.function.bind');\nrequire('./modules/es6.function.name');\nrequire('./modules/es6.function.has-instance');\nrequire('./modules/es6.parse-int');\nrequire('./modules/es6.parse-float');\nrequire('./modules/es6.number.constructor');\nrequire('./modules/es6.number.to-fixed');\nrequire('./modules/es6.number.to-precision');\nrequire('./modules/es6.number.epsilon');\nrequire('./modules/es6.number.is-finite');\nrequire('./modules/es6.number.is-integer');\nrequire('./modules/es6.number.is-nan');\nrequire('./modules/es6.number.is-safe-integer');\nrequire('./modules/es6.number.max-safe-integer');\nrequire('./modules/es6.number.min-safe-integer');\nrequire('./modules/es6.number.parse-float');\nrequire('./modules/es6.number.parse-int');\nrequire('./modules/es6.math.acosh');\nrequire('./modules/es6.math.asinh');\nrequire('./modules/es6.math.atanh');\nrequire('./modules/es6.math.cbrt');\nrequire('./modules/es6.math.clz32');\nrequire('./modules/es6.math.cosh');\nrequire('./modules/es6.math.expm1');\nrequire('./modules/es6.math.fround');\nrequire('./modules/es6.math.hypot');\nrequire('./modules/es6.math.imul');\nrequire('./modules/es6.math.log10');\nrequire('./modules/es6.math.log1p');\nrequire('./modules/es6.math.log2');\nrequire('./modules/es6.math.sign');\nrequire('./modules/es6.math.sinh');\nrequire('./modules/es6.math.tanh');\nrequire('./modules/es6.math.trunc');\nrequire('./modules/es6.string.from-code-point');\nrequire('./modules/es6.string.raw');\nrequire('./modules/es6.string.trim');\nrequire('./modules/es6.string.iterator');\nrequire('./modules/es6.string.code-point-at');\nrequire('./modules/es6.string.ends-with');\nrequire('./modules/es6.string.includes');\nrequire('./modules/es6.string.repeat');\nrequire('./modules/es6.string.starts-with');\nrequire('./modules/es6.string.anchor');\nrequire('./modules/es6.string.big');\nrequire('./modules/es6.string.blink');\nrequire('./modules/es6.string.bold');\nrequire('./modules/es6.string.fixed');\nrequire('./modules/es6.string.fontcolor');\nrequire('./modules/es6.string.fontsize');\nrequire('./modules/es6.string.italics');\nrequire('./modules/es6.string.link');\nrequire('./modules/es6.string.small');\nrequire('./modules/es6.string.strike');\nrequire('./modules/es6.string.sub');\nrequire('./modules/es6.string.sup');\nrequire('./modules/es6.date.now');\nrequire('./modules/es6.date.to-json');\nrequire('./modules/es6.date.to-iso-string');\nrequire('./modules/es6.date.to-string');\nrequire('./modules/es6.date.to-primitive');\nrequire('./modules/es6.array.is-array');\nrequire('./modules/es6.array.from');\nrequire('./modules/es6.array.of');\nrequire('./modules/es6.array.join');\nrequire('./modules/es6.array.slice');\nrequire('./modules/es6.array.sort');\nrequire('./modules/es6.array.for-each');\nrequire('./modules/es6.array.map');\nrequire('./modules/es6.array.filter');\nrequire('./modules/es6.array.some');\nrequire('./modules/es6.array.every');\nrequire('./modules/es6.array.reduce');\nrequire('./modules/es6.array.reduce-right');\nrequire('./modules/es6.array.index-of');\nrequire('./modules/es6.array.last-index-of');\nrequire('./modules/es6.array.copy-within');\nrequire('./modules/es6.array.fill');\nrequire('./modules/es6.array.find');\nrequire('./modules/es6.array.find-index');\nrequire('./modules/es6.array.species');\nrequire('./modules/es6.array.iterator');\nrequire('./modules/es6.regexp.constructor');\nrequire('./modules/es6.regexp.to-string');\nrequire('./modules/es6.regexp.flags');\nrequire('./modules/es6.regexp.match');\nrequire('./modules/es6.regexp.replace');\nrequire('./modules/es6.regexp.search');\nrequire('./modules/es6.regexp.split');\nrequire('./modules/es6.promise');\nrequire('./modules/es6.map');\nrequire('./modules/es6.set');\nrequire('./modules/es6.weak-map');\nrequire('./modules/es6.weak-set');\nrequire('./modules/es6.typed.array-buffer');\nrequire('./modules/es6.typed.data-view');\nrequire('./modules/es6.typed.int8-array');\nrequire('./modules/es6.typed.uint8-array');\nrequire('./modules/es6.typed.uint8-clamped-array');\nrequire('./modules/es6.typed.int16-array');\nrequire('./modules/es6.typed.uint16-array');\nrequire('./modules/es6.typed.int32-array');\nrequire('./modules/es6.typed.uint32-array');\nrequire('./modules/es6.typed.float32-array');\nrequire('./modules/es6.typed.float64-array');\nrequire('./modules/es6.reflect.apply');\nrequire('./modules/es6.reflect.construct');\nrequire('./modules/es6.reflect.define-property');\nrequire('./modules/es6.reflect.delete-property');\nrequire('./modules/es6.reflect.enumerate');\nrequire('./modules/es6.reflect.get');\nrequire('./modules/es6.reflect.get-own-property-descriptor');\nrequire('./modules/es6.reflect.get-prototype-of');\nrequire('./modules/es6.reflect.has');\nrequire('./modules/es6.reflect.is-extensible');\nrequire('./modules/es6.reflect.own-keys');\nrequire('./modules/es6.reflect.prevent-extensions');\nrequire('./modules/es6.reflect.set');\nrequire('./modules/es6.reflect.set-prototype-of');\nrequire('./modules/es7.array.includes');\nrequire('./modules/es7.array.flat-map');\nrequire('./modules/es7.array.flatten');\nrequire('./modules/es7.string.at');\nrequire('./modules/es7.string.pad-start');\nrequire('./modules/es7.string.pad-end');\nrequire('./modules/es7.string.trim-left');\nrequire('./modules/es7.string.trim-right');\nrequire('./modules/es7.string.match-all');\nrequire('./modules/es7.symbol.async-iterator');\nrequire('./modules/es7.symbol.observable');\nrequire('./modules/es7.object.get-own-property-descriptors');\nrequire('./modules/es7.object.values');\nrequire('./modules/es7.object.entries');\nrequire('./modules/es7.object.define-getter');\nrequire('./modules/es7.object.define-setter');\nrequire('./modules/es7.object.lookup-getter');\nrequire('./modules/es7.object.lookup-setter');\nrequire('./modules/es7.map.to-json');\nrequire('./modules/es7.set.to-json');\nrequire('./modules/es7.map.of');\nrequire('./modules/es7.set.of');\nrequire('./modules/es7.weak-map.of');\nrequire('./modules/es7.weak-set.of');\nrequire('./modules/es7.map.from');\nrequire('./modules/es7.set.from');\nrequire('./modules/es7.weak-map.from');\nrequire('./modules/es7.weak-set.from');\nrequire('./modules/es7.global');\nrequire('./modules/es7.system.global');\nrequire('./modules/es7.error.is-error');\nrequire('./modules/es7.math.clamp');\nrequire('./modules/es7.math.deg-per-rad');\nrequire('./modules/es7.math.degrees');\nrequire('./modules/es7.math.fscale');\nrequire('./modules/es7.math.iaddh');\nrequire('./modules/es7.math.isubh');\nrequire('./modules/es7.math.imulh');\nrequire('./modules/es7.math.rad-per-deg');\nrequire('./modules/es7.math.radians');\nrequire('./modules/es7.math.scale');\nrequire('./modules/es7.math.umulh');\nrequire('./modules/es7.math.signbit');\nrequire('./modules/es7.promise.finally');\nrequire('./modules/es7.promise.try');\nrequire('./modules/es7.reflect.define-metadata');\nrequire('./modules/es7.reflect.delete-metadata');\nrequire('./modules/es7.reflect.get-metadata');\nrequire('./modules/es7.reflect.get-metadata-keys');\nrequire('./modules/es7.reflect.get-own-metadata');\nrequire('./modules/es7.reflect.get-own-metadata-keys');\nrequire('./modules/es7.reflect.has-metadata');\nrequire('./modules/es7.reflect.has-own-metadata');\nrequire('./modules/es7.reflect.metadata');\nrequire('./modules/es7.asap');\nrequire('./modules/es7.observable');\nrequire('./modules/web.timers');\nrequire('./modules/web.immediate');\nrequire('./modules/web.dom.iterable');\nmodule.exports = require('./modules/_core');\n\n},{\"./modules/_core\":82,\"./modules/es6.array.copy-within\":187,\"./modules/es6.array.every\":188,\"./modules/es6.array.fill\":189,\"./modules/es6.array.filter\":190,\"./modules/es6.array.find\":192,\"./modules/es6.array.find-index\":191,\"./modules/es6.array.for-each\":193,\"./modules/es6.array.from\":194,\"./modules/es6.array.index-of\":195,\"./modules/es6.array.is-array\":196,\"./modules/es6.array.iterator\":197,\"./modules/es6.array.join\":198,\"./modules/es6.array.last-index-of\":199,\"./modules/es6.array.map\":200,\"./modules/es6.array.of\":201,\"./modules/es6.array.reduce\":203,\"./modules/es6.array.reduce-right\":202,\"./modules/es6.array.slice\":204,\"./modules/es6.array.some\":205,\"./modules/es6.array.sort\":206,\"./modules/es6.array.species\":207,\"./modules/es6.date.now\":208,\"./modules/es6.date.to-iso-string\":209,\"./modules/es6.date.to-json\":210,\"./modules/es6.date.to-primitive\":211,\"./modules/es6.date.to-string\":212,\"./modules/es6.function.bind\":213,\"./modules/es6.function.has-instance\":214,\"./modules/es6.function.name\":215,\"./modules/es6.map\":216,\"./modules/es6.math.acosh\":217,\"./modules/es6.math.asinh\":218,\"./modules/es6.math.atanh\":219,\"./modules/es6.math.cbrt\":220,\"./modules/es6.math.clz32\":221,\"./modules/es6.math.cosh\":222,\"./modules/es6.math.expm1\":223,\"./modules/es6.math.fround\":224,\"./modules/es6.math.hypot\":225,\"./modules/es6.math.imul\":226,\"./modules/es6.math.log10\":227,\"./modules/es6.math.log1p\":228,\"./modules/es6.math.log2\":229,\"./modules/es6.math.sign\":230,\"./modules/es6.math.sinh\":231,\"./modules/es6.math.tanh\":232,\"./modules/es6.math.trunc\":233,\"./modules/es6.number.constructor\":234,\"./modules/es6.number.epsilon\":235,\"./modules/es6.number.is-finite\":236,\"./modules/es6.number.is-integer\":237,\"./modules/es6.number.is-nan\":238,\"./modules/es6.number.is-safe-integer\":239,\"./modules/es6.number.max-safe-integer\":240,\"./modules/es6.number.min-safe-integer\":241,\"./modules/es6.number.parse-float\":242,\"./modules/es6.number.parse-int\":243,\"./modules/es6.number.to-fixed\":244,\"./modules/es6.number.to-precision\":245,\"./modules/es6.object.assign\":246,\"./modules/es6.object.create\":247,\"./modules/es6.object.define-properties\":248,\"./modules/es6.object.define-property\":249,\"./modules/es6.object.freeze\":250,\"./modules/es6.object.get-own-property-descriptor\":251,\"./modules/es6.object.get-own-property-names\":252,\"./modules/es6.object.get-prototype-of\":253,\"./modules/es6.object.is\":257,\"./modules/es6.object.is-extensible\":254,\"./modules/es6.object.is-frozen\":255,\"./modules/es6.object.is-sealed\":256,\"./modules/es6.object.keys\":258,\"./modules/es6.object.prevent-extensions\":259,\"./modules/es6.object.seal\":260,\"./modules/es6.object.set-prototype-of\":261,\"./modules/es6.object.to-string\":262,\"./modules/es6.parse-float\":263,\"./modules/es6.parse-int\":264,\"./modules/es6.promise\":265,\"./modules/es6.reflect.apply\":266,\"./modules/es6.reflect.construct\":267,\"./modules/es6.reflect.define-property\":268,\"./modules/es6.reflect.delete-property\":269,\"./modules/es6.reflect.enumerate\":270,\"./modules/es6.reflect.get\":273,\"./modules/es6.reflect.get-own-property-descriptor\":271,\"./modules/es6.reflect.get-prototype-of\":272,\"./modules/es6.reflect.has\":274,\"./modules/es6.reflect.is-extensible\":275,\"./modules/es6.reflect.own-keys\":276,\"./modules/es6.reflect.prevent-extensions\":277,\"./modules/es6.reflect.set\":279,\"./modules/es6.reflect.set-prototype-of\":278,\"./modules/es6.regexp.constructor\":280,\"./modules/es6.regexp.flags\":281,\"./modules/es6.regexp.match\":282,\"./modules/es6.regexp.replace\":283,\"./modules/es6.regexp.search\":284,\"./modules/es6.regexp.split\":285,\"./modules/es6.regexp.to-string\":286,\"./modules/es6.set\":287,\"./modules/es6.string.anchor\":288,\"./modules/es6.string.big\":289,\"./modules/es6.string.blink\":290,\"./modules/es6.string.bold\":291,\"./modules/es6.string.code-point-at\":292,\"./modules/es6.string.ends-with\":293,\"./modules/es6.string.fixed\":294,\"./modules/es6.string.fontcolor\":295,\"./modules/es6.string.fontsize\":296,\"./modules/es6.string.from-code-point\":297,\"./modules/es6.string.includes\":298,\"./modules/es6.string.italics\":299,\"./modules/es6.string.iterator\":300,\"./modules/es6.string.link\":301,\"./modules/es6.string.raw\":302,\"./modules/es6.string.repeat\":303,\"./modules/es6.string.small\":304,\"./modules/es6.string.starts-with\":305,\"./modules/es6.string.strike\":306,\"./modules/es6.string.sub\":307,\"./modules/es6.string.sup\":308,\"./modules/es6.string.trim\":309,\"./modules/es6.symbol\":310,\"./modules/es6.typed.array-buffer\":311,\"./modules/es6.typed.data-view\":312,\"./modules/es6.typed.float32-array\":313,\"./modules/es6.typed.float64-array\":314,\"./modules/es6.typed.int16-array\":315,\"./modules/es6.typed.int32-array\":316,\"./modules/es6.typed.int8-array\":317,\"./modules/es6.typed.uint16-array\":318,\"./modules/es6.typed.uint32-array\":319,\"./modules/es6.typed.uint8-array\":320,\"./modules/es6.typed.uint8-clamped-array\":321,\"./modules/es6.weak-map\":322,\"./modules/es6.weak-set\":323,\"./modules/es7.array.flat-map\":324,\"./modules/es7.array.flatten\":325,\"./modules/es7.array.includes\":326,\"./modules/es7.asap\":327,\"./modules/es7.error.is-error\":328,\"./modules/es7.global\":329,\"./modules/es7.map.from\":330,\"./modules/es7.map.of\":331,\"./modules/es7.map.to-json\":332,\"./modules/es7.math.clamp\":333,\"./modules/es7.math.deg-per-rad\":334,\"./modules/es7.math.degrees\":335,\"./modules/es7.math.fscale\":336,\"./modules/es7.math.iaddh\":337,\"./modules/es7.math.imulh\":338,\"./modules/es7.math.isubh\":339,\"./modules/es7.math.rad-per-deg\":340,\"./modules/es7.math.radians\":341,\"./modules/es7.math.scale\":342,\"./modules/es7.math.signbit\":343,\"./modules/es7.math.umulh\":344,\"./modules/es7.object.define-getter\":345,\"./modules/es7.object.define-setter\":346,\"./modules/es7.object.entries\":347,\"./modules/es7.object.get-own-property-descriptors\":348,\"./modules/es7.object.lookup-getter\":349,\"./modules/es7.object.lookup-setter\":350,\"./modules/es7.object.values\":351,\"./modules/es7.observable\":352,\"./modules/es7.promise.finally\":353,\"./modules/es7.promise.try\":354,\"./modules/es7.reflect.define-metadata\":355,\"./modules/es7.reflect.delete-metadata\":356,\"./modules/es7.reflect.get-metadata\":358,\"./modules/es7.reflect.get-metadata-keys\":357,\"./modules/es7.reflect.get-own-metadata\":360,\"./modules/es7.reflect.get-own-metadata-keys\":359,\"./modules/es7.reflect.has-metadata\":361,\"./modules/es7.reflect.has-own-metadata\":362,\"./modules/es7.reflect.metadata\":363,\"./modules/es7.set.from\":364,\"./modules/es7.set.of\":365,\"./modules/es7.set.to-json\":366,\"./modules/es7.string.at\":367,\"./modules/es7.string.match-all\":368,\"./modules/es7.string.pad-end\":369,\"./modules/es7.string.pad-start\":370,\"./modules/es7.string.trim-left\":371,\"./modules/es7.string.trim-right\":372,\"./modules/es7.symbol.async-iterator\":373,\"./modules/es7.symbol.observable\":374,\"./modules/es7.system.global\":375,\"./modules/es7.weak-map.from\":376,\"./modules/es7.weak-map.of\":377,\"./modules/es7.weak-set.from\":378,\"./modules/es7.weak-set.of\":379,\"./modules/web.dom.iterable\":380,\"./modules/web.immediate\":381,\"./modules/web.timers\":382}],384:[function(require,module,exports){\n(function (process,global){\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE\n * @version 3.0.2\n */\n\n(function() {\n \"use strict\";\n function lib$es6$promise$utils$$objectOrFunction(x) {\n return typeof x === 'function' || (typeof x === 'object' && x !== null);\n }\n\n function lib$es6$promise$utils$$isFunction(x) {\n return typeof x === 'function';\n }\n\n function lib$es6$promise$utils$$isMaybeThenable(x) {\n return typeof x === 'object' && x !== null;\n }\n\n var lib$es6$promise$utils$$_isArray;\n if (!Array.isArray) {\n lib$es6$promise$utils$$_isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n } else {\n lib$es6$promise$utils$$_isArray = Array.isArray;\n }\n\n var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;\n var lib$es6$promise$asap$$len = 0;\n var lib$es6$promise$asap$$toString = {}.toString;\n var lib$es6$promise$asap$$vertxNext;\n var lib$es6$promise$asap$$customSchedulerFn;\n\n var lib$es6$promise$asap$$asap = function asap(callback, arg) {\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;\n lib$es6$promise$asap$$len += 2;\n if (lib$es6$promise$asap$$len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (lib$es6$promise$asap$$customSchedulerFn) {\n lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);\n } else {\n lib$es6$promise$asap$$scheduleFlush();\n }\n }\n }\n\n function lib$es6$promise$asap$$setScheduler(scheduleFn) {\n lib$es6$promise$asap$$customSchedulerFn = scheduleFn;\n }\n\n function lib$es6$promise$asap$$setAsap(asapFn) {\n lib$es6$promise$asap$$asap = asapFn;\n }\n\n var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined;\n var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};\n var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;\n var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n // test for web worker but not in IE10\n var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&\n typeof importScripts !== 'undefined' &&\n typeof MessageChannel !== 'undefined';\n\n // node\n function lib$es6$promise$asap$$useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function() {\n process.nextTick(lib$es6$promise$asap$$flush);\n };\n }\n\n // vertx\n function lib$es6$promise$asap$$useVertxTimer() {\n return function() {\n lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);\n };\n }\n\n function lib$es6$promise$asap$$useMutationObserver() {\n var iterations = 0;\n var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function() {\n node.data = (iterations = ++iterations % 2);\n };\n }\n\n // web worker\n function lib$es6$promise$asap$$useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = lib$es6$promise$asap$$flush;\n return function () {\n channel.port2.postMessage(0);\n };\n }\n\n function lib$es6$promise$asap$$useSetTimeout() {\n return function() {\n setTimeout(lib$es6$promise$asap$$flush, 1);\n };\n }\n\n var lib$es6$promise$asap$$queue = new Array(1000);\n function lib$es6$promise$asap$$flush() {\n for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) {\n var callback = lib$es6$promise$asap$$queue[i];\n var arg = lib$es6$promise$asap$$queue[i+1];\n\n callback(arg);\n\n lib$es6$promise$asap$$queue[i] = undefined;\n lib$es6$promise$asap$$queue[i+1] = undefined;\n }\n\n lib$es6$promise$asap$$len = 0;\n }\n\n function lib$es6$promise$asap$$attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return lib$es6$promise$asap$$useVertxTimer();\n } catch(e) {\n return lib$es6$promise$asap$$useSetTimeout();\n }\n }\n\n var lib$es6$promise$asap$$scheduleFlush;\n // Decide what async method to use to triggering processing of queued callbacks:\n if (lib$es6$promise$asap$$isNode) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();\n } else if (lib$es6$promise$asap$$BrowserMutationObserver) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();\n } else if (lib$es6$promise$asap$$isWorker) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();\n } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();\n } else {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();\n }\n\n function lib$es6$promise$$internal$$noop() {}\n\n var lib$es6$promise$$internal$$PENDING = void 0;\n var lib$es6$promise$$internal$$FULFILLED = 1;\n var lib$es6$promise$$internal$$REJECTED = 2;\n\n var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n }\n\n function lib$es6$promise$$internal$$cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n }\n\n function lib$es6$promise$$internal$$getThen(promise) {\n try {\n return promise.then;\n } catch(error) {\n lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;\n return lib$es6$promise$$internal$$GET_THEN_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch(e) {\n return e;\n }\n }\n\n function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {\n lib$es6$promise$asap$$asap(function(promise) {\n var sealed = false;\n var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) {\n if (sealed) { return; }\n sealed = true;\n if (thenable !== value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }, function(reason) {\n if (sealed) { return; }\n sealed = true;\n\n lib$es6$promise$$internal$$reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n lib$es6$promise$$internal$$reject(promise, error);\n }\n }, promise);\n }\n\n function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {\n if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, thenable._result);\n } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, thenable._result);\n } else {\n lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n }\n }\n\n function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {\n if (maybeThenable.constructor === promise.constructor) {\n lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);\n } else {\n var then = lib$es6$promise$$internal$$getThen(maybeThenable);\n\n if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);\n } else if (then === undefined) {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n } else if (lib$es6$promise$utils$$isFunction(then)) {\n lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n }\n }\n }\n\n function lib$es6$promise$$internal$$resolve(promise, value) {\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());\n } else if (lib$es6$promise$utils$$objectOrFunction(value)) {\n lib$es6$promise$$internal$$handleMaybeThenable(promise, value);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n lib$es6$promise$$internal$$publish(promise);\n }\n\n function lib$es6$promise$$internal$$fulfill(promise, value) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }\n\n promise._result = value;\n promise._state = lib$es6$promise$$internal$$FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);\n }\n }\n\n function lib$es6$promise$$internal$$reject(promise, reason) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }\n promise._state = lib$es6$promise$$internal$$REJECTED;\n promise._result = reason;\n\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);\n }\n\n function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n parent._onerror = null;\n\n subscribers[length] = child;\n subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;\n subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);\n }\n }\n\n function lib$es6$promise$$internal$$publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) { return; }\n\n var child, callback, detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function lib$es6$promise$$internal$$ErrorObject() {\n this.error = null;\n }\n\n var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch(e) {\n lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;\n return lib$es6$promise$$internal$$TRY_CATCH_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {\n var hasCallback = lib$es6$promise$utils$$isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n value = lib$es6$promise$$internal$$tryCatch(callback, detail);\n\n if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());\n return;\n }\n\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== lib$es6$promise$$internal$$PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else if (failed) {\n lib$es6$promise$$internal$$reject(promise, error);\n } else if (settled === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, value);\n } else if (settled === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value){\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function rejectPromise(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n } catch(e) {\n lib$es6$promise$$internal$$reject(promise, e);\n }\n }\n\n function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {\n var enumerator = this;\n\n enumerator._instanceConstructor = Constructor;\n enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop);\n\n if (enumerator._validateInput(input)) {\n enumerator._input = input;\n enumerator.length = input.length;\n enumerator._remaining = input.length;\n\n enumerator._init();\n\n if (enumerator.length === 0) {\n lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);\n } else {\n enumerator.length = enumerator.length || 0;\n enumerator._enumerate();\n if (enumerator._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);\n }\n }\n } else {\n lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());\n }\n }\n\n lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) {\n return lib$es6$promise$utils$$isArray(input);\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() {\n return new Error('Array Methods must be provided an Array');\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._init = function() {\n this._result = new Array(this.length);\n };\n\n var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;\n\n lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() {\n var enumerator = this;\n\n var length = enumerator.length;\n var promise = enumerator.promise;\n var input = enumerator._input;\n\n for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {\n enumerator._eachEntry(input[i], i);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {\n var enumerator = this;\n var c = enumerator._instanceConstructor;\n\n if (lib$es6$promise$utils$$isMaybeThenable(entry)) {\n if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) {\n entry._onerror = null;\n enumerator._settledAt(entry._state, i, entry._result);\n } else {\n enumerator._willSettleAt(c.resolve(entry), i);\n }\n } else {\n enumerator._remaining--;\n enumerator._result[i] = entry;\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {\n var enumerator = this;\n var promise = enumerator.promise;\n\n if (promise._state === lib$es6$promise$$internal$$PENDING) {\n enumerator._remaining--;\n\n if (state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n } else {\n enumerator._result[i] = value;\n }\n }\n\n if (enumerator._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(promise, enumerator._result);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {\n var enumerator = this;\n\n lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) {\n enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);\n }, function(reason) {\n enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);\n });\n };\n function lib$es6$promise$promise$all$$all(entries) {\n return new lib$es6$promise$enumerator$$default(this, entries).promise;\n }\n var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;\n function lib$es6$promise$promise$race$$race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n\n if (!lib$es6$promise$utils$$isArray(entries)) {\n lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));\n return promise;\n }\n\n var length = entries.length;\n\n function onFulfillment(value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }\n\n function onRejection(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n }\n\n for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {\n lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);\n }\n\n return promise;\n }\n var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;\n function lib$es6$promise$promise$resolve$$resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$resolve(promise, object);\n return promise;\n }\n var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;\n function lib$es6$promise$promise$reject$$reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$reject(promise, reason);\n return promise;\n }\n var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;\n\n var lib$es6$promise$promise$$counter = 0;\n\n function lib$es6$promise$promise$$needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n function lib$es6$promise$promise$$needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n */\n function lib$es6$promise$promise$$Promise(resolver) {\n this._id = lib$es6$promise$promise$$counter++;\n this._state = undefined;\n this._result = undefined;\n this._subscribers = [];\n\n if (lib$es6$promise$$internal$$noop !== resolver) {\n if (!lib$es6$promise$utils$$isFunction(resolver)) {\n lib$es6$promise$promise$$needsResolver();\n }\n\n if (!(this instanceof lib$es6$promise$promise$$Promise)) {\n lib$es6$promise$promise$$needsNew();\n }\n\n lib$es6$promise$$internal$$initializePromise(this, resolver);\n }\n }\n\n lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;\n lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;\n lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;\n lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;\n lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;\n lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;\n lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;\n\n lib$es6$promise$promise$$Promise.prototype = {\n constructor: lib$es6$promise$promise$$Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n\n Chaining\n --------\n\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n\n Assimilation\n ------------\n\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n\n If the assimliated promise rejects, then the downstream promise will also reject.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n\n Simple Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var result;\n\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n\n Advanced Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var author, books;\n\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n\n function foundBooks(books) {\n\n }\n\n function failure(reason) {\n\n }\n\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: function(onFulfillment, onRejection) {\n var parent = this;\n var state = parent._state;\n\n if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) {\n return this;\n }\n\n var child = new this.constructor(lib$es6$promise$$internal$$noop);\n var result = parent._result;\n\n if (state) {\n var callback = arguments[state - 1];\n lib$es6$promise$asap$$asap(function(){\n lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);\n });\n } else {\n lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n },\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function(onRejection) {\n return this.then(null, onRejection);\n }\n };\n function lib$es6$promise$polyfill$$polyfill() {\n var local;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {\n return;\n }\n\n local.Promise = lib$es6$promise$promise$$default;\n }\n var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;\n\n var lib$es6$promise$umd$$ES6Promise = {\n 'Promise': lib$es6$promise$promise$$default,\n 'polyfill': lib$es6$promise$polyfill$$default\n };\n\n /* global define:true module:true window: true */\n if (typeof define === 'function' && define['amd']) {\n define(function() { return lib$es6$promise$umd$$ES6Promise; });\n } else if (typeof module !== 'undefined' && module['exports']) {\n module['exports'] = lib$es6$promise$umd$$ES6Promise;\n } else if (typeof this !== 'undefined') {\n this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;\n }\n\n lib$es6$promise$polyfill$$default();\n}).call(this);\n\n\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"_process\":386}],385:[function(require,module,exports){\n/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Javascript ZLib\n// By Thomas Down 2010-2011\n//\n// Based very heavily on portions of jzlib (by [email protected]), who in\n// turn credits Jean-loup Gailly and Mark Adler for the original zlib code.\n//\n// inflate.js: ZLib inflate code\n//\n\n//\n// Shared constants\n//\n\nvar MAX_WBITS=15; // 32K LZ77 window\nvar DEF_WBITS=MAX_WBITS;\nvar MAX_MEM_LEVEL=9;\nvar MANY=1440;\nvar BMAX = 15;\n\n// preset dictionary flag in zlib header\nvar PRESET_DICT=0x20;\n\nvar Z_NO_FLUSH=0;\nvar Z_PARTIAL_FLUSH=1;\nvar Z_SYNC_FLUSH=2;\nvar Z_FULL_FLUSH=3;\nvar Z_FINISH=4;\n\nvar Z_DEFLATED=8;\n\nvar Z_OK=0;\nvar Z_STREAM_END=1;\nvar Z_NEED_DICT=2;\nvar Z_ERRNO=-1;\nvar Z_STREAM_ERROR=-2;\nvar Z_DATA_ERROR=-3;\nvar Z_MEM_ERROR=-4;\nvar Z_BUF_ERROR=-5;\nvar Z_VERSION_ERROR=-6;\n\nvar METHOD=0; // waiting for method byte\nvar FLAG=1; // waiting for flag byte\nvar DICT4=2; // four dictionary check bytes to go\nvar DICT3=3; // three dictionary check bytes to go\nvar DICT2=4; // two dictionary check bytes to go\nvar DICT1=5; // one dictionary check byte to go\nvar DICT0=6; // waiting for inflateSetDictionary\nvar BLOCKS=7; // decompressing blocks\nvar CHECK4=8; // four check bytes to go\nvar CHECK3=9; // three check bytes to go\nvar CHECK2=10; // two check bytes to go\nvar CHECK1=11; // one check byte to go\nvar DONE=12; // finished check, done\nvar BAD=13; // got an error--stay here\n\nvar inflate_mask = [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff];\n\nvar IB_TYPE=0; // get type bits (3, including end bit)\nvar IB_LENS=1; // get lengths for stored\nvar IB_STORED=2;// processing stored block\nvar IB_TABLE=3; // get table lengths\nvar IB_BTREE=4; // get bit lengths tree for a dynamic block\nvar IB_DTREE=5; // get length, distance trees for a dynamic block\nvar IB_CODES=6; // processing fixed or dynamic block\nvar IB_DRY=7; // output remaining window bytes\nvar IB_DONE=8; // finished last block, done\nvar IB_BAD=9; // ot a data error--stuck here\n\nvar fixed_bl = 9;\nvar fixed_bd = 5;\n\nvar fixed_tl = [\n 96,7,256, 0,8,80, 0,8,16, 84,8,115,\n 82,7,31, 0,8,112, 0,8,48, 0,9,192,\n 80,7,10, 0,8,96, 0,8,32, 0,9,160,\n 0,8,0, 0,8,128, 0,8,64, 0,9,224,\n 80,7,6, 0,8,88, 0,8,24, 0,9,144,\n 83,7,59, 0,8,120, 0,8,56, 0,9,208,\n 81,7,17, 0,8,104, 0,8,40, 0,9,176,\n 0,8,8, 0,8,136, 0,8,72, 0,9,240,\n 80,7,4, 0,8,84, 0,8,20, 85,8,227,\n 83,7,43, 0,8,116, 0,8,52, 0,9,200,\n 81,7,13, 0,8,100, 0,8,36, 0,9,168,\n 0,8,4, 0,8,132, 0,8,68, 0,9,232,\n 80,7,8, 0,8,92, 0,8,28, 0,9,152,\n 84,7,83, 0,8,124, 0,8,60, 0,9,216,\n 82,7,23, 0,8,108, 0,8,44, 0,9,184,\n 0,8,12, 0,8,140, 0,8,76, 0,9,248,\n 80,7,3, 0,8,82, 0,8,18, 85,8,163,\n 83,7,35, 0,8,114, 0,8,50, 0,9,196,\n 81,7,11, 0,8,98, 0,8,34, 0,9,164,\n 0,8,2, 0,8,130, 0,8,66, 0,9,228,\n 80,7,7, 0,8,90, 0,8,26, 0,9,148,\n 84,7,67, 0,8,122, 0,8,58, 0,9,212,\n 82,7,19, 0,8,106, 0,8,42, 0,9,180,\n 0,8,10, 0,8,138, 0,8,74, 0,9,244,\n 80,7,5, 0,8,86, 0,8,22, 192,8,0,\n 83,7,51, 0,8,118, 0,8,54, 0,9,204,\n 81,7,15, 0,8,102, 0,8,38, 0,9,172,\n 0,8,6, 0,8,134, 0,8,70, 0,9,236,\n 80,7,9, 0,8,94, 0,8,30, 0,9,156,\n 84,7,99, 0,8,126, 0,8,62, 0,9,220,\n 82,7,27, 0,8,110, 0,8,46, 0,9,188,\n 0,8,14, 0,8,142, 0,8,78, 0,9,252,\n 96,7,256, 0,8,81, 0,8,17, 85,8,131,\n 82,7,31, 0,8,113, 0,8,49, 0,9,194,\n 80,7,10, 0,8,97, 0,8,33, 0,9,162,\n 0,8,1, 0,8,129, 0,8,65, 0,9,226,\n 80,7,6, 0,8,89, 0,8,25, 0,9,146,\n 83,7,59, 0,8,121, 0,8,57, 0,9,210,\n 81,7,17, 0,8,105, 0,8,41, 0,9,178,\n 0,8,9, 0,8,137, 0,8,73, 0,9,242,\n 80,7,4, 0,8,85, 0,8,21, 80,8,258,\n 83,7,43, 0,8,117, 0,8,53, 0,9,202,\n 81,7,13, 0,8,101, 0,8,37, 0,9,170,\n 0,8,5, 0,8,133, 0,8,69, 0,9,234,\n 80,7,8, 0,8,93, 0,8,29, 0,9,154,\n 84,7,83, 0,8,125, 0,8,61, 0,9,218,\n 82,7,23, 0,8,109, 0,8,45, 0,9,186,\n 0,8,13, 0,8,141, 0,8,77, 0,9,250,\n 80,7,3, 0,8,83, 0,8,19, 85,8,195,\n 83,7,35, 0,8,115, 0,8,51, 0,9,198,\n 81,7,11, 0,8,99, 0,8,35, 0,9,166,\n 0,8,3, 0,8,131, 0,8,67, 0,9,230,\n 80,7,7, 0,8,91, 0,8,27, 0,9,150,\n 84,7,67, 0,8,123, 0,8,59, 0,9,214,\n 82,7,19, 0,8,107, 0,8,43, 0,9,182,\n 0,8,11, 0,8,139, 0,8,75, 0,9,246,\n 80,7,5, 0,8,87, 0,8,23, 192,8,0,\n 83,7,51, 0,8,119, 0,8,55, 0,9,206,\n 81,7,15, 0,8,103, 0,8,39, 0,9,174,\n 0,8,7, 0,8,135, 0,8,71, 0,9,238,\n 80,7,9, 0,8,95, 0,8,31, 0,9,158,\n 84,7,99, 0,8,127, 0,8,63, 0,9,222,\n 82,7,27, 0,8,111, 0,8,47, 0,9,190,\n 0,8,15, 0,8,143, 0,8,79, 0,9,254,\n 96,7,256, 0,8,80, 0,8,16, 84,8,115,\n 82,7,31, 0,8,112, 0,8,48, 0,9,193,\n\n 80,7,10, 0,8,96, 0,8,32, 0,9,161,\n 0,8,0, 0,8,128, 0,8,64, 0,9,225,\n 80,7,6, 0,8,88, 0,8,24, 0,9,145,\n 83,7,59, 0,8,120, 0,8,56, 0,9,209,\n 81,7,17, 0,8,104, 0,8,40, 0,9,177,\n 0,8,8, 0,8,136, 0,8,72, 0,9,241,\n 80,7,4, 0,8,84, 0,8,20, 85,8,227,\n 83,7,43, 0,8,116, 0,8,52, 0,9,201,\n 81,7,13, 0,8,100, 0,8,36, 0,9,169,\n 0,8,4, 0,8,132, 0,8,68, 0,9,233,\n 80,7,8, 0,8,92, 0,8,28, 0,9,153,\n 84,7,83, 0,8,124, 0,8,60, 0,9,217,\n 82,7,23, 0,8,108, 0,8,44, 0,9,185,\n 0,8,12, 0,8,140, 0,8,76, 0,9,249,\n 80,7,3, 0,8,82, 0,8,18, 85,8,163,\n 83,7,35, 0,8,114, 0,8,50, 0,9,197,\n 81,7,11, 0,8,98, 0,8,34, 0,9,165,\n 0,8,2, 0,8,130, 0,8,66, 0,9,229,\n 80,7,7, 0,8,90, 0,8,26, 0,9,149,\n 84,7,67, 0,8,122, 0,8,58, 0,9,213,\n 82,7,19, 0,8,106, 0,8,42, 0,9,181,\n 0,8,10, 0,8,138, 0,8,74, 0,9,245,\n 80,7,5, 0,8,86, 0,8,22, 192,8,0,\n 83,7,51, 0,8,118, 0,8,54, 0,9,205,\n 81,7,15, 0,8,102, 0,8,38, 0,9,173,\n 0,8,6, 0,8,134, 0,8,70, 0,9,237,\n 80,7,9, 0,8,94, 0,8,30, 0,9,157,\n 84,7,99, 0,8,126, 0,8,62, 0,9,221,\n 82,7,27, 0,8,110, 0,8,46, 0,9,189,\n 0,8,14, 0,8,142, 0,8,78, 0,9,253,\n 96,7,256, 0,8,81, 0,8,17, 85,8,131,\n 82,7,31, 0,8,113, 0,8,49, 0,9,195,\n 80,7,10, 0,8,97, 0,8,33, 0,9,163,\n 0,8,1, 0,8,129, 0,8,65, 0,9,227,\n 80,7,6, 0,8,89, 0,8,25, 0,9,147,\n 83,7,59, 0,8,121, 0,8,57, 0,9,211,\n 81,7,17, 0,8,105, 0,8,41, 0,9,179,\n 0,8,9, 0,8,137, 0,8,73, 0,9,243,\n 80,7,4, 0,8,85, 0,8,21, 80,8,258,\n 83,7,43, 0,8,117, 0,8,53, 0,9,203,\n 81,7,13, 0,8,101, 0,8,37, 0,9,171,\n 0,8,5, 0,8,133, 0,8,69, 0,9,235,\n 80,7,8, 0,8,93, 0,8,29, 0,9,155,\n 84,7,83, 0,8,125, 0,8,61, 0,9,219,\n 82,7,23, 0,8,109, 0,8,45, 0,9,187,\n 0,8,13, 0,8,141, 0,8,77, 0,9,251,\n 80,7,3, 0,8,83, 0,8,19, 85,8,195,\n 83,7,35, 0,8,115, 0,8,51, 0,9,199,\n 81,7,11, 0,8,99, 0,8,35, 0,9,167,\n 0,8,3, 0,8,131, 0,8,67, 0,9,231,\n 80,7,7, 0,8,91, 0,8,27, 0,9,151,\n 84,7,67, 0,8,123, 0,8,59, 0,9,215,\n 82,7,19, 0,8,107, 0,8,43, 0,9,183,\n 0,8,11, 0,8,139, 0,8,75, 0,9,247,\n 80,7,5, 0,8,87, 0,8,23, 192,8,0,\n 83,7,51, 0,8,119, 0,8,55, 0,9,207,\n 81,7,15, 0,8,103, 0,8,39, 0,9,175,\n 0,8,7, 0,8,135, 0,8,71, 0,9,239,\n 80,7,9, 0,8,95, 0,8,31, 0,9,159,\n 84,7,99, 0,8,127, 0,8,63, 0,9,223,\n 82,7,27, 0,8,111, 0,8,47, 0,9,191,\n 0,8,15, 0,8,143, 0,8,79, 0,9,255\n];\nvar fixed_td = [\n 80,5,1, 87,5,257, 83,5,17, 91,5,4097,\n 81,5,5, 89,5,1025, 85,5,65, 93,5,16385,\n 80,5,3, 88,5,513, 84,5,33, 92,5,8193,\n 82,5,9, 90,5,2049, 86,5,129, 192,5,24577,\n 80,5,2, 87,5,385, 83,5,25, 91,5,6145,\n 81,5,7, 89,5,1537, 85,5,97, 93,5,24577,\n 80,5,4, 88,5,769, 84,5,49, 92,5,12289,\n 82,5,13, 90,5,3073, 86,5,193, 192,5,24577\n];\n\n // Tables for deflate from PKZIP's appnote.txt.\n var cplens = [ // Copy lengths for literal codes 257..285\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n ];\n\n // see note #13 above about 258\n var cplext = [ // Extra bits for literal codes 257..285\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,\n 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid\n ];\n\n var cpdist = [ // Copy offsets for distance codes 0..29\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577\n ];\n\n var cpdext = [ // Extra bits for distance codes\n 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,\n 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,\n 12, 12, 13, 13];\n\n//\n// ZStream.java\n//\n\nfunction ZStream() {\n}\n\n\nZStream.prototype.inflateInit = function(w, nowrap) {\n if (!w) {\n\tw = DEF_WBITS;\n }\n if (nowrap) {\n\tnowrap = false;\n }\n this.istate = new Inflate();\n return this.istate.inflateInit(this, nowrap?-w:w);\n}\n\nZStream.prototype.inflate = function(f) {\n if(this.istate==null) return Z_STREAM_ERROR;\n return this.istate.inflate(this, f);\n}\n\nZStream.prototype.inflateEnd = function(){\n if(this.istate==null) return Z_STREAM_ERROR;\n var ret=istate.inflateEnd(this);\n this.istate = null;\n return ret;\n}\nZStream.prototype.inflateSync = function(){\n // if(istate == null) return Z_STREAM_ERROR;\n return istate.inflateSync(this);\n}\nZStream.prototype.inflateSetDictionary = function(dictionary, dictLength){\n // if(istate == null) return Z_STREAM_ERROR;\n return istate.inflateSetDictionary(this, dictionary, dictLength);\n}\n\n/*\n\n public int deflateInit(int level){\n return deflateInit(level, MAX_WBITS);\n }\n public int deflateInit(int level, boolean nowrap){\n return deflateInit(level, MAX_WBITS, nowrap);\n }\n public int deflateInit(int level, int bits){\n return deflateInit(level, bits, false);\n }\n public int deflateInit(int level, int bits, boolean nowrap){\n dstate=new Deflate();\n return dstate.deflateInit(this, level, nowrap?-bits:bits);\n }\n public int deflate(int flush){\n if(dstate==null){\n return Z_STREAM_ERROR;\n }\n return dstate.deflate(this, flush);\n }\n public int deflateEnd(){\n if(dstate==null) return Z_STREAM_ERROR;\n int ret=dstate.deflateEnd();\n dstate=null;\n return ret;\n }\n public int deflateParams(int level, int strategy){\n if(dstate==null) return Z_STREAM_ERROR;\n return dstate.deflateParams(this, level, strategy);\n }\n public int deflateSetDictionary (byte[] dictionary, int dictLength){\n if(dstate == null)\n return Z_STREAM_ERROR;\n return dstate.deflateSetDictionary(this, dictionary, dictLength);\n }\n\n*/\n\n/*\n // Flush as much pending output as possible. All deflate() output goes\n // through this function so some applications may wish to modify it\n // to avoid allocating a large strm->next_out buffer and copying into it.\n // (See also read_buf()).\n void flush_pending(){\n int len=dstate.pending;\n\n if(len>avail_out) len=avail_out;\n if(len==0) return;\n\n if(dstate.pending_buf.length<=dstate.pending_out ||\n next_out.length<=next_out_index ||\n dstate.pending_buf.length<(dstate.pending_out+len) ||\n next_out.length<(next_out_index+len)){\n System.out.println(dstate.pending_buf.length+\", \"+dstate.pending_out+\n\t\t\t \", \"+next_out.length+\", \"+next_out_index+\", \"+len);\n System.out.println(\"avail_out=\"+avail_out);\n }\n\n System.arraycopy(dstate.pending_buf, dstate.pending_out,\n\t\t next_out, next_out_index, len);\n\n next_out_index+=len;\n dstate.pending_out+=len;\n total_out+=len;\n avail_out-=len;\n dstate.pending-=len;\n if(dstate.pending==0){\n dstate.pending_out=0;\n }\n }\n\n // Read a new buffer from the current input stream, update the adler32\n // and total number of bytes read. All deflate() input goes through\n // this function so some applications may wish to modify it to avoid\n // allocating a large strm->next_in buffer and copying from it.\n // (See also flush_pending()).\n int read_buf(byte[] buf, int start, int size) {\n int len=avail_in;\n\n if(len>size) len=size;\n if(len==0) return 0;\n\n avail_in-=len;\n\n if(dstate.noheader==0) {\n adler=_adler.adler32(adler, next_in, next_in_index, len);\n }\n System.arraycopy(next_in, next_in_index, buf, start, len);\n next_in_index += len;\n total_in += len;\n return len;\n }\n\n public void free(){\n next_in=null;\n next_out=null;\n msg=null;\n _adler=null;\n }\n}\n*/\n\n\n//\n// Inflate.java\n//\n\nfunction Inflate() {\n this.was = [0];\n}\n\nInflate.prototype.inflateReset = function(z) {\n if(z == null || z.istate == null) return Z_STREAM_ERROR;\n \n z.total_in = z.total_out = 0;\n z.msg = null;\n z.istate.mode = z.istate.nowrap!=0 ? BLOCKS : METHOD;\n z.istate.blocks.reset(z, null);\n return Z_OK;\n}\n\nInflate.prototype.inflateEnd = function(z){\n if(this.blocks != null)\n this.blocks.free(z);\n this.blocks=null;\n return Z_OK;\n}\n\nInflate.prototype.inflateInit = function(z, w){\n z.msg = null;\n this.blocks = null;\n\n // handle undocumented nowrap option (no zlib header or check)\n nowrap = 0;\n if(w < 0){\n w = - w;\n nowrap = 1;\n }\n\n // set window size\n if(w<8 ||w>15){\n this.inflateEnd(z);\n return Z_STREAM_ERROR;\n }\n this.wbits=w;\n\n z.istate.blocks=new InfBlocks(z, \n\t\t\t\t z.istate.nowrap!=0 ? null : this,\n\t\t\t\t 1<>4)+8>z.istate.wbits){\n z.istate.mode = BAD;\n z.msg=\"invalid window size\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n z.istate.mode=FLAG;\n case FLAG:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n b = (z.next_in[z.next_in_index++])&0xff;\n\n if((((z.istate.method << 8)+b) % 31)!=0){\n z.istate.mode = BAD;\n z.msg = \"incorrect header check\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n\n if((b&PRESET_DICT)==0){\n z.istate.mode = BLOCKS;\n break;\n }\n z.istate.mode = DICT4;\n case DICT4:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000;\n z.istate.mode=DICT3;\n case DICT3:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000;\n z.istate.mode=DICT2;\n case DICT2:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00;\n z.istate.mode=DICT1;\n case DICT1:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need += (z.next_in[z.next_in_index++]&0xff);\n z.adler = z.istate.need;\n z.istate.mode = DICT0;\n return Z_NEED_DICT;\n case DICT0:\n z.istate.mode = BAD;\n z.msg = \"need dictionary\";\n z.istate.marker = 0; // can try inflateSync\n return Z_STREAM_ERROR;\n case BLOCKS:\n\n r = z.istate.blocks.proc(z, r);\n if(r == Z_DATA_ERROR){\n z.istate.mode = BAD;\n z.istate.marker = 0; // can try inflateSync\n break;\n }\n if(r == Z_OK){\n r = f;\n }\n if(r != Z_STREAM_END){\n return r;\n }\n r = f;\n z.istate.blocks.reset(z, z.istate.was);\n if(z.istate.nowrap!=0){\n z.istate.mode=DONE;\n break;\n }\n z.istate.mode=CHECK4;\n case CHECK4:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000;\n z.istate.mode=CHECK3;\n case CHECK3:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000;\n z.istate.mode = CHECK2;\n case CHECK2:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00;\n z.istate.mode = CHECK1;\n case CHECK1:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=(z.next_in[z.next_in_index++]&0xff);\n\n if(((z.istate.was[0])) != ((z.istate.need))){\n z.istate.mode = BAD;\n z.msg = \"incorrect data check\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n\n z.istate.mode = DONE;\n case DONE:\n return Z_STREAM_END;\n case BAD:\n return Z_DATA_ERROR;\n default:\n return Z_STREAM_ERROR;\n }\n }\n }\n\n\nInflate.prototype.inflateSetDictionary = function(z, dictionary, dictLength) {\n var index=0;\n var length = dictLength;\n if(z==null || z.istate == null|| z.istate.mode != DICT0)\n return Z_STREAM_ERROR;\n\n if(z._adler.adler32(1, dictionary, 0, dictLength)!=z.adler){\n return Z_DATA_ERROR;\n }\n\n z.adler = z._adler.adler32(0, null, 0, 0);\n\n if(length >= (1<>> 1){\n case 0: // stored \n {b>>>=(3);k-=(3);}\n t = k & 7; // go to byte boundary\n\n {b>>>=(t);k-=(t);}\n this.mode = IB_LENS; // get length of stored block\n break;\n case 1: // fixed\n {\n var bl=new Int32Array(1);\n\t var bd=new Int32Array(1);\n var tl=[];\n\t var td=[];\n\n\t inflate_trees_fixed(bl, bd, tl, td, z);\n this.codes.init(bl[0], bd[0], tl[0], 0, td[0], 0, z);\n }\n\n {b>>>=(3);k-=(3);}\n\n this.mode = IB_CODES;\n break;\n case 2: // dynamic\n\n {b>>>=(3);k-=(3);}\n\n this.mode = IB_TABLE;\n break;\n case 3: // illegal\n\n {b>>>=(3);k-=(3);}\n this.mode = BAD;\n z.msg = \"invalid block type\";\n r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\tbreak;\n case IB_LENS:\n\twhile(k<(32)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>> 16) & 0xffff) != (b & 0xffff)){\n\t this.mode = BAD;\n\t z.msg = \"invalid stored block lengths\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\tthis.left = (b & 0xffff);\n\tb = k = 0; // dump bits\n\tthis.mode = this.left!=0 ? IB_STORED : (this.last!=0 ? IB_DRY : IB_TYPE);\n\tbreak;\n case IB_STORED:\n\tif (n == 0){\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\n\tif(m==0){\n\t if(q==end&&read!=0){\n\t q=0; m=(qn) t = n;\n\tif(t>m) t = m;\n\tarrayCopy(z.next_in, p, this.window, q, t);\n\tp += t; n -= t;\n\tq += t; m -= t;\n\tif ((this.left -= t) != 0)\n\t break;\n\tthis.mode = (this.last != 0 ? IB_DRY : IB_TYPE);\n\tbreak;\n case IB_TABLE:\n\n\twhile(k<(14)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)< 29 || ((t >> 5) & 0x1f) > 29)\n\t {\n\t this.mode = IB_BAD;\n\t z.msg = \"too many length or distance symbols\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\tt = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n\tif(this.blens==null || this.blens.length>>=(14);k-=(14);}\n\n\tthis.index = 0;\n\tmode = IB_BTREE;\n case IB_BTREE:\n\twhile (this.index < 4 + (this.table >>> 10)){\n\t while(k<(3)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(3);k-=(3);}\n\t}\n\n\twhile(this.index < 19){\n\t this.blens[INFBLOCKS_BORDER[this.index++]] = 0;\n\t}\n\n\tthis.bb[0] = 7;\n\tt = this.inftree.inflate_trees_bits(this.blens, this.bb, this.tb, this.hufts, z);\n\tif (t != Z_OK){\n\t r = t;\n\t if (r == Z_DATA_ERROR){\n\t this.blens=null;\n\t this.mode = IB_BAD;\n\t }\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\n\tthis.index = 0;\n\tthis.mode = IB_DTREE;\n case IB_DTREE:\n\twhile (true){\n\t t = this.table;\n\t if(!(this.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))){\n\t break;\n\t }\n\n\t var h; //int[]\n\t var i, j, c;\n\n\t t = this.bb[0];\n\n\t while(k<(t)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t);\n\t this.blens[this.index++] = c;\n\t }\n\t else { // c == 16..18\n\t i = c == 18 ? 7 : c - 14;\n\t j = c == 18 ? 11 : 3;\n\n\t while(k<(t+i)){\n\t if(n!=0){\n\t\tr=Z_OK;\n\t }\n\t else{\n\t\tthis.bitb=b; this.bitk=k; \n\t\tz.avail_in=n;\n\t\tz.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t\tthis.write=q;\n\t\treturn this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t);\n\n\t j += (b & inflate_mask[i]);\n\n\t b>>>=(i);k-=(i);\n\n\t i = this.index;\n\t t = this.table;\n\t if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||\n\t\t(c == 16 && i < 1)){\n\t this.blens=null;\n\t this.mode = IB_BAD;\n\t z.msg = \"invalid bit length repeat\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\n\t c = c == 16 ? this.blens[i-1] : 0;\n\t do{\n\t this.blens[i++] = c;\n\t }\n\t while (--j!=0);\n\t this.index = i;\n\t }\n\t}\n\n\tthis.tb[0]=-1;\n\t{\n\t var bl=new Int32Array(1);\n\t var bd=new Int32Array(1);\n\t var tl=new Int32Array(1);\n\t var td=new Int32Array(1);\n\t bl[0] = 9; // must be <= 9 for lookahead assumptions\n\t bd[0] = 6; // must be <= 9 for lookahead assumptions\n\n\t t = this.table;\n\t t = this.inftree.inflate_trees_dynamic(257 + (t & 0x1f), \n\t\t\t\t\t 1 + ((t >> 5) & 0x1f),\n\t\t\t\t\t this.blens, bl, bd, tl, td, this.hufts, z);\n\n\t if (t != Z_OK){\n\t if (t == Z_DATA_ERROR){\n\t this.blens=null;\n\t this.mode = BAD;\n\t }\n\t r = t;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\t this.codes.init(bl[0], bd[0], this.hufts, tl[0], this.hufts, td[0], z);\n\t}\n\tthis.mode = IB_CODES;\n case IB_CODES:\n\tthis.bitb=b; this.bitk=k;\n\tz.avail_in=n; z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\n\tif ((r = this.codes.proc(this, z, r)) != Z_STREAM_END){\n\t return this.inflate_flush(z, r);\n\t}\n\tr = Z_OK;\n\tthis.codes.free(z);\n\n\tp=z.next_in_index; n=z.avail_in;b=this.bitb;k=this.bitk;\n\tq=this.write;m = (q < this.read ? this.read-q-1 : this.end-q);\n\n\tif (this.last==0){\n\t this.mode = IB_TYPE;\n\t break;\n\t}\n\tthis.mode = IB_DRY;\n case IB_DRY:\n\tthis.write=q; \n\tr = this.inflate_flush(z, r); \n\tq=this.write; m = (q < this.read ? this.read-q-1 : this.end-q);\n\tif (this.read != this.write){\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z, r);\n\t}\n\tmode = DONE;\n case IB_DONE:\n\tr = Z_STREAM_END;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n case IB_BAD:\n\tr = Z_DATA_ERROR;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n\n default:\n\tr = Z_STREAM_ERROR;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n }\n }\n }\n\nInfBlocks.prototype.free = function(z){\n this.reset(z, null);\n this.window=null;\n this.hufts=null;\n}\n\nInfBlocks.prototype.set_dictionary = function(d, start, n){\n arrayCopy(d, start, window, 0, n);\n this.read = this.write = n;\n}\n\n // Returns true if inflate is currently at the end of a block generated\n // by Z_SYNC_FLUSH or Z_FULL_FLUSH. \nInfBlocks.prototype.sync_point = function(){\n return this.mode == IB_LENS;\n}\n\n // copy as much as possible from the sliding window to the output area\nInfBlocks.prototype.inflate_flush = function(z, r){\n var n;\n var p;\n var q;\n\n // local copies of source and destination pointers\n p = z.next_out_index;\n q = this.read;\n\n // compute number of bytes to copy as far as end of window\n n = ((q <= this.write ? this.write : this.end) - q);\n if (n > z.avail_out) n = z.avail_out;\n if (n!=0 && r == Z_BUF_ERROR) r = Z_OK;\n\n // update counters\n z.avail_out -= n;\n z.total_out += n;\n\n // update check information\n if(this.checkfn != null)\n z.adler=this.check=z._adler.adler32(this.check, this.window, q, n);\n\n // copy as far as end of window\n arrayCopy(this.window, q, z.next_out, p, n);\n p += n;\n q += n;\n\n // see if more to copy at beginning of window\n if (q == this.end){\n // wrap pointers\n q = 0;\n if (this.write == this.end)\n this.write = 0;\n\n // compute bytes to copy\n n = this.write - q;\n if (n > z.avail_out) n = z.avail_out;\n if (n!=0 && r == Z_BUF_ERROR) r = Z_OK;\n\n // update counters\n z.avail_out -= n;\n z.total_out += n;\n\n // update check information\n if(this.checkfn != null)\n\tz.adler=this.check=z._adler.adler32(this.check, this.window, q, n);\n\n // copy\n arrayCopy(this.window, q, z.next_out, p, n);\n p += n;\n q += n;\n }\n\n // update pointers\n z.next_out_index = p;\n this.read = q;\n\n // done\n return r;\n }\n\n//\n// InfCodes.java\n//\n\nvar IC_START=0; // x: set up for LEN\nvar IC_LEN=1; // i: get length/literal/eob next\nvar IC_LENEXT=2; // i: getting length extra (have base)\nvar IC_DIST=3; // i: get distance next\nvar IC_DISTEXT=4;// i: getting distance extra\nvar IC_COPY=5; // o: copying bytes in window, waiting for space\nvar IC_LIT=6; // o: got literal, waiting for output space\nvar IC_WASH=7; // o: got eob, possibly still output waiting\nvar IC_END=8; // x: got eob and all data flushed\nvar IC_BADCODE=9;// x: got error\n\nfunction InfCodes() {\n}\n\nInfCodes.prototype.init = function(bl, bd, tl, tl_index, td, td_index, z) {\n this.mode=IC_START;\n this.lbits=bl;\n this.dbits=bd;\n this.ltree=tl;\n this.ltree_index=tl_index;\n this.dtree = td;\n this.dtree_index=td_index;\n this.tree=null;\n}\n\nInfCodes.prototype.proc = function(s, z, r){ \n var j; // temporary storage\n var t; // temporary pointer (int[])\n var tindex; // temporary pointer\n var e; // extra bits or operation\n var b=0; // bit buffer\n var k=0; // bits in bit buffer\n var p=0; // input data pointer\n var n; // bytes available there\n var q; // output window write pointer\n var m; // bytes to end of window or read pointer\n var f; // pointer to copy strings from\n\n // copy input/output information to locals (UPDATE macro restores)\n p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk;\n q=s.write;m=q= 258 && n >= 10){\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t r = this.inflate_fast(this.lbits, this.dbits, \n\t\t\t this.ltree, this.ltree_index, \n\t\t\t this.dtree, this.dtree_index,\n\t\t\t s, z);\n\n\t p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk;\n\t q=s.write;m=q>>=(this.tree[tindex+1]);\n\tk-=(this.tree[tindex+1]);\n\n\te=this.tree[tindex];\n\n\tif(e == 0){ // literal\n\t this.lit = this.tree[tindex+2];\n\t this.mode = IC_LIT;\n\t break;\n\t}\n\tif((e & 16)!=0 ){ // length\n\t this.get = e & 15;\n\t this.len = this.tree[tindex+2];\n\t this.mode = IC_LENEXT;\n\t break;\n\t}\n\tif ((e & 64) == 0){ // next table\n\t this.need = e;\n\t this.tree_index = tindex/3 + this.tree[tindex+2];\n\t break;\n\t}\n\tif ((e & 32)!=0){ // end of block\n\t this.mode = IC_WASH;\n\t break;\n\t}\n\tthis.mode = IC_BADCODE; // invalid code\n\tz.msg = \"invalid literal/length code\";\n\tr = Z_DATA_ERROR;\n\n\ts.bitb=b;s.bitk=k;\n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\ts.write=q;\n\treturn s.inflate_flush(z,r);\n\n case IC_LENEXT: // i: getting length extra (have base)\n\tj = this.get;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=j;\n\tk-=j;\n\n\tthis.need = this.dbits;\n\tthis.tree = this.dtree;\n\tthis.tree_index = this.dtree_index;\n\tthis.mode = IC_DIST;\n case IC_DIST: // i: get distance next\n\tj = this.need;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=this.tree[tindex+1];\n\tk-=this.tree[tindex+1];\n\n\te = (this.tree[tindex]);\n\tif((e & 16)!=0){ // distance\n\t this.get = e & 15;\n\t this.dist = this.tree[tindex+2];\n\t this.mode = IC_DISTEXT;\n\t break;\n\t}\n\tif ((e & 64) == 0){ // next table\n\t this.need = e;\n\t this.tree_index = tindex/3 + this.tree[tindex+2];\n\t break;\n\t}\n\tthis.mode = IC_BADCODE; // invalid code\n\tz.msg = \"invalid distance code\";\n\tr = Z_DATA_ERROR;\n\n\ts.bitb=b;s.bitk=k;\n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\ts.write=q;\n\treturn s.inflate_flush(z,r);\n\n case IC_DISTEXT: // i: getting distance extra\n\tj = this.get;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=j;\n\tk-=j;\n\n\tthis.mode = IC_COPY;\n case IC_COPY: // o: copying bytes in window, waiting for space\n f = q - this.dist;\n while(f < 0){ // modulo window size-\"while\" instead\n f += s.end; // of \"if\" handles invalid distances\n\t}\n\twhile (this.len!=0){\n\n\t if(m==0){\n\t if(q==s.end&&s.read!=0){q=0;m=q 7){ // return unused byte, if any\n\t k -= 8;\n\t n++;\n\t p--; // can always return one\n\t}\n\n\ts.write=q; r=s.inflate_flush(z,r);\n\tq=s.write;m=q= 258 && n >= 10\n // get literal/length code\n while(k<(20)){ // max bits for literal/length code\n\tn--;\n\tb|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\ts.window[q++] = tp[tp_index_t_3+2];\n\tm--;\n\tcontinue;\n }\n do {\n\n\tb>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\tif((e&16)!=0){\n\t e &= 15;\n\t c = tp[tp_index_t_3+2] + (b & inflate_mask[e]);\n\n\t b>>=e; k-=e;\n\n\t // decode distance base of block to copy\n\t while(k<(15)){ // max bits for distance code\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\t if((e&16)!=0){\n\t // get extra bits to add to distance base\n\t e &= 15;\n\t while(k<(e)){ // get extra bits (up to 13)\n\t\tn--;\n\t\tb|=(z.next_in[p++]&0xff)<>=(e); k-=(e);\n\n\t // do the copy\n\t m -= c;\n\t if (q >= d){ // offset before dest\n\t\t// just copy\n\t\tr=q-d;\n\t\tif(q-r>0 && 2>(q-r)){ \n\t\t s.window[q++]=s.window[r++]; // minimum count is three,\n\t\t s.window[q++]=s.window[r++]; // so unroll loop a little\n\t\t c-=2;\n\t\t}\n\t\telse{\n\t\t s.window[q++]=s.window[r++]; // minimum count is three,\n\t\t s.window[q++]=s.window[r++]; // so unroll loop a little\n\t\t c-=2;\n\t\t}\n\t }\n\t else{ // else offset after destination\n r=q-d;\n do{\n r+=s.end; // force pointer in window\n }while(r<0); // covers invalid distances\n\t\te=s.end-r;\n\t\tif(c>e){ // if source crosses,\n\t\t c-=e; // wrapped copy\n\t\t if(q-r>0 && e>(q-r)){ \n\t\t do{s.window[q++] = s.window[r++];}\n\t\t while(--e!=0);\n\t\t }\n\t\t else{\n\t\t arrayCopy(s.window, r, s.window, q, e);\n\t\t q+=e; r+=e; e=0;\n\t\t }\n\t\t r = 0; // copy rest from start of window\n\t\t}\n\n\t }\n\n\t // copy all or what's left\n do{s.window[q++] = s.window[r++];}\n\t\twhile(--c!=0);\n\t break;\n\t }\n\t else if((e&64)==0){\n\t t+=tp[tp_index_t_3+2];\n\t t+=(b&inflate_mask[e]);\n\t tp_index_t_3=(tp_index+t)*3;\n\t e=tp[tp_index_t_3];\n\t }\n\t else{\n\t z.msg = \"invalid distance code\";\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_DATA_ERROR;\n\t }\n\t }\n\t while(true);\n\t break;\n\t}\n\n\tif((e&64)==0){\n\t t+=tp[tp_index_t_3+2];\n\t t+=(b&inflate_mask[e]);\n\t tp_index_t_3=(tp_index+t)*3;\n\t if((e=tp[tp_index_t_3])==0){\n\n\t b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\t s.window[q++]=tp[tp_index_t_3+2];\n\t m--;\n\t break;\n\t }\n\t}\n\telse if((e&32)!=0){\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n \n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_STREAM_END;\n\t}\n\telse{\n\t z.msg=\"invalid literal/length code\";\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_DATA_ERROR;\n\t}\n } \n while(true);\n } \n while(m>=258 && n>= 10);\n\n // not enough input or output--restore pointers and return\n c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n s.bitb=b;s.bitk=k;\n z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n s.write=q;\n\n return Z_OK;\n}\n\n//\n// InfTree.java\n//\n\nfunction InfTree() {\n}\n\nInfTree.prototype.huft_build = function(b, bindex, n, s, d, e, t, m, hp, hn, v) {\n\n // Given a list of code lengths and a maximum table size, make a set of\n // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR\n // if the given code set is incomplete (the tables are still built in this\n // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of\n // lengths), or Z_MEM_ERROR if not enough memory.\n\n var a; // counter for codes of length k\n var f; // i repeats in table every f entries\n var g; // maximum code length\n var h; // table level\n var i; // counter, current code\n var j; // counter\n var k; // number of bits in current code\n var l; // bits per table (returned in m)\n var mask; // (1 << w) - 1, to avoid cc -O bug on HP\n var p; // pointer into c[], b[], or v[]\n var q; // points to current table\n var w; // bits before this table == (l * h)\n var xp; // pointer into x\n var y; // number of dummy codes added\n var z; // number of entries in current table\n\n // Generate counts for each bit length\n\n p = 0; i = n;\n do {\n this.c[b[bindex+p]]++; p++; i--; // assume all entries <= BMAX\n }while(i!=0);\n\n if(this.c[0] == n){ // null input--all zero length codes\n t[0] = -1;\n m[0] = 0;\n return Z_OK;\n }\n\n // Find minimum and maximum length, bound *m by those\n l = m[0];\n for (j = 1; j <= BMAX; j++)\n if(this.c[j]!=0) break;\n k = j; // minimum code length\n if(l < j){\n l = j;\n }\n for (i = BMAX; i!=0; i--){\n if(this.c[i]!=0) break;\n }\n g = i; // maximum code length\n if(l > i){\n l = i;\n }\n m[0] = l;\n\n // Adjust last length count to fill out codes, if needed\n for (y = 1 << j; j < i; j++, y <<= 1){\n if ((y -= this.c[j]) < 0){\n return Z_DATA_ERROR;\n }\n }\n if ((y -= this.c[i]) < 0){\n return Z_DATA_ERROR;\n }\n this.c[i] += y;\n\n // Generate starting offsets into the value table for each length\n this.x[1] = j = 0;\n p = 1; xp = 2;\n while (--i!=0) { // note that i == g from above\n this.x[xp] = (j += this.c[p]);\n xp++;\n p++;\n }\n\n // Make a table of values in order of bit lengths\n i = 0; p = 0;\n do {\n if ((j = b[bindex+p]) != 0){\n this.v[this.x[j]++] = i;\n }\n p++;\n }\n while (++i < n);\n n = this.x[g]; // set n to length of v\n\n // Generate the Huffman codes and for each, make the table entries\n this.x[0] = i = 0; // first Huffman code is zero\n p = 0; // grab values in bit order\n h = -1; // no tables yet--level -1\n w = -l; // bits decoded == (l * h)\n this.u[0] = 0; // just to keep compilers happy\n q = 0; // ditto\n z = 0; // ditto\n\n // go through the bit lengths (k already is bits in shortest code)\n for (; k <= g; k++){\n a = this.c[k];\n while (a--!=0){\n\t// here i is the Huffman code of length k bits for value *p\n\t// make tables up to required level\n while (k > w + l){\n h++;\n w += l; // previous table always l bits\n\t // compute minimum size table less than or equal to l bits\n z = g - w;\n z = (z > l) ? l : z; // table size upper limit\n if((f=1<<(j=k-w))>a+1){ // try a k-w bit table\n // too few codes for k-w bit table\n f -= a + 1; // deduct codes from patterns left\n xp = k;\n if(j < z){\n while (++j < z){ // try smaller tables up to z bits\n if((f <<= 1) <= this.c[++xp])\n break; // enough codes to use up j bits\n f -= this.c[xp]; // else deduct codes from patterns\n }\n\t }\n }\n z = 1 << j; // table entries for j-bit table\n\n\t // allocate new table\n if (this.hn[0] + z > MANY){ // (note: doesn't matter for fixed)\n return Z_DATA_ERROR; // overflow of MANY\n }\n this.u[h] = q = /*hp+*/ this.hn[0]; // DEBUG\n this.hn[0] += z;\n \n\t // connect to last table, if there is one\n\t if(h!=0){\n this.x[h]=i; // save pattern for backing up\n this.r[0]=j; // bits in this table\n this.r[1]=l; // bits to dump before this table\n j=i>>>(w - l);\n this.r[2] = (q - this.u[h-1] - j); // offset to this table\n arrayCopy(this.r, 0, hp, (this.u[h-1]+j)*3, 3); // connect to last table\n }\n else{\n t[0] = q; // first table is returned result\n\t }\n }\n\n\t// set up table entry in r\n this.r[1] = (k - w);\n if (p >= n){\n this.r[0] = 128 + 64; // out of values--invalid code\n\t}\n else if (v[p] < s){\n this.r[0] = (this.v[p] < 256 ? 0 : 32 + 64); // 256 is end-of-block\n this.r[2] = this.v[p++]; // simple code is just the value\n }\n else{\n this.r[0]=(e[this.v[p]-s]+16+64); // non-simple--look up in lists\n this.r[2]=d[this.v[p++] - s];\n }\n\n // fill code-like entries with r\n f=1<<(k-w);\n for (j=i>>>w;j>>= 1){\n i ^= j;\n\t}\n i ^= j;\n\n\t// backup over finished tables\n mask = (1 << w) - 1; // needed on HP, cc -O bug\n while ((i & mask) != this.x[h]){\n h--; // don't need to update q\n w -= l;\n mask = (1 << w) - 1;\n }\n }\n }\n // Return Z_BUF_ERROR if we were given an incomplete table\n return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n}\n\nInfTree.prototype.inflate_trees_bits = function(c, bb, tb, hp, z) {\n var result;\n this.initWorkArea(19);\n this.hn[0]=0;\n result = this.huft_build(c, 0, 19, 19, null, null, tb, bb, hp, this.hn, this.v);\n\n if(result == Z_DATA_ERROR){\n z.msg = \"oversubscribed dynamic bit lengths tree\";\n }\n else if(result == Z_BUF_ERROR || bb[0] == 0){\n z.msg = \"incomplete dynamic bit lengths tree\";\n result = Z_DATA_ERROR;\n }\n return result;\n}\n\nInfTree.prototype.inflate_trees_dynamic = function(nl, nd, c, bl, bd, tl, td, hp, z) {\n var result;\n\n // build literal/length tree\n this.initWorkArea(288);\n this.hn[0]=0;\n result = this.huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, this.hn, this.v);\n if (result != Z_OK || bl[0] == 0){\n if(result == Z_DATA_ERROR){\n z.msg = \"oversubscribed literal/length tree\";\n }\n else if (result != Z_MEM_ERROR){\n z.msg = \"incomplete literal/length tree\";\n result = Z_DATA_ERROR;\n }\n return result;\n }\n\n // build distance tree\n this.initWorkArea(288);\n result = this.huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, this.hn, this.v);\n\n if (result != Z_OK || (bd[0] == 0 && nl > 257)){\n if (result == Z_DATA_ERROR){\n z.msg = \"oversubscribed distance tree\";\n }\n else if (result == Z_BUF_ERROR) {\n z.msg = \"incomplete distance tree\";\n result = Z_DATA_ERROR;\n }\n else if (result != Z_MEM_ERROR){\n z.msg = \"empty distance tree with lengths\";\n result = Z_DATA_ERROR;\n }\n return result;\n }\n\n return Z_OK;\n}\n/*\n static int inflate_trees_fixed(int[] bl, //literal desired/actual bit depth\n int[] bd, //distance desired/actual bit depth\n int[][] tl,//literal/length tree result\n int[][] td,//distance tree result \n ZStream z //for memory allocation\n\t\t\t\t ){\n\n*/\n\nfunction inflate_trees_fixed(bl, bd, tl, td, z) {\n bl[0]=fixed_bl;\n bd[0]=fixed_bd;\n tl[0]=fixed_tl;\n td[0]=fixed_td;\n return Z_OK;\n}\n\nInfTree.prototype.initWorkArea = function(vsize){\n if(this.hn==null){\n this.hn=new Int32Array(1);\n this.v=new Int32Array(vsize);\n this.c=new Int32Array(BMAX+1);\n this.r=new Int32Array(3);\n this.u=new Int32Array(BMAX);\n this.x=new Int32Array(BMAX+1);\n }\n if(this.v.length 100) {\n arrayCopy_fast(new Uint8Array(src.buffer, src.byteOffset + srcOffset, count), dest, destOffset);\n } else { \n arrayCopy_slow(src, srcOffset, dest, destOffset, count);\n }\n\n}\n\nfunction arrayCopy_slow(src, srcOffset, dest, destOffset, count) {\n\n // dlog('_slow call: srcOffset=' + srcOffset + '; destOffset=' + destOffset + '; count=' + count);\n\n for (var i = 0; i < count; ++i) {\n dest[destOffset + i] = src[srcOffset + i];\n }\n}\n\nfunction arrayCopy_fast(src, dest, destOffset) {\n dest.set(src, destOffset);\n}\n\n\n // largest prime smaller than 65536\nvar ADLER_BASE=65521; \n // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1\nvar ADLER_NMAX=5552;\n\nfunction adler32(adler, /* byte[] */ buf, index, len){\n if(buf == null){ return 1; }\n\n var s1=adler&0xffff;\n var s2=(adler>>16)&0xffff;\n var k;\n\n while(len > 0) {\n k=len=16){\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n k-=16;\n }\n if(k!=0){\n do{\n s1+=buf[index++]&0xff; s2+=s1;\n }\n while(--k!=0);\n }\n s1%=ADLER_BASE;\n s2%=ADLER_BASE;\n }\n return (s2<<16)|s1;\n}\n\n\n\nfunction jszlib_inflate_buffer(buffer, start, length, afterUncOffset) {\n if (!start) {\n buffer = new Uint8Array(buffer);\n } else if (!length) {\n buffer = new Uint8Array(buffer, start, buffer.byteLength - start);\n } else {\n buffer = new Uint8Array(buffer, start, length);\n }\n\n var z = new ZStream();\n z.inflateInit(DEF_WBITS, true);\n z.next_in = buffer;\n z.next_in_index = 0;\n z.avail_in = buffer.length;\n\n var oBlockList = [];\n var totalSize = 0;\n while (true) {\n var obuf = new Uint8Array(32000);\n z.next_out = obuf;\n z.next_out_index = 0;\n z.avail_out = obuf.length;\n var status = z.inflate(Z_NO_FLUSH);\n if (status != Z_OK && status != Z_STREAM_END && status != Z_BUF_ERROR) {\n throw z.msg;\n }\n if (z.avail_out != 0) {\n var newob = new Uint8Array(obuf.length - z.avail_out);\n arrayCopy(obuf, 0, newob, 0, (obuf.length - z.avail_out));\n obuf = newob;\n }\n oBlockList.push(obuf);\n totalSize += obuf.length;\n if (status == Z_STREAM_END || status == Z_BUF_ERROR) {\n break;\n }\n }\n\n if (afterUncOffset) {\n afterUncOffset[0] = (start || 0) + z.next_in_index;\n }\n\n if (oBlockList.length == 1) {\n return oBlockList[0].buffer;\n } else {\n var out = new Uint8Array(totalSize);\n var cursor = 0;\n for (var i = 0; i < oBlockList.length; ++i) {\n var b = oBlockList[i];\n arrayCopy(b, 0, out, cursor, b.length);\n cursor += b.length;\n }\n return out.buffer;\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n inflateBuffer: jszlib_inflate_buffer,\n arrayCopy: arrayCopy\n };\n}\n\n},{}],386:[function(require,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},{}],387:[function(require,module,exports){\n// Ramda v0.21.0\n// https://github.com/ramda/ramda\n// (c) 2013-2016 Scott Sauyet, Michael Hurley, and David Chambers\n// Ramda may be freely distributed under the MIT license.\n\n;(function() {\n\n 'use strict';\n\n /**\n * A special placeholder value used to specify \"gaps\" within curried functions,\n * allowing partial application of any combination of arguments, regardless of\n * their positions.\n *\n * If `g` is a curried ternary function and `_` is `R.__`, the following are\n * equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2, _)(1, 3)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @constant\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @example\n *\n * var greet = R.replace('{name}', R.__, 'Hello, {name}!');\n * greet('Alice'); //=> 'Hello, Alice!'\n */\n var __ = { '@@functional/placeholder': true };\n\n /* eslint-disable no-unused-vars */\n var _arity = function _arity(n, fn) {\n /* eslint-disable no-unused-vars */\n switch (n) {\n case 0:\n return function () {\n return fn.apply(this, arguments);\n };\n case 1:\n return function (a0) {\n return fn.apply(this, arguments);\n };\n case 2:\n return function (a0, a1) {\n return fn.apply(this, arguments);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.apply(this, arguments);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.apply(this, arguments);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.apply(this, arguments);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.apply(this, arguments);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.apply(this, arguments);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.apply(this, arguments);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.apply(this, arguments);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.apply(this, arguments);\n };\n default:\n throw new Error('First argument to _arity must be a non-negative integer no greater than ten');\n }\n };\n\n var _arrayFromIterator = function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n };\n\n var _arrayOf = function _arrayOf() {\n return Array.prototype.slice.call(arguments);\n };\n\n var _cloneRegExp = function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n };\n\n var _complement = function _complement(f) {\n return function () {\n return !f.apply(this, arguments);\n };\n };\n\n /**\n * Private `concat` function to merge two array-like objects.\n *\n * @private\n * @param {Array|Arguments} [set1=[]] An array-like object.\n * @param {Array|Arguments} [set2=[]] An array-like object.\n * @return {Array} A new, merged array.\n * @example\n *\n * _concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]\n */\n var _concat = function _concat(set1, set2) {\n set1 = set1 || [];\n set2 = set2 || [];\n var idx;\n var len1 = set1.length;\n var len2 = set2.length;\n var result = [];\n idx = 0;\n while (idx < len1) {\n result[result.length] = set1[idx];\n idx += 1;\n }\n idx = 0;\n while (idx < len2) {\n result[result.length] = set2[idx];\n idx += 1;\n }\n return result;\n };\n\n var _containsWith = function _containsWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n };\n\n var _filter = function _filter(fn, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n while (idx < len) {\n if (fn(list[idx])) {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n return result;\n };\n\n var _forceReduced = function _forceReduced(x) {\n return {\n '@@transducer/value': x,\n '@@transducer/reduced': true\n };\n };\n\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var _functionName = function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n };\n\n var _has = function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n };\n\n var _identity = function _identity(x) {\n return x;\n };\n\n var _isArguments = function () {\n var toString = Object.prototype.toString;\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n }();\n\n /**\n * Tests whether or not an object is an array.\n *\n * @private\n * @param {*} val The object to test.\n * @return {Boolean} `true` if `val` is an array, `false` otherwise.\n * @example\n *\n * _isArray([]); //=> true\n * _isArray(null); //=> false\n * _isArray({}); //=> false\n */\n var _isArray = Array.isArray || function _isArray(val) {\n return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';\n };\n\n var _isFunction = function _isNumber(x) {\n return Object.prototype.toString.call(x) === '[object Function]';\n };\n\n /**\n * Determine if the passed argument is an integer.\n *\n * @private\n * @param {*} n\n * @category Type\n * @return {Boolean}\n */\n var _isInteger = Number.isInteger || function _isInteger(n) {\n return n << 0 === n;\n };\n\n var _isNumber = function _isNumber(x) {\n return Object.prototype.toString.call(x) === '[object Number]';\n };\n\n var _isObject = function _isObject(x) {\n return Object.prototype.toString.call(x) === '[object Object]';\n };\n\n var _isPlaceholder = function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n };\n\n var _isRegExp = function _isRegExp(x) {\n return Object.prototype.toString.call(x) === '[object RegExp]';\n };\n\n var _isString = function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n };\n\n var _isTransformer = function _isTransformer(obj) {\n return typeof obj['@@transducer/step'] === 'function';\n };\n\n var _map = function _map(fn, functor) {\n var idx = 0;\n var len = functor.length;\n var result = Array(len);\n while (idx < len) {\n result[idx] = fn(functor[idx]);\n idx += 1;\n }\n return result;\n };\n\n // Based on https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n var _objectAssign = function _objectAssign(target) {\n if (target == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var output = Object(target);\n var idx = 1;\n var length = arguments.length;\n while (idx < length) {\n var source = arguments[idx];\n if (source != null) {\n for (var nextKey in source) {\n if (_has(nextKey, source)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n idx += 1;\n }\n return output;\n };\n\n var _of = function _of(x) {\n return [x];\n };\n\n var _pipe = function _pipe(f, g) {\n return function () {\n return g.call(this, f.apply(this, arguments));\n };\n };\n\n var _pipeP = function _pipeP(f, g) {\n return function () {\n var ctx = this;\n return f.apply(ctx, arguments).then(function (x) {\n return g.call(ctx, x);\n });\n };\n };\n\n // \\b matches word boundary; [\\b] matches backspace\n var _quote = function _quote(s) {\n var escaped = s.replace(/\\\\/g, '\\\\\\\\').replace(/[\\b]/g, '\\\\b') // \\b matches word boundary; [\\b] matches backspace\n .replace(/\\f/g, '\\\\f').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t').replace(/\\v/g, '\\\\v').replace(/\\0/g, '\\\\0');\n return '\"' + escaped.replace(/\"/g, '\\\\\"') + '\"';\n };\n\n var _reduced = function _reduced(x) {\n return x && x['@@transducer/reduced'] ? x : {\n '@@transducer/value': x,\n '@@transducer/reduced': true\n };\n };\n\n /**\n * An optimized, private array `slice` implementation.\n *\n * @private\n * @param {Arguments|Array} args The array or arguments object to consider.\n * @param {Number} [from=0] The array index to slice from, inclusive.\n * @param {Number} [to=args.length] The array index to slice to, exclusive.\n * @return {Array} A new, sliced array.\n * @example\n *\n * _slice([1, 2, 3, 4, 5], 1, 3); //=> [2, 3]\n *\n * var firstThreeArgs = function(a, b, c, d) {\n * return _slice(arguments, 0, 3);\n * };\n * firstThreeArgs(1, 2, 3, 4); //=> [1, 2, 3]\n */\n var _slice = function _slice(args, from, to) {\n switch (arguments.length) {\n case 1:\n return _slice(args, 0, args.length);\n case 2:\n return _slice(args, from, args.length);\n default:\n var list = [];\n var idx = 0;\n var len = Math.max(0, Math.min(args.length, to) - from);\n while (idx < len) {\n list[idx] = args[from + idx];\n idx += 1;\n }\n return list;\n }\n };\n\n /**\n * Polyfill from .\n */\n var _toISOString = function () {\n var pad = function pad(n) {\n return (n < 10 ? '0' : '') + n;\n };\n return typeof Date.prototype.toISOString === 'function' ? function _toISOString(d) {\n return d.toISOString();\n } : function _toISOString(d) {\n return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z';\n };\n }();\n\n var _xfBase = {\n init: function () {\n return this.xf['@@transducer/init']();\n },\n result: function (result) {\n return this.xf['@@transducer/result'](result);\n }\n };\n\n var _xwrap = function () {\n function XWrap(fn) {\n this.f = fn;\n }\n XWrap.prototype['@@transducer/init'] = function () {\n throw new Error('init not implemented on XWrap');\n };\n XWrap.prototype['@@transducer/result'] = function (acc) {\n return acc;\n };\n XWrap.prototype['@@transducer/step'] = function (acc, x) {\n return this.f(acc, x);\n };\n return function _xwrap(fn) {\n return new XWrap(fn);\n };\n }();\n\n var _aperture = function _aperture(n, list) {\n var idx = 0;\n var limit = list.length - (n - 1);\n var acc = new Array(limit >= 0 ? limit : 0);\n while (idx < limit) {\n acc[idx] = _slice(list, idx, idx + n);\n idx += 1;\n }\n return acc;\n };\n\n var _assign = typeof Object.assign === 'function' ? Object.assign : _objectAssign;\n\n /**\n * Similar to hasMethod, this checks whether a function has a [methodname]\n * function. If it isn't an array it will execute that function otherwise it\n * will default to the ramda implementation.\n *\n * @private\n * @param {Function} fn ramda implemtation\n * @param {String} methodname property to check for a custom implementation\n * @return {Object} Whatever the return value of the method is.\n */\n var _checkForMethod = function _checkForMethod(methodname, fn) {\n return function () {\n var length = arguments.length;\n if (length === 0) {\n return fn();\n }\n var obj = arguments[length - 1];\n return _isArray(obj) || typeof obj[methodname] !== 'function' ? fn.apply(this, arguments) : obj[methodname].apply(obj, _slice(arguments, 0, length - 1));\n };\n };\n\n /**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry1 = function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n };\n\n /**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry2 = function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n };\n\n /**\n * Optimized internal three-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry3 = function _curry3(fn) {\n return function f3(a, b, c) {\n switch (arguments.length) {\n case 0:\n return f3;\n case 1:\n return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n });\n case 2:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _curry1(function (_c) {\n return fn(a, b, _c);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {\n return fn(_a, _b, c);\n }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b, c);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b, c);\n }) : _isPlaceholder(c) ? _curry1(function (_c) {\n return fn(a, b, _c);\n }) : fn(a, b, c);\n }\n };\n };\n\n /**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Number} length The arity of the curried function.\n * @param {Array} received An array of arguments received thus far.\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curryN = function _curryN(length, received, fn) {\n return function () {\n var combined = [];\n var argsIdx = 0;\n var left = length;\n var combinedIdx = 0;\n while (combinedIdx < received.length || argsIdx < arguments.length) {\n var result;\n if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {\n result = received[combinedIdx];\n } else {\n result = arguments[argsIdx];\n argsIdx += 1;\n }\n combined[combinedIdx] = result;\n if (!_isPlaceholder(result)) {\n left -= 1;\n }\n combinedIdx += 1;\n }\n return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));\n };\n };\n\n /**\n * Returns a function that dispatches with different strategies based on the\n * object in list position (last argument). If it is an array, executes [fn].\n * Otherwise, if it has a function with [methodname], it will execute that\n * function (functor case). Otherwise, if it is a transformer, uses transducer\n * [xf] to return a new transformer (transducer case). Otherwise, it will\n * default to executing [fn].\n *\n * @private\n * @param {String} methodname property to check for a custom implementation\n * @param {Function} xf transducer to initialize if object is transformer\n * @param {Function} fn default ramda implementation\n * @return {Function} A function that dispatches on object in list position\n */\n var _dispatchable = function _dispatchable(methodname, xf, fn) {\n return function () {\n var length = arguments.length;\n if (length === 0) {\n return fn();\n }\n var obj = arguments[length - 1];\n if (!_isArray(obj)) {\n var args = _slice(arguments, 0, length - 1);\n if (typeof obj[methodname] === 'function') {\n return obj[methodname].apply(obj, args);\n }\n if (_isTransformer(obj)) {\n var transducer = xf.apply(null, args);\n return transducer(obj);\n }\n }\n return fn.apply(this, arguments);\n };\n };\n\n var _dropLastWhile = function dropLastWhile(pred, list) {\n var idx = list.length - 1;\n while (idx >= 0 && pred(list[idx])) {\n idx -= 1;\n }\n return _slice(list, 0, idx + 1);\n };\n\n var _xall = function () {\n function XAll(f, xf) {\n this.xf = xf;\n this.f = f;\n this.all = true;\n }\n XAll.prototype['@@transducer/init'] = _xfBase.init;\n XAll.prototype['@@transducer/result'] = function (result) {\n if (this.all) {\n result = this.xf['@@transducer/step'](result, true);\n }\n return this.xf['@@transducer/result'](result);\n };\n XAll.prototype['@@transducer/step'] = function (result, input) {\n if (!this.f(input)) {\n this.all = false;\n result = _reduced(this.xf['@@transducer/step'](result, false));\n }\n return result;\n };\n return _curry2(function _xall(f, xf) {\n return new XAll(f, xf);\n });\n }();\n\n var _xany = function () {\n function XAny(f, xf) {\n this.xf = xf;\n this.f = f;\n this.any = false;\n }\n XAny.prototype['@@transducer/init'] = _xfBase.init;\n XAny.prototype['@@transducer/result'] = function (result) {\n if (!this.any) {\n result = this.xf['@@transducer/step'](result, false);\n }\n return this.xf['@@transducer/result'](result);\n };\n XAny.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.any = true;\n result = _reduced(this.xf['@@transducer/step'](result, true));\n }\n return result;\n };\n return _curry2(function _xany(f, xf) {\n return new XAny(f, xf);\n });\n }();\n\n var _xaperture = function () {\n function XAperture(n, xf) {\n this.xf = xf;\n this.pos = 0;\n this.full = false;\n this.acc = new Array(n);\n }\n XAperture.prototype['@@transducer/init'] = _xfBase.init;\n XAperture.prototype['@@transducer/result'] = function (result) {\n this.acc = null;\n return this.xf['@@transducer/result'](result);\n };\n XAperture.prototype['@@transducer/step'] = function (result, input) {\n this.store(input);\n return this.full ? this.xf['@@transducer/step'](result, this.getCopy()) : result;\n };\n XAperture.prototype.store = function (input) {\n this.acc[this.pos] = input;\n this.pos += 1;\n if (this.pos === this.acc.length) {\n this.pos = 0;\n this.full = true;\n }\n };\n XAperture.prototype.getCopy = function () {\n return _concat(_slice(this.acc, this.pos), _slice(this.acc, 0, this.pos));\n };\n return _curry2(function _xaperture(n, xf) {\n return new XAperture(n, xf);\n });\n }();\n\n var _xdrop = function () {\n function XDrop(n, xf) {\n this.xf = xf;\n this.n = n;\n }\n XDrop.prototype['@@transducer/init'] = _xfBase.init;\n XDrop.prototype['@@transducer/result'] = _xfBase.result;\n XDrop.prototype['@@transducer/step'] = function (result, input) {\n if (this.n > 0) {\n this.n -= 1;\n return result;\n }\n return this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdrop(n, xf) {\n return new XDrop(n, xf);\n });\n }();\n\n var _xdropLast = function () {\n function XDropLast(n, xf) {\n this.xf = xf;\n this.pos = 0;\n this.full = false;\n this.acc = new Array(n);\n }\n XDropLast.prototype['@@transducer/init'] = _xfBase.init;\n XDropLast.prototype['@@transducer/result'] = function (result) {\n this.acc = null;\n return this.xf['@@transducer/result'](result);\n };\n XDropLast.prototype['@@transducer/step'] = function (result, input) {\n if (this.full) {\n result = this.xf['@@transducer/step'](result, this.acc[this.pos]);\n }\n this.store(input);\n return result;\n };\n XDropLast.prototype.store = function (input) {\n this.acc[this.pos] = input;\n this.pos += 1;\n if (this.pos === this.acc.length) {\n this.pos = 0;\n this.full = true;\n }\n };\n return _curry2(function _xdropLast(n, xf) {\n return new XDropLast(n, xf);\n });\n }();\n\n var _xdropRepeatsWith = function () {\n function XDropRepeatsWith(pred, xf) {\n this.xf = xf;\n this.pred = pred;\n this.lastValue = undefined;\n this.seenFirstValue = false;\n }\n XDropRepeatsWith.prototype['@@transducer/init'] = function () {\n return this.xf['@@transducer/init']();\n };\n XDropRepeatsWith.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](result);\n };\n XDropRepeatsWith.prototype['@@transducer/step'] = function (result, input) {\n var sameAsLast = false;\n if (!this.seenFirstValue) {\n this.seenFirstValue = true;\n } else if (this.pred(this.lastValue, input)) {\n sameAsLast = true;\n }\n this.lastValue = input;\n return sameAsLast ? result : this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdropRepeatsWith(pred, xf) {\n return new XDropRepeatsWith(pred, xf);\n });\n }();\n\n var _xdropWhile = function () {\n function XDropWhile(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XDropWhile.prototype['@@transducer/init'] = _xfBase.init;\n XDropWhile.prototype['@@transducer/result'] = _xfBase.result;\n XDropWhile.prototype['@@transducer/step'] = function (result, input) {\n if (this.f) {\n if (this.f(input)) {\n return result;\n }\n this.f = null;\n }\n return this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdropWhile(f, xf) {\n return new XDropWhile(f, xf);\n });\n }();\n\n var _xfilter = function () {\n function XFilter(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XFilter.prototype['@@transducer/init'] = _xfBase.init;\n XFilter.prototype['@@transducer/result'] = _xfBase.result;\n XFilter.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.xf['@@transducer/step'](result, input) : result;\n };\n return _curry2(function _xfilter(f, xf) {\n return new XFilter(f, xf);\n });\n }();\n\n var _xfind = function () {\n function XFind(f, xf) {\n this.xf = xf;\n this.f = f;\n this.found = false;\n }\n XFind.prototype['@@transducer/init'] = _xfBase.init;\n XFind.prototype['@@transducer/result'] = function (result) {\n if (!this.found) {\n result = this.xf['@@transducer/step'](result, void 0);\n }\n return this.xf['@@transducer/result'](result);\n };\n XFind.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.found = true;\n result = _reduced(this.xf['@@transducer/step'](result, input));\n }\n return result;\n };\n return _curry2(function _xfind(f, xf) {\n return new XFind(f, xf);\n });\n }();\n\n var _xfindIndex = function () {\n function XFindIndex(f, xf) {\n this.xf = xf;\n this.f = f;\n this.idx = -1;\n this.found = false;\n }\n XFindIndex.prototype['@@transducer/init'] = _xfBase.init;\n XFindIndex.prototype['@@transducer/result'] = function (result) {\n if (!this.found) {\n result = this.xf['@@transducer/step'](result, -1);\n }\n return this.xf['@@transducer/result'](result);\n };\n XFindIndex.prototype['@@transducer/step'] = function (result, input) {\n this.idx += 1;\n if (this.f(input)) {\n this.found = true;\n result = _reduced(this.xf['@@transducer/step'](result, this.idx));\n }\n return result;\n };\n return _curry2(function _xfindIndex(f, xf) {\n return new XFindIndex(f, xf);\n });\n }();\n\n var _xfindLast = function () {\n function XFindLast(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XFindLast.prototype['@@transducer/init'] = _xfBase.init;\n XFindLast.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.last));\n };\n XFindLast.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.last = input;\n }\n return result;\n };\n return _curry2(function _xfindLast(f, xf) {\n return new XFindLast(f, xf);\n });\n }();\n\n var _xfindLastIndex = function () {\n function XFindLastIndex(f, xf) {\n this.xf = xf;\n this.f = f;\n this.idx = -1;\n this.lastIdx = -1;\n }\n XFindLastIndex.prototype['@@transducer/init'] = _xfBase.init;\n XFindLastIndex.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.lastIdx));\n };\n XFindLastIndex.prototype['@@transducer/step'] = function (result, input) {\n this.idx += 1;\n if (this.f(input)) {\n this.lastIdx = this.idx;\n }\n return result;\n };\n return _curry2(function _xfindLastIndex(f, xf) {\n return new XFindLastIndex(f, xf);\n });\n }();\n\n var _xmap = function () {\n function XMap(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XMap.prototype['@@transducer/init'] = _xfBase.init;\n XMap.prototype['@@transducer/result'] = _xfBase.result;\n XMap.prototype['@@transducer/step'] = function (result, input) {\n return this.xf['@@transducer/step'](result, this.f(input));\n };\n return _curry2(function _xmap(f, xf) {\n return new XMap(f, xf);\n });\n }();\n\n var _xtake = function () {\n function XTake(n, xf) {\n this.xf = xf;\n this.n = n;\n }\n XTake.prototype['@@transducer/init'] = _xfBase.init;\n XTake.prototype['@@transducer/result'] = _xfBase.result;\n XTake.prototype['@@transducer/step'] = function (result, input) {\n if (this.n === 0) {\n return _reduced(result);\n } else {\n this.n -= 1;\n return this.xf['@@transducer/step'](result, input);\n }\n };\n return _curry2(function _xtake(n, xf) {\n return new XTake(n, xf);\n });\n }();\n\n var _xtakeWhile = function () {\n function XTakeWhile(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XTakeWhile.prototype['@@transducer/init'] = _xfBase.init;\n XTakeWhile.prototype['@@transducer/result'] = _xfBase.result;\n XTakeWhile.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.xf['@@transducer/step'](result, input) : _reduced(result);\n };\n return _curry2(function _xtakeWhile(f, xf) {\n return new XTakeWhile(f, xf);\n });\n }();\n\n /**\n * Adds two values.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a\n * @param {Number} b\n * @return {Number}\n * @see R.subtract\n * @example\n *\n * R.add(2, 3); //=> 5\n * R.add(7)(10); //=> 17\n */\n var add = _curry2(function add(a, b) {\n return Number(a) + Number(b);\n });\n\n /**\n * Applies a function to the value at the given index of an array, returning a\n * new copy of the array with the element at the given index replaced with the\n * result of the function application.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig (a -> a) -> Number -> [a] -> [a]\n * @param {Function} fn The function to apply.\n * @param {Number} idx The index.\n * @param {Array|Arguments} list An array-like object whose value\n * at the supplied index will be replaced.\n * @return {Array} A copy of the supplied array-like object with\n * the element at index `idx` replaced with the value\n * returned by applying `fn` to the existing element.\n * @see R.update\n * @example\n *\n * R.adjust(R.add(10), 1, [0, 1, 2]); //=> [0, 11, 2]\n * R.adjust(R.add(10))(1)([0, 1, 2]); //=> [0, 11, 2]\n */\n var adjust = _curry3(function adjust(fn, idx, list) {\n if (idx >= list.length || idx < -list.length) {\n return list;\n }\n var start = idx < 0 ? list.length : 0;\n var _idx = start + idx;\n var _list = _concat(list);\n _list[_idx] = fn(list[_idx]);\n return _list;\n });\n\n /**\n * Returns `true` if all elements of the list match the predicate, `false` if\n * there are any that don't.\n *\n * Dispatches to the `all` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is satisfied by every element, `false`\n * otherwise.\n * @see R.any, R.none, R.transduce\n * @example\n *\n * var lessThan2 = R.flip(R.lt)(2);\n * var lessThan3 = R.flip(R.lt)(3);\n * R.all(lessThan2)([1, 2]); //=> false\n * R.all(lessThan3)([1, 2]); //=> true\n */\n var all = _curry2(_dispatchable('all', _xall, function all(fn, list) {\n var idx = 0;\n while (idx < list.length) {\n if (!fn(list[idx])) {\n return false;\n }\n idx += 1;\n }\n return true;\n }));\n\n /**\n * Returns a function that always returns the given value. Note that for\n * non-primitives the value returned is a reference to the original value.\n *\n * This function is known as `const`, `constant`, or `K` (for K combinator) in\n * other languages and libraries.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> (* -> a)\n * @param {*} val The value to wrap in a function\n * @return {Function} A Function :: * -> val.\n * @example\n *\n * var t = R.always('Tee');\n * t(); //=> 'Tee'\n */\n var always = _curry1(function always(val) {\n return function () {\n return val;\n };\n });\n\n /**\n * Returns `true` if both arguments are `true`; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> * -> *\n * @param {Boolean} a A boolean value\n * @param {Boolean} b A boolean value\n * @return {Boolean} `true` if both arguments are `true`, `false` otherwise\n * @see R.both\n * @example\n *\n * R.and(true, true); //=> true\n * R.and(true, false); //=> false\n * R.and(false, true); //=> false\n * R.and(false, false); //=> false\n */\n var and = _curry2(function and(a, b) {\n return a && b;\n });\n\n /**\n * Returns `true` if at least one of elements of the list match the predicate,\n * `false` otherwise.\n *\n * Dispatches to the `any` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is satisfied by at least one element, `false`\n * otherwise.\n * @see R.all, R.none, R.transduce\n * @example\n *\n * var lessThan0 = R.flip(R.lt)(0);\n * var lessThan2 = R.flip(R.lt)(2);\n * R.any(lessThan0)([1, 2]); //=> false\n * R.any(lessThan2)([1, 2]); //=> true\n */\n var any = _curry2(_dispatchable('any', _xany, function any(fn, list) {\n var idx = 0;\n while (idx < list.length) {\n if (fn(list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n }));\n\n /**\n * Returns a new list, composed of n-tuples of consecutive elements If `n` is\n * greater than the length of the list, an empty list is returned.\n *\n * Dispatches to the `aperture` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig Number -> [a] -> [[a]]\n * @param {Number} n The size of the tuples to create\n * @param {Array} list The list to split into `n`-tuples\n * @return {Array} The new list.\n * @see R.transduce\n * @example\n *\n * R.aperture(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [2, 3], [3, 4], [4, 5]]\n * R.aperture(3, [1, 2, 3, 4, 5]); //=> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n * R.aperture(7, [1, 2, 3, 4, 5]); //=> []\n */\n var aperture = _curry2(_dispatchable('aperture', _xaperture, _aperture));\n\n /**\n * Returns a new list containing the contents of the given list, followed by\n * the given element.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} el The element to add to the end of the new list.\n * @param {Array} list The list whose contents will be added to the beginning of the output\n * list.\n * @return {Array} A new list containing the contents of the old list followed by `el`.\n * @see R.prepend\n * @example\n *\n * R.append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']\n * R.append('tests', []); //=> ['tests']\n * R.append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]\n */\n var append = _curry2(function append(el, list) {\n return _concat(list, [el]);\n });\n\n /**\n * Applies function `fn` to the argument list `args`. This is useful for\n * creating a fixed-arity function from a variadic function. `fn` should be a\n * bound function if context is significant.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig (*... -> a) -> [*] -> a\n * @param {Function} fn\n * @param {Array} args\n * @return {*}\n * @see R.call, R.unapply\n * @example\n *\n * var nums = [1, 2, 3, -99, 42, 6, 7];\n * R.apply(Math.max, nums); //=> 42\n */\n var apply = _curry2(function apply(fn, args) {\n return fn.apply(this, args);\n });\n\n /**\n * Makes a shallow clone of an object, setting or overriding the specified\n * property with the given value. Note that this copies and flattens prototype\n * properties onto the new object as well. All non-primitive properties are\n * copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig String -> a -> {k: v} -> {k: v}\n * @param {String} prop the property name to set\n * @param {*} val the new value\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original except for the specified property.\n * @see R.dissoc\n * @example\n *\n * R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}\n */\n var assoc = _curry3(function assoc(prop, val, obj) {\n var result = {};\n for (var p in obj) {\n result[p] = obj[p];\n }\n result[prop] = val;\n return result;\n });\n\n /**\n * Makes a shallow clone of an object, setting or overriding the nodes required\n * to create the given path, and placing the specific value at the tail end of\n * that path. Note that this copies and flattens prototype properties onto the\n * new object as well. All non-primitive properties are copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig [String] -> a -> {k: v} -> {k: v}\n * @param {Array} path the path to set\n * @param {*} val the new value\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original except along the specified path.\n * @see R.dissocPath\n * @example\n *\n * R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}\n */\n var assocPath = _curry3(function assocPath(path, val, obj) {\n switch (path.length) {\n case 0:\n return val;\n case 1:\n return assoc(path[0], val, obj);\n default:\n return assoc(path[0], assocPath(_slice(path, 1), val, Object(obj[path[0]])), obj);\n }\n });\n\n /**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n */\n var bind = _curry2(function bind(fn, thisObj) {\n return _arity(fn.length, function () {\n return fn.apply(thisObj, arguments);\n });\n });\n\n /**\n * Restricts a number to be within a range.\n *\n * Also works for other ordered types such as Strings and Dates.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Relation\n * @sig Ord a => a -> a -> a -> a\n * @param {Number} minimum number\n * @param {Number} maximum number\n * @param {Number} value to be clamped\n * @return {Number} Returns the clamped value\n * @example\n *\n * R.clamp(1, 10, -1) // => 1\n * R.clamp(1, 10, 11) // => 10\n * R.clamp(1, 10, 4) // => 4\n */\n var clamp = _curry3(function clamp(min, max, value) {\n if (min > max) {\n throw new Error('min must not be greater than max in clamp(min, max, value)');\n }\n return value < min ? min : value > max ? max : value;\n });\n\n /**\n * Makes a comparator function out of a function that reports whether the first\n * element is less than the second.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a, b -> Boolean) -> (a, b -> Number)\n * @param {Function} pred A predicate function of arity two.\n * @return {Function} A Function :: a -> b -> Int that returns `-1` if a < b, `1` if b < a, otherwise `0`.\n * @example\n *\n * var cmp = R.comparator((a, b) => a.age < b.age);\n * var people = [\n * // ...\n * ];\n * R.sort(cmp, people);\n */\n var comparator = _curry1(function comparator(pred) {\n return function (a, b) {\n return pred(a, b) ? -1 : pred(b, a) ? 1 : 0;\n };\n });\n\n /**\n * Returns a curried equivalent of the provided function, with the specified\n * arity. The curried function has two unusual capabilities. First, its\n * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value `R.__` may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is `R.__`, the\n * following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curry\n * @example\n *\n * var sumArgs = (...args) => R.sum(args);\n *\n * var curriedAddFourNumbers = R.curryN(4, sumArgs);\n * var f = curriedAddFourNumbers(1, 2);\n * var g = f(3);\n * g(4); //=> 10\n */\n var curryN = _curry2(function curryN(length, fn) {\n if (length === 1) {\n return _curry1(fn);\n }\n return _arity(length, _curryN(length, [], fn));\n });\n\n /**\n * Decrements its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @see R.inc\n * @example\n *\n * R.dec(42); //=> 41\n */\n var dec = add(-1);\n\n /**\n * Returns the second argument if it is not `null`, `undefined` or `NaN`\n * otherwise the first argument is returned.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Logic\n * @sig a -> b -> a | b\n * @param {a} val The default value.\n * @param {b} val The value to return if it is not null or undefined\n * @return {*} The the second value or the default value\n * @example\n *\n * var defaultTo42 = R.defaultTo(42);\n *\n * defaultTo42(null); //=> 42\n * defaultTo42(undefined); //=> 42\n * defaultTo42('Ramda'); //=> 'Ramda'\n * defaultTo42(parseInt('string')); //=> 42\n */\n var defaultTo = _curry2(function defaultTo(d, v) {\n return v == null || v !== v ? d : v;\n });\n\n /**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list. Duplication is determined according to the\n * value returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.difference\n * @example\n *\n * var cmp = (x, y) => x.a === y.a;\n * var l1 = [{a: 1}, {a: 2}, {a: 3}];\n * var l2 = [{a: 3}, {a: 4}];\n * R.differenceWith(cmp, l1, l2); //=> [{a: 1}, {a: 2}]\n */\n var differenceWith = _curry3(function differenceWith(pred, first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n while (idx < firstLen) {\n if (!_containsWith(pred, first[idx], second) && !_containsWith(pred, first[idx], out)) {\n out.push(first[idx]);\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new object that does not contain a `prop` property.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Object\n * @sig String -> {k: v} -> {k: v}\n * @param {String} prop the name of the property to dissociate\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original but without the specified property\n * @see R.assoc\n * @example\n *\n * R.dissoc('b', {a: 1, b: 2, c: 3}); //=> {a: 1, c: 3}\n */\n var dissoc = _curry2(function dissoc(prop, obj) {\n var result = {};\n for (var p in obj) {\n if (p !== prop) {\n result[p] = obj[p];\n }\n }\n return result;\n });\n\n /**\n * Makes a shallow clone of an object, omitting the property at the given path.\n * Note that this copies and flattens prototype properties onto the new object\n * as well. All non-primitive properties are copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.11.0\n * @category Object\n * @sig [String] -> {k: v} -> {k: v}\n * @param {Array} path the path to set\n * @param {Object} obj the object to clone\n * @return {Object} a new object without the property at path\n * @see R.assocPath\n * @example\n *\n * R.dissocPath(['a', 'b', 'c'], {a: {b: {c: 42}}}); //=> {a: {b: {}}}\n */\n var dissocPath = _curry2(function dissocPath(path, obj) {\n switch (path.length) {\n case 0:\n return obj;\n case 1:\n return dissoc(path[0], obj);\n default:\n var head = path[0];\n var tail = _slice(path, 1);\n return obj[head] == null ? obj : assoc(head, dissocPath(tail, obj[head]), obj);\n }\n });\n\n /**\n * Divides two numbers. Equivalent to `a / b`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a / b`.\n * @see R.multiply\n * @example\n *\n * R.divide(71, 100); //=> 0.71\n *\n * var half = R.divide(R.__, 2);\n * half(42); //=> 21\n *\n * var reciprocal = R.divide(1);\n * reciprocal(4); //=> 0.25\n */\n var divide = _curry2(function divide(a, b) {\n return a / b;\n });\n\n /**\n * Returns a new list containing the last `n` elements of a given list, passing\n * each value to the supplied predicate function, skipping elements while the\n * predicate function returns `true`. The predicate function is passed one\n * argument: *(value)*.\n *\n * Dispatches to the `dropWhile` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.takeWhile, R.transduce, R.addIndex\n * @example\n *\n * var lteTwo = x => x <= 2;\n *\n * R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]\n */\n var dropWhile = _curry2(_dispatchable('dropWhile', _xdropWhile, function dropWhile(pred, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len && pred(list[idx])) {\n idx += 1;\n }\n return _slice(list, idx);\n }));\n\n /**\n * Returns the empty value of its argument's type. Ramda defines the empty\n * value of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other\n * types are supported if they define `.empty` and/or\n * `.prototype.empty`.\n *\n * Dispatches to the `empty` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig a -> a\n * @param {*} x\n * @return {*}\n * @example\n *\n * R.empty(Just(42)); //=> Nothing()\n * R.empty([1, 2, 3]); //=> []\n * R.empty('unicorns'); //=> ''\n * R.empty({x: 1, y: 2}); //=> {}\n */\n // else\n var empty = _curry1(function empty(x) {\n return x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {\n return arguments;\n }() : // else\n void 0;\n });\n\n /**\n * Creates a new object by recursively evolving a shallow copy of `object`,\n * according to the `transformation` functions. All non-primitive properties\n * are copied by reference.\n *\n * A `transformation` function will not be invoked if its corresponding key\n * does not exist in the evolved object.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {k: (v -> v)} -> {k: v} -> {k: v}\n * @param {Object} transformations The object specifying transformation functions to apply\n * to the object.\n * @param {Object} object The object to be transformed.\n * @return {Object} The transformed object.\n * @example\n *\n * var tomato = {firstName: ' Tomato ', data: {elapsed: 100, remaining: 1400}, id:123};\n * var transformations = {\n * firstName: R.trim,\n * lastName: R.trim, // Will not get invoked.\n * data: {elapsed: R.add(1), remaining: R.add(-1)}\n * };\n * R.evolve(transformations, tomato); //=> {firstName: 'Tomato', data: {elapsed: 101, remaining: 1399}, id:123}\n */\n var evolve = _curry2(function evolve(transformations, object) {\n var result = {};\n var transformation, key, type;\n for (key in object) {\n transformation = transformations[key];\n type = typeof transformation;\n result[key] = type === 'function' ? transformation(object[key]) : type === 'object' ? evolve(transformations[key], object[key]) : object[key];\n }\n return result;\n });\n\n /**\n * Returns the first element of the list which matches the predicate, or\n * `undefined` if no element matches.\n *\n * Dispatches to the `find` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> a | undefined\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Object} The element found, or `undefined`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1}, {a: 2}, {a: 3}];\n * R.find(R.propEq('a', 2))(xs); //=> {a: 2}\n * R.find(R.propEq('a', 4))(xs); //=> undefined\n */\n var find = _curry2(_dispatchable('find', _xfind, function find(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (fn(list[idx])) {\n return list[idx];\n }\n idx += 1;\n }\n }));\n\n /**\n * Returns the index of the first element of the list which matches the\n * predicate, or `-1` if no element matches.\n *\n * Dispatches to the `findIndex` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> Number\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Number} The index of the element found, or `-1`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1}, {a: 2}, {a: 3}];\n * R.findIndex(R.propEq('a', 2))(xs); //=> 1\n * R.findIndex(R.propEq('a', 4))(xs); //=> -1\n */\n var findIndex = _curry2(_dispatchable('findIndex', _xfindIndex, function findIndex(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (fn(list[idx])) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }));\n\n /**\n * Returns the last element of the list which matches the predicate, or\n * `undefined` if no element matches.\n *\n * Dispatches to the `findLast` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> a | undefined\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Object} The element found, or `undefined`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1, b: 0}, {a:1, b: 1}];\n * R.findLast(R.propEq('a', 1))(xs); //=> {a: 1, b: 1}\n * R.findLast(R.propEq('a', 4))(xs); //=> undefined\n */\n var findLast = _curry2(_dispatchable('findLast', _xfindLast, function findLast(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n if (fn(list[idx])) {\n return list[idx];\n }\n idx -= 1;\n }\n }));\n\n /**\n * Returns the index of the last element of the list which matches the\n * predicate, or `-1` if no element matches.\n *\n * Dispatches to the `findLastIndex` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> Number\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Number} The index of the element found, or `-1`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1, b: 0}, {a:1, b: 1}];\n * R.findLastIndex(R.propEq('a', 1))(xs); //=> 1\n * R.findLastIndex(R.propEq('a', 4))(xs); //=> -1\n */\n var findLastIndex = _curry2(_dispatchable('findLastIndex', _xfindLastIndex, function findLastIndex(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n if (fn(list[idx])) {\n return idx;\n }\n idx -= 1;\n }\n return -1;\n }));\n\n /**\n * Iterate over an input `list`, calling a provided function `fn` for each\n * element in the list.\n *\n * `fn` receives one argument: *(value)*.\n *\n * Note: `R.forEach` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.forEach` method. For more\n * details on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description\n *\n * Also note that, unlike `Array.prototype.forEach`, Ramda's `forEach` returns\n * the original array. In some libraries this function is named `each`.\n *\n * Dispatches to the `forEach` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> *) -> [a] -> [a]\n * @param {Function} fn The function to invoke. Receives one argument, `value`.\n * @param {Array} list The list to iterate over.\n * @return {Array} The original list.\n * @see R.addIndex\n * @example\n *\n * var printXPlusFive = x => console.log(x + 5);\n * R.forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]\n * //-> 6\n * //-> 7\n * //-> 8\n */\n var forEach = _curry2(_checkForMethod('forEach', function forEach(fn, list) {\n var len = list.length;\n var idx = 0;\n while (idx < len) {\n fn(list[idx]);\n idx += 1;\n }\n return list;\n }));\n\n /**\n * Creates a new object out of a list key-value pairs.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [[k,v]] -> {k: v}\n * @param {Array} pairs An array of two-element arrays that will be the keys and values of the output object.\n * @return {Object} The object made by pairing up `keys` and `values`.\n * @see R.toPairs, R.pair\n * @example\n *\n * R.fromPairs([['a', 1], ['b', 2], ['c', 3]]); //=> {a: 1, b: 2, c: 3}\n */\n var fromPairs = _curry1(function fromPairs(pairs) {\n var idx = 0;\n var len = pairs.length;\n var out = {};\n while (idx < len) {\n if (_isArray(pairs[idx]) && pairs[idx].length) {\n out[pairs[idx][0]] = pairs[idx][1];\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Takes a list and returns a list of lists where each sublist's elements are\n * all \"equal\" according to the provided equality function.\n *\n * @func\n * @memberOf R\n * @since v0.21.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [[a]]\n * @param {Function} fn Function for determining whether two given (adjacent)\n * elements should be in the same group\n * @param {Array} list The array to group. Also accepts a string, which will be\n * treated as a list of characters.\n * @return {List} A list that contains sublists of equal elements,\n * whose concatenations is equal to the original list.\n * @example\n *\n * groupWith(R.equals, [0, 1, 1, 2, 3, 5, 8, 13, 21])\n * // [[0], [1, 1], [2, 3, 5, 8, 13, 21]]\n *\n * groupWith((a, b) => a % 2 === b % 2, [0, 1, 1, 2, 3, 5, 8, 13, 21])\n * // [[0], [1, 1], [2], [3, 5], [8], [13, 21]]\n *\n * R.groupWith(R.eqBy(isVowel), 'aestiou')\n * // ['ae', 'st', 'iou']\n */\n var groupWith = _curry2(function (fn, list) {\n var res = [];\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n var nextidx = idx + 1;\n while (nextidx < len && fn(list[idx], list[nextidx])) {\n nextidx += 1;\n }\n res.push(list.slice(idx, nextidx));\n idx = nextidx;\n }\n return res;\n });\n\n /**\n * Returns `true` if the first argument is greater than the second; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @see R.lt\n * @example\n *\n * R.gt(2, 1); //=> true\n * R.gt(2, 2); //=> false\n * R.gt(2, 3); //=> false\n * R.gt('a', 'z'); //=> false\n * R.gt('z', 'a'); //=> true\n */\n var gt = _curry2(function gt(a, b) {\n return a > b;\n });\n\n /**\n * Returns `true` if the first argument is greater than or equal to the second;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {Number} a\n * @param {Number} b\n * @return {Boolean}\n * @see R.lte\n * @example\n *\n * R.gte(2, 1); //=> true\n * R.gte(2, 2); //=> true\n * R.gte(2, 3); //=> false\n * R.gte('a', 'z'); //=> false\n * R.gte('z', 'a'); //=> true\n */\n var gte = _curry2(function gte(a, b) {\n return a >= b;\n });\n\n /**\n * Returns whether or not an object has an own property with the specified name\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Object\n * @sig s -> {s: x} -> Boolean\n * @param {String} prop The name of the property to check for.\n * @param {Object} obj The object to query.\n * @return {Boolean} Whether the property exists.\n * @example\n *\n * var hasName = R.has('name');\n * hasName({name: 'alice'}); //=> true\n * hasName({name: 'bob'}); //=> true\n * hasName({}); //=> false\n *\n * var point = {x: 0, y: 0};\n * var pointHas = R.has(R.__, point);\n * pointHas('x'); //=> true\n * pointHas('y'); //=> true\n * pointHas('z'); //=> false\n */\n var has = _curry2(_has);\n\n /**\n * Returns whether or not an object or its prototype chain has a property with\n * the specified name\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Object\n * @sig s -> {s: x} -> Boolean\n * @param {String} prop The name of the property to check for.\n * @param {Object} obj The object to query.\n * @return {Boolean} Whether the property exists.\n * @example\n *\n * function Rectangle(width, height) {\n * this.width = width;\n * this.height = height;\n * }\n * Rectangle.prototype.area = function() {\n * return this.width * this.height;\n * };\n *\n * var square = new Rectangle(2, 2);\n * R.hasIn('width', square); //=> true\n * R.hasIn('area', square); //=> true\n */\n var hasIn = _curry2(function hasIn(prop, obj) {\n return prop in obj;\n });\n\n /**\n * Returns true if its arguments are identical, false otherwise. Values are\n * identical if they reference the same memory. `NaN` is identical to `NaN`;\n * `0` and `-0` are not identical.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * var o = {};\n * R.identical(o, o); //=> true\n * R.identical(1, 1); //=> true\n * R.identical(1, '1'); //=> false\n * R.identical([], []); //=> false\n * R.identical(0, -0); //=> false\n * R.identical(NaN, NaN); //=> true\n */\n // SameValue algorithm\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Step 6.a: NaN == NaN\n var identical = _curry2(function identical(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n });\n\n /**\n * A function that does nothing but return the parameter supplied to it. Good\n * as a default or placeholder function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> a\n * @param {*} x The value to return.\n * @return {*} The input value, `x`.\n * @example\n *\n * R.identity(1); //=> 1\n *\n * var obj = {};\n * R.identity(obj) === obj; //=> true\n */\n var identity = _curry1(_identity);\n\n /**\n * Creates a function that will process either the `onTrue` or the `onFalse`\n * function depending upon the result of the `condition` predicate.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)\n * @param {Function} condition A predicate function\n * @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value.\n * @param {Function} onFalse A function to invoke when the `condition` evaluates to a falsy value.\n * @return {Function} A new unary function that will process either the `onTrue` or the `onFalse`\n * function depending upon the result of the `condition` predicate.\n * @see R.unless, R.when\n * @example\n *\n * var incCount = R.ifElse(\n * R.has('count'),\n * R.over(R.lensProp('count'), R.inc),\n * R.assoc('count', 1)\n * );\n * incCount({}); //=> { count: 1 }\n * incCount({ count: 1 }); //=> { count: 2 }\n */\n var ifElse = _curry3(function ifElse(condition, onTrue, onFalse) {\n return curryN(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {\n return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);\n });\n });\n\n /**\n * Increments its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @see R.dec\n * @example\n *\n * R.inc(42); //=> 43\n */\n var inc = add(1);\n\n /**\n * Inserts the supplied element into the list, at index `index`. _Note that\n * this is not destructive_: it returns a copy of the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.2.2\n * @category List\n * @sig Number -> a -> [a] -> [a]\n * @param {Number} index The position to insert the element\n * @param {*} elt The element to insert into the Array\n * @param {Array} list The list to insert into\n * @return {Array} A new Array with `elt` inserted at `index`.\n * @example\n *\n * R.insert(2, 'x', [1,2,3,4]); //=> [1,2,'x',3,4]\n */\n var insert = _curry3(function insert(idx, elt, list) {\n idx = idx < list.length && idx >= 0 ? idx : list.length;\n var result = _slice(list);\n result.splice(idx, 0, elt);\n return result;\n });\n\n /**\n * Inserts the sub-list into the list, at index `index`. _Note that this is not\n * destructive_: it returns a copy of the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig Number -> [a] -> [a] -> [a]\n * @param {Number} index The position to insert the sub-list\n * @param {Array} elts The sub-list to insert into the Array\n * @param {Array} list The list to insert the sub-list into\n * @return {Array} A new Array with `elts` inserted starting at `index`.\n * @example\n *\n * R.insertAll(2, ['x','y','z'], [1,2,3,4]); //=> [1,2,'x','y','z',3,4]\n */\n var insertAll = _curry3(function insertAll(idx, elts, list) {\n idx = idx < list.length && idx >= 0 ? idx : list.length;\n return _concat(_concat(_slice(list, 0, idx), elts), _slice(list, idx));\n });\n\n /**\n * Creates a new list with the separator interposed between elements.\n *\n * Dispatches to the `intersperse` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} separator The element to add to the list.\n * @param {Array} list The list to be interposed.\n * @return {Array} The new list.\n * @example\n *\n * R.intersperse('n', ['ba', 'a', 'a']); //=> ['ba', 'n', 'a', 'n', 'a']\n */\n var intersperse = _curry2(_checkForMethod('intersperse', function intersperse(separator, list) {\n var out = [];\n var idx = 0;\n var length = list.length;\n while (idx < length) {\n if (idx === length - 1) {\n out.push(list[idx]);\n } else {\n out.push(list[idx], separator);\n }\n idx += 1;\n }\n return out;\n }));\n\n /**\n * See if an object (`val`) is an instance of the supplied constructor. This\n * function will check up the inheritance chain, if any.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Type\n * @sig (* -> {*}) -> a -> Boolean\n * @param {Object} ctor A constructor\n * @param {*} val The value to test\n * @return {Boolean}\n * @example\n *\n * R.is(Object, {}); //=> true\n * R.is(Number, 1); //=> true\n * R.is(Object, 1); //=> false\n * R.is(String, 's'); //=> true\n * R.is(String, new String('')); //=> true\n * R.is(Object, new String('')); //=> true\n * R.is(Object, 's'); //=> false\n * R.is(Number, {}); //=> false\n */\n var is = _curry2(function is(Ctor, val) {\n return val != null && val.constructor === Ctor || val instanceof Ctor;\n });\n\n /**\n * Tests whether or not an object is similar to an array.\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Type\n * @category List\n * @sig * -> Boolean\n * @param {*} x The object to test.\n * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.\n * @example\n *\n * R.isArrayLike([]); //=> true\n * R.isArrayLike(true); //=> false\n * R.isArrayLike({}); //=> false\n * R.isArrayLike({length: 10}); //=> false\n * R.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true\n */\n var isArrayLike = _curry1(function isArrayLike(x) {\n if (_isArray(x)) {\n return true;\n }\n if (!x) {\n return false;\n }\n if (typeof x !== 'object') {\n return false;\n }\n if (x instanceof String) {\n return false;\n }\n if (x.nodeType === 1) {\n return !!x.length;\n }\n if (x.length === 0) {\n return true;\n }\n if (x.length > 0) {\n return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);\n }\n return false;\n });\n\n /**\n * Checks if the input value is `null` or `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Type\n * @sig * -> Boolean\n * @param {*} x The value to test.\n * @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.\n * @example\n *\n * R.isNil(null); //=> true\n * R.isNil(undefined); //=> true\n * R.isNil(0); //=> false\n * R.isNil([]); //=> false\n */\n var isNil = _curry1(function isNil(x) {\n return x == null;\n });\n\n /**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\n // cover IE < 9 keys issues\n // Safari bug\n var keys = function () {\n // cover IE < 9 keys issues\n var hasEnumBug = !{ toString: null }.propertyIsEnumerable('toString');\n var nonEnumerableProps = [\n 'constructor',\n 'valueOf',\n 'isPrototypeOf',\n 'toString',\n 'propertyIsEnumerable',\n 'hasOwnProperty',\n 'toLocaleString'\n ];\n // Safari bug\n var hasArgsEnumBug = function () {\n 'use strict';\n return arguments.propertyIsEnumerable('length');\n }();\n var contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n };\n return typeof Object.keys === 'function' && !hasArgsEnumBug ? _curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n }) : _curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n });\n }();\n\n /**\n * Returns a list containing the names of all the properties of the supplied\n * object, including prototype properties.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.keysIn(f); //=> ['x', 'y']\n */\n var keysIn = _curry1(function keysIn(obj) {\n var prop;\n var ks = [];\n for (prop in obj) {\n ks[ks.length] = prop;\n }\n return ks;\n });\n\n /**\n * Returns the number of elements in the array by returning `list.length`.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [a] -> Number\n * @param {Array} list The array to inspect.\n * @return {Number} The length of the array.\n * @example\n *\n * R.length([]); //=> 0\n * R.length([1, 2, 3]); //=> 3\n */\n var length = _curry1(function length(list) {\n return list != null && is(Number, list.length) ? list.length : NaN;\n });\n\n /**\n * Returns `true` if the first argument is less than the second; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @see R.gt\n * @example\n *\n * R.lt(2, 1); //=> false\n * R.lt(2, 2); //=> false\n * R.lt(2, 3); //=> true\n * R.lt('a', 'z'); //=> true\n * R.lt('z', 'a'); //=> false\n */\n var lt = _curry2(function lt(a, b) {\n return a < b;\n });\n\n /**\n * Returns `true` if the first argument is less than or equal to the second;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {Number} a\n * @param {Number} b\n * @return {Boolean}\n * @see R.gte\n * @example\n *\n * R.lte(2, 1); //=> false\n * R.lte(2, 2); //=> true\n * R.lte(2, 3); //=> true\n * R.lte('a', 'z'); //=> true\n * R.lte('z', 'a'); //=> false\n */\n var lte = _curry2(function lte(a, b) {\n return a <= b;\n });\n\n /**\n * The mapAccum function behaves like a combination of map and reduce; it\n * applies a function to each element of a list, passing an accumulating\n * parameter from left to right, and returning a final value of this\n * accumulator together with the new list.\n *\n * The iterator function receives two arguments, *acc* and *value*, and should\n * return a tuple *[acc, value]*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var digits = ['1', '2', '3', '4'];\n * var appender = (a, b) => [a + b, a + b];\n *\n * R.mapAccum(appender, 0, digits); //=> ['01234', ['01', '012', '0123', '01234']]\n */\n var mapAccum = _curry3(function mapAccum(fn, acc, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n var tuple = [acc];\n while (idx < len) {\n tuple = fn(tuple[0], list[idx]);\n result[idx] = tuple[1];\n idx += 1;\n }\n return [\n tuple[0],\n result\n ];\n });\n\n /**\n * The mapAccumRight function behaves like a combination of map and reduce; it\n * applies a function to each element of a list, passing an accumulating\n * parameter from right to left, and returning a final value of this\n * accumulator together with the new list.\n *\n * Similar to `mapAccum`, except moves through the input list from the right to\n * the left.\n *\n * The iterator function receives two arguments, *acc* and *value*, and should\n * return a tuple *[acc, value]*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var digits = ['1', '2', '3', '4'];\n * var append = (a, b) => [a + b, a + b];\n *\n * R.mapAccumRight(append, 0, digits); //=> ['04321', ['04321', '0432', '043', '04']]\n */\n var mapAccumRight = _curry3(function mapAccumRight(fn, acc, list) {\n var idx = list.length - 1;\n var result = [];\n var tuple = [acc];\n while (idx >= 0) {\n tuple = fn(tuple[0], list[idx]);\n result[idx] = tuple[1];\n idx -= 1;\n }\n return [\n tuple[0],\n result\n ];\n });\n\n /**\n * Tests a regular expression against a String. Note that this function will\n * return an empty array when there are no matches. This differs from\n * [`String.prototype.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\n * which returns `null` when there are no matches.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category String\n * @sig RegExp -> String -> [String | Undefined]\n * @param {RegExp} rx A regular expression.\n * @param {String} str The string to match against\n * @return {Array} The list of matches or empty array.\n * @see R.test\n * @example\n *\n * R.match(/([a-z]a)/g, 'bananas'); //=> ['ba', 'na', 'na']\n * R.match(/a/, 'b'); //=> []\n * R.match(/a/, null); //=> TypeError: null does not have a method named \"match\"\n */\n var match = _curry2(function match(rx, str) {\n return str.match(rx) || [];\n });\n\n /**\n * mathMod behaves like the modulo operator should mathematically, unlike the\n * `%` operator (and by extension, R.modulo). So while \"-17 % 5\" is -2,\n * mathMod(-17, 5) is 3. mathMod requires Integer arguments, and returns NaN\n * when the modulus is zero or negative.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} m The dividend.\n * @param {Number} p the modulus.\n * @return {Number} The result of `b mod a`.\n * @example\n *\n * R.mathMod(-17, 5); //=> 3\n * R.mathMod(17, 5); //=> 2\n * R.mathMod(17, -5); //=> NaN\n * R.mathMod(17, 0); //=> NaN\n * R.mathMod(17.2, 5); //=> NaN\n * R.mathMod(17, 5.3); //=> NaN\n *\n * var clock = R.mathMod(R.__, 12);\n * clock(15); //=> 3\n * clock(24); //=> 0\n *\n * var seventeenMod = R.mathMod(17);\n * seventeenMod(3); //=> 2\n * seventeenMod(4); //=> 1\n * seventeenMod(10); //=> 7\n */\n var mathMod = _curry2(function mathMod(m, p) {\n if (!_isInteger(m)) {\n return NaN;\n }\n if (!_isInteger(p) || p < 1) {\n return NaN;\n }\n return (m % p + p) % p;\n });\n\n /**\n * Returns the larger of its two arguments.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> a\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.maxBy, R.min\n * @example\n *\n * R.max(789, 123); //=> 789\n * R.max('a', 'b'); //=> 'b'\n */\n var max = _curry2(function max(a, b) {\n return b > a ? b : a;\n });\n\n /**\n * Takes a function and two values, and returns whichever value produces the\n * larger result when passed to the provided function.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Relation\n * @sig Ord b => (a -> b) -> a -> a -> a\n * @param {Function} f\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.max, R.minBy\n * @example\n *\n * // square :: Number -> Number\n * var square = n => n * n;\n *\n * R.maxBy(square, -3, 2); //=> -3\n *\n * R.reduce(R.maxBy(square), 0, [3, -5, 4, 1, -2]); //=> -5\n * R.reduce(R.maxBy(square), 0, []); //=> 0\n */\n var maxBy = _curry3(function maxBy(f, a, b) {\n return f(b) > f(a) ? b : a;\n });\n\n /**\n * Create a new object with the own properties of the first object merged with\n * the own properties of the second object. If a key exists in both objects,\n * the value from the second object will be used.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> {k: v} -> {k: v}\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeWith, R.mergeWithKey\n * @example\n *\n * R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });\n * //=> { 'name': 'fred', 'age': 40 }\n *\n * var resetToDefault = R.merge(R.__, {x: 0});\n * resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}\n */\n var merge = _curry2(function merge(l, r) {\n return _assign({}, l, r);\n });\n\n /**\n * Merges a list of objects together into one object.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig [{k: v}] -> {k: v}\n * @param {Array} list An array of objects\n * @return {Object} A merged object.\n * @see R.reduce\n * @example\n *\n * R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3}\n * R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2}\n */\n var mergeAll = _curry1(function mergeAll(list) {\n return _assign.apply(null, [{}].concat(list));\n });\n\n /**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object. The key\n * will be excluded from the returned object if the resulting value is\n * `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig (String -> a -> a -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.merge, R.mergeWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeWithKey(concatValues,\n * { a: true, thing: 'foo', values: [10, 20] },\n * { b: true, thing: 'bar', values: [15, 35] });\n * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n */\n var mergeWithKey = _curry3(function mergeWithKey(fn, l, r) {\n var result = {};\n var k;\n for (k in l) {\n if (_has(k, l)) {\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n }\n }\n for (k in r) {\n if (_has(k, r) && !_has(k, result)) {\n result[k] = r[k];\n }\n }\n return result;\n });\n\n /**\n * Returns the smaller of its two arguments.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> a\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.minBy, R.max\n * @example\n *\n * R.min(789, 123); //=> 123\n * R.min('a', 'b'); //=> 'a'\n */\n var min = _curry2(function min(a, b) {\n return b < a ? b : a;\n });\n\n /**\n * Takes a function and two values, and returns whichever value produces the\n * smaller result when passed to the provided function.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Relation\n * @sig Ord b => (a -> b) -> a -> a -> a\n * @param {Function} f\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.min, R.maxBy\n * @example\n *\n * // square :: Number -> Number\n * var square = n => n * n;\n *\n * R.minBy(square, -3, 2); //=> 2\n *\n * R.reduce(R.minBy(square), Infinity, [3, -5, 4, 1, -2]); //=> 1\n * R.reduce(R.minBy(square), Infinity, []); //=> Infinity\n */\n var minBy = _curry3(function minBy(f, a, b) {\n return f(b) < f(a) ? b : a;\n });\n\n /**\n * Divides the second parameter by the first and returns the remainder. Note\n * that this function preserves the JavaScript-style behavior for modulo. For\n * mathematical modulo see `mathMod`.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The value to the divide.\n * @param {Number} b The pseudo-modulus\n * @return {Number} The result of `b % a`.\n * @see R.mathMod\n * @example\n *\n * R.modulo(17, 3); //=> 2\n * // JS behavior:\n * R.modulo(-17, 3); //=> -2\n * R.modulo(17, -3); //=> 2\n *\n * var isOdd = R.modulo(R.__, 2);\n * isOdd(42); //=> 0\n * isOdd(21); //=> 1\n */\n var modulo = _curry2(function modulo(a, b) {\n return a % b;\n });\n\n /**\n * Multiplies two numbers. Equivalent to `a * b` but curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a * b`.\n * @see R.divide\n * @example\n *\n * var double = R.multiply(2);\n * var triple = R.multiply(3);\n * double(3); //=> 6\n * triple(4); //=> 12\n * R.multiply(2, 5); //=> 10\n */\n var multiply = _curry2(function multiply(a, b) {\n return a * b;\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly `n` parameters. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} n The desired arity of the new function.\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity `n`.\n * @example\n *\n * var takesTwoArgs = (a, b) => [a, b];\n *\n * takesTwoArgs.length; //=> 2\n * takesTwoArgs(1, 2); //=> [1, 2]\n *\n * var takesOneArg = R.nAry(1, takesTwoArgs);\n * takesOneArg.length; //=> 1\n * // Only `n` arguments are passed to the wrapped function\n * takesOneArg(1, 2); //=> [1, undefined]\n */\n var nAry = _curry2(function nAry(n, fn) {\n switch (n) {\n case 0:\n return function () {\n return fn.call(this);\n };\n case 1:\n return function (a0) {\n return fn.call(this, a0);\n };\n case 2:\n return function (a0, a1) {\n return fn.call(this, a0, a1);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.call(this, a0, a1, a2);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.call(this, a0, a1, a2, a3);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.call(this, a0, a1, a2, a3, a4);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.call(this, a0, a1, a2, a3, a4, a5);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n };\n default:\n throw new Error('First argument to nAry must be a non-negative integer no greater than ten');\n }\n });\n\n /**\n * Negates its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @example\n *\n * R.negate(42); //=> -42\n */\n var negate = _curry1(function negate(n) {\n return -n;\n });\n\n /**\n * Returns `true` if no elements of the list match the predicate, `false`\n * otherwise.\n *\n * Dispatches to the `any` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is not satisfied by every element, `false` otherwise.\n * @see R.all, R.any\n * @example\n *\n * var isEven = n => n % 2 === 0;\n *\n * R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true\n * R.none(isEven, [1, 3, 5, 7, 8, 11]); //=> false\n */\n var none = _curry2(_complement(_dispatchable('any', _xany, any)));\n\n /**\n * A function that returns the `!` of its argument. It will return `true` when\n * passed false-y value, and `false` when passed a truth-y one.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> Boolean\n * @param {*} a any value\n * @return {Boolean} the logical inverse of passed argument.\n * @see R.complement\n * @example\n *\n * R.not(true); //=> false\n * R.not(false); //=> true\n * R.not(0); => true\n * R.not(1); => false\n */\n var not = _curry1(function not(a) {\n return !a;\n });\n\n /**\n * Returns the nth element of the given list or string. If n is negative the\n * element at index length + n is returned.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> a | Undefined\n * @sig Number -> String -> String\n * @param {Number} offset\n * @param {*} list\n * @return {*}\n * @example\n *\n * var list = ['foo', 'bar', 'baz', 'quux'];\n * R.nth(1, list); //=> 'bar'\n * R.nth(-1, list); //=> 'quux'\n * R.nth(-99, list); //=> undefined\n *\n * R.nth(2, 'abc'); //=> 'c'\n * R.nth(3, 'abc'); //=> ''\n */\n var nth = _curry2(function nth(offset, list) {\n var idx = offset < 0 ? list.length + offset : offset;\n return _isString(list) ? list.charAt(idx) : list[idx];\n });\n\n /**\n * Returns a function which returns its nth argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig Number -> *... -> *\n * @param {Number} n\n * @return {Function}\n * @example\n *\n * R.nthArg(1)('a', 'b', 'c'); //=> 'b'\n * R.nthArg(-1)('a', 'b', 'c'); //=> 'c'\n */\n var nthArg = _curry1(function nthArg(n) {\n return function () {\n return nth(n, arguments);\n };\n });\n\n /**\n * Creates an object containing a single key:value pair.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Object\n * @sig String -> a -> {String:a}\n * @param {String} key\n * @param {*} val\n * @return {Object}\n * @see R.pair\n * @example\n *\n * var matchPhrases = R.compose(\n * R.objOf('must'),\n * R.map(R.objOf('match_phrase'))\n * );\n * matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}\n */\n var objOf = _curry2(function objOf(key, val) {\n var obj = {};\n obj[key] = val;\n return obj;\n });\n\n /**\n * Returns a singleton array containing the value provided.\n *\n * Note this `of` is different from the ES6 `of`; See\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig a -> [a]\n * @param {*} x any value\n * @return {Array} An array wrapping `x`.\n * @example\n *\n * R.of(null); //=> [null]\n * R.of([42]); //=> [[42]]\n */\n var of = _curry1(_of);\n\n /**\n * Accepts a function `fn` and returns a function that guards invocation of\n * `fn` such that `fn` can only ever be called once, no matter how many times\n * the returned function is invoked. The first value calculated is returned in\n * subsequent invocations.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a... -> b) -> (a... -> b)\n * @param {Function} fn The function to wrap in a call-only-once wrapper.\n * @return {Function} The wrapped function.\n * @example\n *\n * var addOneOnce = R.once(x => x + 1);\n * addOneOnce(10); //=> 11\n * addOneOnce(addOneOnce(50)); //=> 11\n */\n var once = _curry1(function once(fn) {\n var called = false;\n var result;\n return _arity(fn.length, function () {\n if (called) {\n return result;\n }\n called = true;\n result = fn.apply(this, arguments);\n return result;\n });\n });\n\n /**\n * Returns `true` if one or both of its arguments are `true`. Returns `false`\n * if both arguments are `false`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> * -> *\n * @param {Boolean} a A boolean value\n * @param {Boolean} b A boolean value\n * @return {Boolean} `true` if one or both arguments are `true`, `false` otherwise\n * @see R.either\n * @example\n *\n * R.or(true, true); //=> true\n * R.or(true, false); //=> true\n * R.or(false, true); //=> true\n * R.or(false, false); //=> false\n */\n var or = _curry2(function or(a, b) {\n return a || b;\n });\n\n /**\n * Returns the result of \"setting\" the portion of the given data structure\n * focused by the given lens to the result of applying the given function to\n * the focused value.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> (a -> a) -> s -> s\n * @param {Lens} lens\n * @param {*} v\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var headLens = R.lensIndex(0);\n *\n * R.over(headLens, R.toUpper, ['foo', 'bar', 'baz']); //=> ['FOO', 'bar', 'baz']\n */\n // `Identity` is a functor that holds a single value, where `map` simply\n // transforms the held value with the provided function.\n // The value returned by the getter function is first transformed with `f`,\n // then set as the value of an `Identity`. This is then mapped over with the\n // setter function of the lens.\n var over = function () {\n // `Identity` is a functor that holds a single value, where `map` simply\n // transforms the held value with the provided function.\n var Identity = function (x) {\n return {\n value: x,\n map: function (f) {\n return Identity(f(x));\n }\n };\n };\n return _curry3(function over(lens, f, x) {\n // The value returned by the getter function is first transformed with `f`,\n // then set as the value of an `Identity`. This is then mapped over with the\n // setter function of the lens.\n return lens(function (y) {\n return Identity(f(y));\n })(x).value;\n });\n }();\n\n /**\n * Takes two arguments, `fst` and `snd`, and returns `[fst, snd]`.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category List\n * @sig a -> b -> (a,b)\n * @param {*} fst\n * @param {*} snd\n * @return {Array}\n * @see R.objOf, R.of\n * @example\n *\n * R.pair('foo', 'bar'); //=> ['foo', 'bar']\n */\n var pair = _curry2(function pair(fst, snd) {\n return [\n fst,\n snd\n ];\n });\n\n /**\n * Retrieve the value at a given path.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig [String] -> {k: v} -> v | Undefined\n * @param {Array} path The path to use.\n * @param {Object} obj The object to retrieve the nested property from.\n * @return {*} The data at `path`.\n * @example\n *\n * R.path(['a', 'b'], {a: {b: 2}}); //=> 2\n * R.path(['a', 'b'], {c: {b: 2}}); //=> undefined\n */\n var path = _curry2(function path(paths, obj) {\n var val = obj;\n var idx = 0;\n while (idx < paths.length) {\n if (val == null) {\n return;\n }\n val = val[paths[idx]];\n idx += 1;\n }\n return val;\n });\n\n /**\n * If the given, non-null object has a value at the given path, returns the\n * value at that path. Otherwise returns the provided default value.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Object\n * @sig a -> [String] -> Object -> a\n * @param {*} d The default value.\n * @param {Array} p The path to use.\n * @param {Object} obj The object to retrieve the nested property from.\n * @return {*} The data at `path` of the supplied object or the default value.\n * @example\n *\n * R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2\n * R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> \"N/A\"\n */\n var pathOr = _curry3(function pathOr(d, p, obj) {\n return defaultTo(d, path(p, obj));\n });\n\n /**\n * Returns `true` if the specified object property at given path satisfies the\n * given predicate; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Logic\n * @sig (a -> Boolean) -> [String] -> Object -> Boolean\n * @param {Function} pred\n * @param {Array} propPath\n * @param {*} obj\n * @return {Boolean}\n * @see R.propSatisfies, R.path\n * @example\n *\n * R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true\n */\n var pathSatisfies = _curry3(function pathSatisfies(pred, propPath, obj) {\n return propPath.length > 0 && pred(path(propPath, obj));\n });\n\n /**\n * Returns a partial copy of an object containing only the keys specified. If\n * the key does not exist, the property is ignored.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> {k: v}\n * @param {Array} names an array of String property names to copy onto a new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties from `names` on it.\n * @see R.omit, R.props\n * @example\n *\n * R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n * R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1}\n */\n var pick = _curry2(function pick(names, obj) {\n var result = {};\n var idx = 0;\n while (idx < names.length) {\n if (names[idx] in obj) {\n result[names[idx]] = obj[names[idx]];\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Similar to `pick` except that this one includes a `key: undefined` pair for\n * properties that don't exist.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> {k: v}\n * @param {Array} names an array of String property names to copy onto a new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties from `names` on it.\n * @see R.pick\n * @example\n *\n * R.pickAll(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n * R.pickAll(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, e: undefined, f: undefined}\n */\n var pickAll = _curry2(function pickAll(names, obj) {\n var result = {};\n var idx = 0;\n var len = names.length;\n while (idx < len) {\n var name = names[idx];\n result[name] = obj[name];\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns a partial copy of an object containing only the keys that satisfy\n * the supplied predicate.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig (v, k -> Boolean) -> {k: v} -> {k: v}\n * @param {Function} pred A predicate to determine whether or not a key\n * should be included on the output object.\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties that satisfy `pred`\n * on it.\n * @see R.pick, R.filter\n * @example\n *\n * var isUpperCase = (val, key) => key.toUpperCase() === key;\n * R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}\n */\n var pickBy = _curry2(function pickBy(test, obj) {\n var result = {};\n for (var prop in obj) {\n if (test(obj[prop], prop, obj)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n });\n\n /**\n * Returns a new list with the given element at the front, followed by the\n * contents of the list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} el The item to add to the head of the output list.\n * @param {Array} list The array to add to the tail of the output list.\n * @return {Array} A new array.\n * @see R.append\n * @example\n *\n * R.prepend('fee', ['fi', 'fo', 'fum']); //=> ['fee', 'fi', 'fo', 'fum']\n */\n var prepend = _curry2(function prepend(el, list) {\n return _concat([el], list);\n });\n\n /**\n * Returns a function that when supplied an object returns the indicated\n * property of that object, if it exists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig s -> {s: a} -> a | Undefined\n * @param {String} p The property name\n * @param {Object} obj The object to query\n * @return {*} The value at `obj.p`.\n * @example\n *\n * R.prop('x', {x: 100}); //=> 100\n * R.prop('x', {}); //=> undefined\n */\n var prop = _curry2(function prop(p, obj) {\n return obj[p];\n });\n\n /**\n * If the given, non-null object has an own property with the specified name,\n * returns the value of that property. Otherwise returns the provided default\n * value.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Object\n * @sig a -> String -> Object -> a\n * @param {*} val The default value.\n * @param {String} p The name of the property to return.\n * @param {Object} obj The object to query.\n * @return {*} The value of given property of the supplied object or the default value.\n * @example\n *\n * var alice = {\n * name: 'ALICE',\n * age: 101\n * };\n * var favorite = R.prop('favoriteLibrary');\n * var favoriteWithDefault = R.propOr('Ramda', 'favoriteLibrary');\n *\n * favorite(alice); //=> undefined\n * favoriteWithDefault(alice); //=> 'Ramda'\n */\n var propOr = _curry3(function propOr(val, p, obj) {\n return obj != null && _has(p, obj) ? obj[p] : val;\n });\n\n /**\n * Returns `true` if the specified object property satisfies the given\n * predicate; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Logic\n * @sig (a -> Boolean) -> String -> {String: a} -> Boolean\n * @param {Function} pred\n * @param {String} name\n * @param {*} obj\n * @return {Boolean}\n * @see R.propEq, R.propIs\n * @example\n *\n * R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}); //=> true\n */\n var propSatisfies = _curry3(function propSatisfies(pred, name, obj) {\n return pred(obj[name]);\n });\n\n /**\n * Acts as multiple `prop`: array of keys in, array of values out. Preserves\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> [v]\n * @param {Array} ps The property names to fetch\n * @param {Object} obj The object to query\n * @return {Array} The corresponding values or partially applied function.\n * @example\n *\n * R.props(['x', 'y'], {x: 1, y: 2}); //=> [1, 2]\n * R.props(['c', 'a', 'b'], {b: 2, a: 1}); //=> [undefined, 1, 2]\n *\n * var fullName = R.compose(R.join(' '), R.props(['first', 'last']));\n * fullName({last: 'Bullet-Tooth', age: 33, first: 'Tony'}); //=> 'Tony Bullet-Tooth'\n */\n var props = _curry2(function props(ps, obj) {\n var len = ps.length;\n var out = [];\n var idx = 0;\n while (idx < len) {\n out[idx] = obj[ps[idx]];\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a list of numbers from `from` (inclusive) to `to` (exclusive).\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> Number -> [Number]\n * @param {Number} from The first number in the list.\n * @param {Number} to One more than the last number in the list.\n * @return {Array} The list of numbers in tthe set `[a, b)`.\n * @example\n *\n * R.range(1, 5); //=> [1, 2, 3, 4]\n * R.range(50, 53); //=> [50, 51, 52]\n */\n var range = _curry2(function range(from, to) {\n if (!(_isNumber(from) && _isNumber(to))) {\n throw new TypeError('Both arguments to range must be numbers');\n }\n var result = [];\n var n = from;\n while (n < to) {\n result.push(n);\n n += 1;\n }\n return result;\n });\n\n /**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * Similar to `reduce`, except moves through the input list from the right to\n * the left.\n *\n * The iterator function receives two values: *(acc, value)*\n *\n * Note: `R.reduceRight` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight#Description\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,b -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var pairs = [ ['a', 1], ['b', 2], ['c', 3] ];\n * var flattenPairs = (acc, pair) => acc.concat(pair);\n *\n * R.reduceRight(flattenPairs, [], pairs); //=> [ 'c', 3, 'b', 2, 'a', 1 ]\n */\n var reduceRight = _curry3(function reduceRight(fn, acc, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n acc = fn(acc, list[idx]);\n idx -= 1;\n }\n return acc;\n });\n\n /**\n * Returns a value wrapped to indicate that it is the final value of the reduce\n * and transduce functions. The returned value should be considered a black\n * box: the internal structure is not guaranteed to be stable.\n *\n * Note: this optimization is unavailable to functions not explicitly listed\n * above. For instance, it is not currently supported by reduceRight.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category List\n * @sig a -> *\n * @param {*} x The final value of the reduce.\n * @return {*} The wrapped value.\n * @see R.reduce, R.transduce\n * @example\n *\n * R.reduce(\n * R.pipe(R.add, R.when(R.gte(R.__, 10), R.reduced)),\n * 0,\n * [1, 2, 3, 4, 5]) // 10\n */\n var reduced = _curry1(_reduced);\n\n /**\n * Removes the sub-list of `list` starting at index `start` and containing\n * `count` elements. _Note that this is not destructive_: it returns a copy of\n * the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.2.2\n * @category List\n * @sig Number -> Number -> [a] -> [a]\n * @param {Number} start The position to start removing elements\n * @param {Number} count The number of elements to remove\n * @param {Array} list The list to remove from\n * @return {Array} A new Array with `count` elements from `start` removed.\n * @example\n *\n * R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]\n */\n var remove = _curry3(function remove(start, count, list) {\n return _concat(_slice(list, 0, Math.min(start, list.length)), _slice(list, Math.min(list.length, start + count)));\n });\n\n /**\n * Replace a substring or regex match in a string with a replacement.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category String\n * @sig RegExp|String -> String -> String -> String\n * @param {RegExp|String} pattern A regular expression or a substring to match.\n * @param {String} replacement The string to replace the matches with.\n * @param {String} str The String to do the search and replacement in.\n * @return {String} The result.\n * @example\n *\n * R.replace('foo', 'bar', 'foo foo foo'); //=> 'bar foo foo'\n * R.replace(/foo/, 'bar', 'foo foo foo'); //=> 'bar foo foo'\n *\n * // Use the \"g\" (global) flag to replace all occurrences:\n * R.replace(/foo/g, 'bar', 'foo foo foo'); //=> 'bar bar bar'\n */\n var replace = _curry3(function replace(regex, replacement, str) {\n return str.replace(regex, replacement);\n });\n\n /**\n * Returns a new list or string with the elements or characters in reverse\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {Array|String} list\n * @return {Array|String}\n * @example\n *\n * R.reverse([1, 2, 3]); //=> [3, 2, 1]\n * R.reverse([1, 2]); //=> [2, 1]\n * R.reverse([1]); //=> [1]\n * R.reverse([]); //=> []\n *\n * R.reverse('abc'); //=> 'cba'\n * R.reverse('ab'); //=> 'ba'\n * R.reverse('a'); //=> 'a'\n * R.reverse(''); //=> ''\n */\n var reverse = _curry1(function reverse(list) {\n return _isString(list) ? list.split('').reverse().join('') : _slice(list).reverse();\n });\n\n /**\n * Scan is similar to reduce, but returns a list of successively reduced values\n * from the left\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (a,b -> a) -> a -> [b] -> [a]\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {Array} A list of all intermediately reduced values.\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var factorials = R.scan(R.multiply, 1, numbers); //=> [1, 1, 2, 6, 24]\n */\n var scan = _curry3(function scan(fn, acc, list) {\n var idx = 0;\n var len = list.length;\n var result = [acc];\n while (idx < len) {\n acc = fn(acc, list[idx]);\n result[idx + 1] = acc;\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns the result of \"setting\" the portion of the given data structure\n * focused by the given lens to the given value.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> a -> s -> s\n * @param {Lens} lens\n * @param {*} v\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.set(xLens, 8, {x: 1, y: 2}); //=> {x: 8, y: 2}\n */\n var set = _curry3(function set(lens, v, x) {\n return over(lens, always(v), x);\n });\n\n /**\n * Returns the elements of the given list or string (or object with a `slice`\n * method) from `fromIndex` (inclusive) to `toIndex` (exclusive).\n *\n * Dispatches to the `slice` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig Number -> Number -> [a] -> [a]\n * @sig Number -> Number -> String -> String\n * @param {Number} fromIndex The start index (inclusive).\n * @param {Number} toIndex The end index (exclusive).\n * @param {*} list\n * @return {*}\n * @example\n *\n * R.slice(1, 3, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n * R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']\n * R.slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']\n * R.slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n * R.slice(0, 3, 'ramda'); //=> 'ram'\n */\n var slice = _curry3(_checkForMethod('slice', function slice(fromIndex, toIndex, list) {\n return Array.prototype.slice.call(list, fromIndex, toIndex);\n }));\n\n /**\n * Returns a copy of the list, sorted according to the comparator function,\n * which should accept two values at a time and return a negative number if the\n * first value is smaller, a positive number if it's larger, and zero if they\n * are equal. Please note that this is a **copy** of the list. It does not\n * modify the original.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,a -> Number) -> [a] -> [a]\n * @param {Function} comparator A sorting function :: a -> b -> Int\n * @param {Array} list The list to sort\n * @return {Array} a new array with its elements sorted by the comparator function.\n * @example\n *\n * var diff = function(a, b) { return a - b; };\n * R.sort(diff, [4,2,7,5]); //=> [2, 4, 5, 7]\n */\n var sort = _curry2(function sort(comparator, list) {\n return _slice(list).sort(comparator);\n });\n\n /**\n * Sorts the list according to the supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord b => (a -> b) -> [a] -> [a]\n * @param {Function} fn\n * @param {Array} list The list to sort.\n * @return {Array} A new list sorted by the keys generated by `fn`.\n * @example\n *\n * var sortByFirstItem = R.sortBy(R.prop(0));\n * var sortByNameCaseInsensitive = R.sortBy(R.compose(R.toLower, R.prop('name')));\n * var pairs = [[-1, 1], [-2, 2], [-3, 3]];\n * sortByFirstItem(pairs); //=> [[-3, 3], [-2, 2], [-1, 1]]\n * var alice = {\n * name: 'ALICE',\n * age: 101\n * };\n * var bob = {\n * name: 'Bob',\n * age: -10\n * };\n * var clara = {\n * name: 'clara',\n * age: 314.159\n * };\n * var people = [clara, bob, alice];\n * sortByNameCaseInsensitive(people); //=> [alice, bob, clara]\n */\n var sortBy = _curry2(function sortBy(fn, list) {\n return _slice(list).sort(function (a, b) {\n var aa = fn(a);\n var bb = fn(b);\n return aa < bb ? -1 : aa > bb ? 1 : 0;\n });\n });\n\n /**\n * Splits a given list or string at a given index.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig Number -> [a] -> [[a], [a]]\n * @sig Number -> String -> [String, String]\n * @param {Number} index The index where the array/string is split.\n * @param {Array|String} array The array/string to be split.\n * @return {Array}\n * @example\n *\n * R.splitAt(1, [1, 2, 3]); //=> [[1], [2, 3]]\n * R.splitAt(5, 'hello world'); //=> ['hello', ' world']\n * R.splitAt(-1, 'foobar'); //=> ['fooba', 'r']\n */\n var splitAt = _curry2(function splitAt(index, array) {\n return [\n slice(0, index, array),\n slice(index, length(array), array)\n ];\n });\n\n /**\n * Splits a collection into slices of the specified length.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [[a]]\n * @sig Number -> String -> [String]\n * @param {Number} n\n * @param {Array} list\n * @return {Array}\n * @example\n *\n * R.splitEvery(3, [1, 2, 3, 4, 5, 6, 7]); //=> [[1, 2, 3], [4, 5, 6], [7]]\n * R.splitEvery(3, 'foobarbaz'); //=> ['foo', 'bar', 'baz']\n */\n var splitEvery = _curry2(function splitEvery(n, list) {\n if (n <= 0) {\n throw new Error('First argument to splitEvery must be a positive integer');\n }\n var result = [];\n var idx = 0;\n while (idx < list.length) {\n result.push(slice(idx, idx += n, list));\n }\n return result;\n });\n\n /**\n * Takes a list and a predicate and returns a pair of lists with the following properties:\n *\n * - the result of concatenating the two output lists is equivalent to the input list;\n * - none of the elements of the first output list satisfies the predicate; and\n * - if the second output list is non-empty, its first element satisfies the predicate.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [[a], [a]]\n * @param {Function} pred The predicate that determines where the array is split.\n * @param {Array} list The array to be split.\n * @return {Array}\n * @example\n *\n * R.splitWhen(R.equals(2), [1, 2, 3, 1, 2, 3]); //=> [[1], [2, 3, 1, 2, 3]]\n */\n var splitWhen = _curry2(function splitWhen(pred, list) {\n var idx = 0;\n var len = list.length;\n var prefix = [];\n while (idx < len && !pred(list[idx])) {\n prefix.push(list[idx]);\n idx += 1;\n }\n return [\n prefix,\n _slice(list, idx)\n ];\n });\n\n /**\n * Subtracts its second argument from its first argument.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a - b`.\n * @see R.add\n * @example\n *\n * R.subtract(10, 8); //=> 2\n *\n * var minus5 = R.subtract(R.__, 5);\n * minus5(17); //=> 12\n *\n * var complementaryAngle = R.subtract(90);\n * complementaryAngle(30); //=> 60\n * complementaryAngle(72); //=> 18\n */\n var subtract = _curry2(function subtract(a, b) {\n return Number(a) - Number(b);\n });\n\n /**\n * Returns all but the first element of the given list or string (or object\n * with a `tail` method).\n *\n * Dispatches to the `slice` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.head, R.init, R.last\n * @example\n *\n * R.tail([1, 2, 3]); //=> [2, 3]\n * R.tail([1, 2]); //=> [2]\n * R.tail([1]); //=> []\n * R.tail([]); //=> []\n *\n * R.tail('abc'); //=> 'bc'\n * R.tail('ab'); //=> 'b'\n * R.tail('a'); //=> ''\n * R.tail(''); //=> ''\n */\n var tail = _checkForMethod('tail', slice(1, Infinity));\n\n /**\n * Returns the first `n` elements of the given list, string, or\n * transducer/transformer (or object with a `take` method).\n *\n * Dispatches to the `take` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n\n * @param {*} list\n * @return {*}\n * @see R.drop\n * @example\n *\n * R.take(1, ['foo', 'bar', 'baz']); //=> ['foo']\n * R.take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n * R.take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(3, 'ramda'); //=> 'ram'\n *\n * var personnel = [\n * 'Dave Brubeck',\n * 'Paul Desmond',\n * 'Eugene Wright',\n * 'Joe Morello',\n * 'Gerry Mulligan',\n * 'Bob Bates',\n * 'Joe Dodge',\n * 'Ron Crotty'\n * ];\n *\n * var takeFive = R.take(5);\n * takeFive(personnel);\n * //=> ['Dave Brubeck', 'Paul Desmond', 'Eugene Wright', 'Joe Morello', 'Gerry Mulligan']\n */\n var take = _curry2(_dispatchable('take', _xtake, function take(n, xs) {\n return slice(0, n < 0 ? Infinity : n, xs);\n }));\n\n /**\n * Returns a new list containing the last `n` elements of a given list, passing\n * each value to the supplied predicate function, and terminating when the\n * predicate function returns `false`. Excludes the element that caused the\n * predicate function to fail. The predicate function is passed one argument:\n * *(value)*.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.dropLastWhile, R.addIndex\n * @example\n *\n * var isNotOne = x => x !== 1;\n *\n * R.takeLastWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]\n */\n var takeLastWhile = _curry2(function takeLastWhile(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0 && fn(list[idx])) {\n idx -= 1;\n }\n return _slice(list, idx + 1, Infinity);\n });\n\n /**\n * Returns a new list containing the first `n` elements of a given list,\n * passing each value to the supplied predicate function, and terminating when\n * the predicate function returns `false`. Excludes the element that caused the\n * predicate function to fail. The predicate function is passed one argument:\n * *(value)*.\n *\n * Dispatches to the `takeWhile` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.dropWhile, R.transduce, R.addIndex\n * @example\n *\n * var isNotFour = x => x !== 4;\n *\n * R.takeWhile(isNotFour, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3]\n */\n var takeWhile = _curry2(_dispatchable('takeWhile', _xtakeWhile, function takeWhile(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len && fn(list[idx])) {\n idx += 1;\n }\n return _slice(list, 0, idx);\n }));\n\n /**\n * Runs the given function with the supplied object, then returns the object.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a -> *) -> a -> a\n * @param {Function} fn The function to call with `x`. The return value of `fn` will be thrown away.\n * @param {*} x\n * @return {*} `x`.\n * @example\n *\n * var sayX = x => console.log('x is ' + x);\n * R.tap(sayX, 100); //=> 100\n * //-> 'x is 100'\n */\n var tap = _curry2(function tap(fn, x) {\n fn(x);\n return x;\n });\n\n /**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @func\n * @memberOf R\n * @since v0.2.3\n * @category List\n * @sig (Number -> a) -> Number -> [a]\n * @param {Function} fn The function to invoke. Passed one argument, the current value of `n`.\n * @param {Number} n A value between `0` and `n - 1`. Increments after each function call.\n * @return {Array} An array containing the return values of all calls to `fn`.\n * @example\n *\n * R.times(R.identity, 5); //=> [0, 1, 2, 3, 4]\n */\n var times = _curry2(function times(fn, n) {\n var len = Number(n);\n var idx = 0;\n var list;\n if (len < 0 || isNaN(len)) {\n throw new RangeError('n must be a non-negative number');\n }\n list = new Array(len);\n while (idx < len) {\n list[idx] = fn(idx);\n idx += 1;\n }\n return list;\n });\n\n /**\n * Converts an object into an array of key, value arrays. Only the object's\n * own properties are used.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Object\n * @sig {String: *} -> [[String,*]]\n * @param {Object} obj The object to extract from\n * @return {Array} An array of key, value arrays from the object's own properties.\n * @see R.fromPairs\n * @example\n *\n * R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]\n */\n var toPairs = _curry1(function toPairs(obj) {\n var pairs = [];\n for (var prop in obj) {\n if (_has(prop, obj)) {\n pairs[pairs.length] = [\n prop,\n obj[prop]\n ];\n }\n }\n return pairs;\n });\n\n /**\n * Converts an object into an array of key, value arrays. The object's own\n * properties and prototype properties are used. Note that the order of the\n * output array is not guaranteed to be consistent across different JS\n * platforms.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Object\n * @sig {String: *} -> [[String,*]]\n * @param {Object} obj The object to extract from\n * @return {Array} An array of key, value arrays from the object's own\n * and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.toPairsIn(f); //=> [['x','X'], ['y','Y']]\n */\n var toPairsIn = _curry1(function toPairsIn(obj) {\n var pairs = [];\n for (var prop in obj) {\n pairs[pairs.length] = [\n prop,\n obj[prop]\n ];\n }\n return pairs;\n });\n\n /**\n * Transposes the rows and columns of a 2D list.\n * When passed a list of `n` lists of length `x`,\n * returns a list of `x` lists of length `n`.\n *\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig [[a]] -> [[a]]\n * @param {Array} list A 2D list\n * @return {Array} A 2D list\n * @example\n *\n * R.transpose([[1, 'a'], [2, 'b'], [3, 'c']]) //=> [[1, 2, 3], ['a', 'b', 'c']]\n * R.transpose([[1, 2, 3], ['a', 'b', 'c']]) //=> [[1, 'a'], [2, 'b'], [3, 'c']]\n *\n * If some of the rows are shorter than the following rows, their elements are skipped:\n *\n * R.transpose([[10, 11], [20], [], [30, 31, 32]]) //=> [[10, 20, 30], [11, 31], [32]]\n */\n var transpose = _curry1(function transpose(outerlist) {\n var i = 0;\n var result = [];\n while (i < outerlist.length) {\n var innerlist = outerlist[i];\n var j = 0;\n while (j < innerlist.length) {\n if (typeof result[j] === 'undefined') {\n result[j] = [];\n }\n result[j].push(innerlist[j]);\n j += 1;\n }\n i += 1;\n }\n return result;\n });\n\n /**\n * Removes (strips) whitespace from both ends of the string.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to trim.\n * @return {String} Trimmed version of `str`.\n * @example\n *\n * R.trim(' xyz '); //=> 'xyz'\n * R.map(R.trim, R.split(',', 'x, y, z')); //=> ['x', 'y', 'z']\n */\n var trim = function () {\n var ws = '\\t\\n\\x0B\\f\\r \\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' + '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028' + '\\u2029\\uFEFF';\n var zeroWidth = '\\u200B';\n var hasProtoTrim = typeof String.prototype.trim === 'function';\n if (!hasProtoTrim || (ws.trim() || !zeroWidth.trim())) {\n return _curry1(function trim(str) {\n var beginRx = new RegExp('^[' + ws + '][' + ws + ']*');\n var endRx = new RegExp('[' + ws + '][' + ws + ']*$');\n return str.replace(beginRx, '').replace(endRx, '');\n });\n } else {\n return _curry1(function trim(str) {\n return str.trim();\n });\n }\n }();\n\n /**\n * `tryCatch` takes two functions, a `tryer` and a `catcher`. The returned\n * function evaluates the `tryer`; if it does not throw, it simply returns the\n * result. If the `tryer` *does* throw, the returned function evaluates the\n * `catcher` function and returns its result. Note that for effective\n * composition with this function, both the `tryer` and `catcher` functions\n * must return the same type of results.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Function\n * @sig (...x -> a) -> ((e, ...x) -> a) -> (...x -> a)\n * @param {Function} tryer The function that may throw.\n * @param {Function} catcher The function that will be evaluated if `tryer` throws.\n * @return {Function} A new function that will catch exceptions and send then to the catcher.\n * @example\n *\n * R.tryCatch(R.prop('x'), R.F, {x: true}); //=> true\n * R.tryCatch(R.prop('x'), R.F, null); //=> false\n */\n var tryCatch = _curry2(function _tryCatch(tryer, catcher) {\n return _arity(tryer.length, function () {\n try {\n return tryer.apply(this, arguments);\n } catch (e) {\n return catcher.apply(this, _concat([e], arguments));\n }\n });\n });\n\n /**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n */\n var type = _curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n });\n\n /**\n * Takes a function `fn`, which takes a single array argument, and returns a\n * function which:\n *\n * - takes any number of positional arguments;\n * - passes these arguments to `fn` as an array; and\n * - returns the result.\n *\n * In other words, R.unapply derives a variadic function from a function which\n * takes an array. R.unapply is the inverse of R.apply.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Function\n * @sig ([*...] -> a) -> (*... -> a)\n * @param {Function} fn\n * @return {Function}\n * @see R.apply\n * @example\n *\n * R.unapply(JSON.stringify)(1, 2, 3); //=> '[1,2,3]'\n */\n var unapply = _curry1(function unapply(fn) {\n return function () {\n return fn(_slice(arguments));\n };\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly 1 parameter. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Function\n * @sig (* -> b) -> (a -> b)\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity 1.\n * @example\n *\n * var takesTwoArgs = function(a, b) {\n * return [a, b];\n * };\n * takesTwoArgs.length; //=> 2\n * takesTwoArgs(1, 2); //=> [1, 2]\n *\n * var takesOneArg = R.unary(takesTwoArgs);\n * takesOneArg.length; //=> 1\n * // Only 1 argument is passed to the wrapped function\n * takesOneArg(1, 2); //=> [1, undefined]\n */\n var unary = _curry1(function unary(fn) {\n return nAry(1, fn);\n });\n\n /**\n * Returns a function of arity `n` from a (manually) curried function.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Function\n * @sig Number -> (a -> b) -> (a -> c)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to uncurry.\n * @return {Function} A new function.\n * @see R.curry\n * @example\n *\n * var addFour = a => b => c => d => a + b + c + d;\n *\n * var uncurriedAddFour = R.uncurryN(4, addFour);\n * uncurriedAddFour(1, 2, 3, 4); //=> 10\n */\n var uncurryN = _curry2(function uncurryN(depth, fn) {\n return curryN(depth, function () {\n var currentDepth = 1;\n var value = fn;\n var idx = 0;\n var endIdx;\n while (currentDepth <= depth && typeof value === 'function') {\n endIdx = currentDepth === depth ? arguments.length : idx + value.length;\n value = value.apply(this, _slice(arguments, idx, endIdx));\n currentDepth += 1;\n idx = endIdx;\n }\n return value;\n });\n });\n\n /**\n * Builds a list from a seed value. Accepts an iterator function, which returns\n * either false to stop iteration or an array of length 2 containing the value\n * to add to the resulting list and the seed to be used in the next call to the\n * iterator function.\n *\n * The iterator function receives one argument: *(seed)*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (a -> [b]) -> * -> [b]\n * @param {Function} fn The iterator function. receives one argument, `seed`, and returns\n * either false to quit iteration or an array of length two to proceed. The element\n * at index 0 of this array will be added to the resulting array, and the element\n * at index 1 will be passed to the next call to `fn`.\n * @param {*} seed The seed value.\n * @return {Array} The final list.\n * @example\n *\n * var f = n => n > 50 ? false : [-n, n + 10];\n * R.unfold(f, 10); //=> [-10, -20, -30, -40, -50]\n */\n var unfold = _curry2(function unfold(fn, seed) {\n var pair = fn(seed);\n var result = [];\n while (pair && pair.length) {\n result[result.length] = pair[0];\n pair = fn(pair[1]);\n }\n return result;\n });\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list, based upon the value returned by applying the supplied predicate to\n * two list elements. Prefers the first item if two items compare equal based\n * on the predicate.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * var strEq = R.eqBy(String);\n * R.uniqWith(strEq)([1, '1', 2, 1]); //=> [1, 2]\n * R.uniqWith(strEq)([{}, {}]); //=> [{}]\n * R.uniqWith(strEq)([1, '1', 1]); //=> [1]\n * R.uniqWith(strEq)(['1', 1, 1]); //=> ['1']\n */\n var uniqWith = _curry2(function uniqWith(pred, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n var item;\n while (idx < len) {\n item = list[idx];\n if (!_containsWith(pred, item, result)) {\n result[result.length] = item;\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Tests the final argument by passing it to the given predicate function. If\n * the predicate is not satisfied, the function will return the result of\n * calling the `whenFalseFn` function with the same argument. If the predicate\n * is satisfied, the argument is returned as is.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} whenFalseFn A function to invoke when the `pred` evaluates\n * to a falsy value.\n * @param {*} x An object to test with the `pred` function and\n * pass to `whenFalseFn` if necessary.\n * @return {*} Either `x` or the result of applying `x` to `whenFalseFn`.\n * @see R.ifElse, R.when\n * @example\n *\n * // coerceArray :: (a|[a]) -> [a]\n * var coerceArray = R.unless(R.isArrayLike, R.of);\n * coerceArray([1, 2, 3]); //=> [1, 2, 3]\n * coerceArray(1); //=> [1]\n */\n var unless = _curry3(function unless(pred, whenFalseFn, x) {\n return pred(x) ? x : whenFalseFn(x);\n });\n\n /**\n * Takes a predicate, a transformation function, and an initial value,\n * and returns a value of the same type as the initial value.\n * It does so by applying the transformation until the predicate is satisfied,\n * at which point it returns the satisfactory value.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} fn The iterator function\n * @param {*} init Initial value\n * @return {*} Final value that satisfies predicate\n * @example\n *\n * R.until(R.gt(R.__, 100), R.multiply(2))(1) // => 128\n */\n var until = _curry3(function until(pred, fn, init) {\n var val = init;\n while (!pred(val)) {\n val = fn(val);\n }\n return val;\n });\n\n /**\n * Returns a new copy of the array with the element at the provided index\n * replaced with the given value.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig Number -> a -> [a] -> [a]\n * @param {Number} idx The index to update.\n * @param {*} x The value to exist at the given index of the returned array.\n * @param {Array|Arguments} list The source array-like object to be updated.\n * @return {Array} A copy of `list` with the value at index `idx` replaced with `x`.\n * @see R.adjust\n * @example\n *\n * R.update(1, 11, [0, 1, 2]); //=> [0, 11, 2]\n * R.update(1)(11)([0, 1, 2]); //=> [0, 11, 2]\n */\n var update = _curry3(function update(idx, x, list) {\n return adjust(always(x), idx, list);\n });\n\n /**\n * Accepts a function `fn` and a list of transformer functions and returns a\n * new curried function. When the new function is invoked, it calls the\n * function `fn` with parameters consisting of the result of calling each\n * supplied handler on successive arguments to the new function.\n *\n * If more arguments are passed to the returned function than transformer\n * functions, those arguments are passed directly to `fn` as additional\n * parameters. If you expect additional arguments that don't need to be\n * transformed, although you can ignore them, it's best to pass an identity\n * function so that the new function reports the correct arity.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (x1 -> x2 -> ... -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)\n * @param {Function} fn The function to wrap.\n * @param {Array} transformers A list of transformer functions\n * @return {Function} The wrapped function.\n * @example\n *\n * R.useWith(Math.pow, [R.identity, R.identity])(3, 4); //=> 81\n * R.useWith(Math.pow, [R.identity, R.identity])(3)(4); //=> 81\n * R.useWith(Math.pow, [R.dec, R.inc])(3, 4); //=> 32\n * R.useWith(Math.pow, [R.dec, R.inc])(3)(4); //=> 32\n */\n var useWith = _curry2(function useWith(fn, transformers) {\n return curryN(transformers.length, function () {\n var args = [];\n var idx = 0;\n while (idx < transformers.length) {\n args.push(transformers[idx].call(this, arguments[idx]));\n idx += 1;\n }\n return fn.apply(this, args.concat(_slice(arguments, transformers.length)));\n });\n });\n\n /**\n * Returns a list of all the enumerable own properties of the supplied object.\n * Note that the order of the output array is not guaranteed across different\n * JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own properties.\n * @example\n *\n * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]\n */\n var values = _curry1(function values(obj) {\n var props = keys(obj);\n var len = props.length;\n var vals = [];\n var idx = 0;\n while (idx < len) {\n vals[idx] = obj[props[idx]];\n idx += 1;\n }\n return vals;\n });\n\n /**\n * Returns a list of all the properties, including prototype properties, of the\n * supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.valuesIn(f); //=> ['X', 'Y']\n */\n var valuesIn = _curry1(function valuesIn(obj) {\n var prop;\n var vs = [];\n for (prop in obj) {\n vs[vs.length] = obj[prop];\n }\n return vs;\n });\n\n /**\n * Returns a \"view\" of the given data structure, determined by the given lens.\n * The lens's focus determines which portion of the data structure is visible.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> s -> a\n * @param {Lens} lens\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.view(xLens, {x: 4, y: 2}); //=> 4\n */\n // `Const` is a functor that effectively ignores the function given to `map`.\n // Using `Const` effectively ignores the setter function of the `lens`,\n // leaving the value returned by the getter function unmodified.\n var view = function () {\n // `Const` is a functor that effectively ignores the function given to `map`.\n var Const = function (x) {\n return {\n value: x,\n map: function () {\n return this;\n }\n };\n };\n return _curry2(function view(lens, x) {\n // Using `Const` effectively ignores the setter function of the `lens`,\n // leaving the value returned by the getter function unmodified.\n return lens(Const)(x).value;\n });\n }();\n\n /**\n * Tests the final argument by passing it to the given predicate function. If\n * the predicate is satisfied, the function will return the result of calling\n * the `whenTrueFn` function with the same argument. If the predicate is not\n * satisfied, the argument is returned as is.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} whenTrueFn A function to invoke when the `condition`\n * evaluates to a truthy value.\n * @param {*} x An object to test with the `pred` function and\n * pass to `whenTrueFn` if necessary.\n * @return {*} Either `x` or the result of applying `x` to `whenTrueFn`.\n * @see R.ifElse, R.unless\n * @example\n *\n * // truncate :: String -> String\n * var truncate = R.when(\n * R.propSatisfies(R.gt(R.__, 10), 'length'),\n * R.pipe(R.take(10), R.append('…'), R.join(''))\n * );\n * truncate('12345'); //=> '12345'\n * truncate('0123456789ABC'); //=> '0123456789…'\n */\n var when = _curry3(function when(pred, whenTrueFn, x) {\n return pred(x) ? whenTrueFn(x) : x;\n });\n\n /**\n * Takes a spec object and a test object; returns true if the test satisfies\n * the spec. Each of the spec's own properties must be a predicate function.\n * Each predicate is applied to the value of the corresponding property of the\n * test object. `where` returns true if all the predicates return true, false\n * otherwise.\n *\n * `where` is well suited to declaratively expressing constraints for other\n * functions such as `filter` and `find`.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category Object\n * @sig {String: (* -> Boolean)} -> {String: *} -> Boolean\n * @param {Object} spec\n * @param {Object} testObj\n * @return {Boolean}\n * @example\n *\n * // pred :: Object -> Boolean\n * var pred = R.where({\n * a: R.equals('foo'),\n * b: R.complement(R.equals('bar')),\n * x: R.gt(_, 10),\n * y: R.lt(_, 20)\n * });\n *\n * pred({a: 'foo', b: 'xxx', x: 11, y: 19}); //=> true\n * pred({a: 'xxx', b: 'xxx', x: 11, y: 19}); //=> false\n * pred({a: 'foo', b: 'bar', x: 11, y: 19}); //=> false\n * pred({a: 'foo', b: 'xxx', x: 10, y: 19}); //=> false\n * pred({a: 'foo', b: 'xxx', x: 11, y: 20}); //=> false\n */\n var where = _curry2(function where(spec, testObj) {\n for (var prop in spec) {\n if (_has(prop, spec) && !spec[prop](testObj[prop])) {\n return false;\n }\n }\n return true;\n });\n\n /**\n * Wrap a function inside another to allow you to make adjustments to the\n * parameters, or do other processing either before the internal function is\n * called or with its results.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a... -> b) -> ((a... -> b) -> a... -> c) -> (a... -> c)\n * @param {Function} fn The function to wrap.\n * @param {Function} wrapper The wrapper function.\n * @return {Function} The wrapped function.\n * @example\n *\n * var greet = name => 'Hello ' + name;\n *\n * var shoutedGreet = R.wrap(greet, (gr, name) => gr(name).toUpperCase());\n *\n * shoutedGreet(\"Kathy\"); //=> \"HELLO KATHY\"\n *\n * var shortenedGreet = R.wrap(greet, function(gr, name) {\n * return gr(name.substring(0, 3));\n * });\n * shortenedGreet(\"Robert\"); //=> \"Hello Rob\"\n */\n var wrap = _curry2(function wrap(fn, wrapper) {\n return curryN(fn.length, function () {\n return wrapper.apply(this, _concat([fn], arguments));\n });\n });\n\n /**\n * Creates a new list out of the two supplied by creating each possible pair\n * from the lists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b] -> [[a,b]]\n * @param {Array} as The first list.\n * @param {Array} bs The second list.\n * @return {Array} The list made by combining each possible pair from\n * `as` and `bs` into pairs (`[a, b]`).\n * @example\n *\n * R.xprod([1, 2], ['a', 'b']); //=> [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]\n */\n // = xprodWith(prepend); (takes about 3 times as long...)\n var xprod = _curry2(function xprod(a, b) {\n // = xprodWith(prepend); (takes about 3 times as long...)\n var idx = 0;\n var ilen = a.length;\n var j;\n var jlen = b.length;\n var result = [];\n while (idx < ilen) {\n j = 0;\n while (j < jlen) {\n result[result.length] = [\n a[idx],\n b[j]\n ];\n j += 1;\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Creates a new list out of the two supplied by pairing up equally-positioned\n * items from both lists. The returned list is truncated to the length of the\n * shorter of the two input lists.\n * Note: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b] -> [[a,b]]\n * @param {Array} list1 The first array to consider.\n * @param {Array} list2 The second array to consider.\n * @return {Array} The list made by pairing up same-indexed elements of `list1` and `list2`.\n * @example\n *\n * R.zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]\n */\n var zip = _curry2(function zip(a, b) {\n var rv = [];\n var idx = 0;\n var len = Math.min(a.length, b.length);\n while (idx < len) {\n rv[idx] = [\n a[idx],\n b[idx]\n ];\n idx += 1;\n }\n return rv;\n });\n\n /**\n * Creates a new object out of a list of keys and a list of values.\n * Key/value pairing is truncated to the length of the shorter of the two lists.\n * Note: `zipObj` is equivalent to `pipe(zipWith(pair), fromPairs)`.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [String] -> [*] -> {String: *}\n * @param {Array} keys The array that will be properties on the output object.\n * @param {Array} values The list of values on the output object.\n * @return {Object} The object made by pairing up same-indexed elements of `keys` and `values`.\n * @example\n *\n * R.zipObj(['a', 'b', 'c'], [1, 2, 3]); //=> {a: 1, b: 2, c: 3}\n */\n var zipObj = _curry2(function zipObj(keys, values) {\n var idx = 0;\n var len = Math.min(keys.length, values.length);\n var out = {};\n while (idx < len) {\n out[keys[idx]] = values[idx];\n idx += 1;\n }\n return out;\n });\n\n /**\n * Creates a new list out of the two supplied by applying the function to each\n * equally-positioned pair in the lists. The returned list is truncated to the\n * length of the shorter of the two input lists.\n *\n * @function\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,b -> c) -> [a] -> [b] -> [c]\n * @param {Function} fn The function used to combine the two elements into one value.\n * @param {Array} list1 The first array to consider.\n * @param {Array} list2 The second array to consider.\n * @return {Array} The list made by combining same-indexed elements of `list1` and `list2`\n * using `fn`.\n * @example\n *\n * var f = (x, y) => {\n * // ...\n * };\n * R.zipWith(f, [1, 2, 3], ['a', 'b', 'c']);\n * //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]\n */\n var zipWith = _curry3(function zipWith(fn, a, b) {\n var rv = [];\n var idx = 0;\n var len = Math.min(a.length, b.length);\n while (idx < len) {\n rv[idx] = fn(a[idx], b[idx]);\n idx += 1;\n }\n return rv;\n });\n\n /**\n * A function that always returns `false`. Any passed in parameters are ignored.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig * -> Boolean\n * @param {*}\n * @return {Boolean}\n * @see R.always, R.T\n * @example\n *\n * R.F(); //=> false\n */\n var F = always(false);\n\n /**\n * A function that always returns `true`. Any passed in parameters are ignored.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig * -> Boolean\n * @param {*}\n * @return {Boolean}\n * @see R.always, R.F\n * @example\n *\n * R.T(); //=> true\n */\n var T = always(true);\n\n /**\n * Copies an object.\n *\n * @private\n * @param {*} value The value to be copied\n * @param {Array} refFrom Array containing the source references\n * @param {Array} refTo Array containing the copied source references\n * @param {Boolean} deep Whether or not to perform deep cloning.\n * @return {*} The copied value.\n */\n var _clone = function _clone(value, refFrom, refTo, deep) {\n var copy = function copy(copiedValue) {\n var len = refFrom.length;\n var idx = 0;\n while (idx < len) {\n if (value === refFrom[idx]) {\n return refTo[idx];\n }\n idx += 1;\n }\n refFrom[idx + 1] = value;\n refTo[idx + 1] = copiedValue;\n for (var key in value) {\n copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];\n }\n return copiedValue;\n };\n switch (type(value)) {\n case 'Object':\n return copy({});\n case 'Array':\n return copy([]);\n case 'Date':\n return new Date(value.valueOf());\n case 'RegExp':\n return _cloneRegExp(value);\n default:\n return value;\n }\n };\n\n var _createPartialApplicator = function _createPartialApplicator(concat) {\n return _curry2(function (fn, args) {\n return _arity(Math.max(0, fn.length - args.length), function () {\n return fn.apply(this, concat(args, arguments));\n });\n });\n };\n\n var _dropLast = function dropLast(n, xs) {\n return take(n < xs.length ? xs.length - n : 0, xs);\n };\n\n // Values of other types are only equal if identical.\n var _equals = function _equals(a, b, stackA, stackB) {\n if (identical(a, b)) {\n return true;\n }\n if (type(a) !== type(b)) {\n return false;\n }\n if (a == null || b == null) {\n return false;\n }\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n switch (type(a)) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && identical(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!identical(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n case 'Map':\n case 'Set':\n if (!_equals(_arrayFromIterator(a.entries()), _arrayFromIterator(b.entries()), stackA, stackB)) {\n return false;\n }\n break;\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n break;\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n stackA.push(a);\n stackB.push(b);\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], stackA, stackB))) {\n return false;\n }\n idx -= 1;\n }\n stackA.pop();\n stackB.pop();\n return true;\n };\n\n /**\n * `_makeFlat` is a helper function that returns a one-level or fully recursive\n * function based on the flag passed in.\n *\n * @private\n */\n var _makeFlat = function _makeFlat(recursive) {\n return function flatt(list) {\n var value, jlen, j;\n var result = [];\n var idx = 0;\n var ilen = list.length;\n while (idx < ilen) {\n if (isArrayLike(list[idx])) {\n value = recursive ? flatt(list[idx]) : list[idx];\n j = 0;\n jlen = value.length;\n while (j < jlen) {\n result[result.length] = value[j];\n j += 1;\n }\n } else {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n return result;\n };\n };\n\n var _reduce = function () {\n function _arrayReduce(xf, acc, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n acc = xf['@@transducer/step'](acc, list[idx]);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n idx += 1;\n }\n return xf['@@transducer/result'](acc);\n }\n function _iterableReduce(xf, acc, iter) {\n var step = iter.next();\n while (!step.done) {\n acc = xf['@@transducer/step'](acc, step.value);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n step = iter.next();\n }\n return xf['@@transducer/result'](acc);\n }\n function _methodReduce(xf, acc, obj) {\n return xf['@@transducer/result'](obj.reduce(bind(xf['@@transducer/step'], xf), acc));\n }\n var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';\n return function _reduce(fn, acc, list) {\n if (typeof fn === 'function') {\n fn = _xwrap(fn);\n }\n if (isArrayLike(list)) {\n return _arrayReduce(fn, acc, list);\n }\n if (typeof list.reduce === 'function') {\n return _methodReduce(fn, acc, list);\n }\n if (list[symIterator] != null) {\n return _iterableReduce(fn, acc, list[symIterator]());\n }\n if (typeof list.next === 'function') {\n return _iterableReduce(fn, acc, list);\n }\n throw new TypeError('reduce: list must be array or iterable');\n };\n }();\n\n var _stepCat = function () {\n var _stepCatArray = {\n '@@transducer/init': Array,\n '@@transducer/step': function (xs, x) {\n xs.push(x);\n return xs;\n },\n '@@transducer/result': _identity\n };\n var _stepCatString = {\n '@@transducer/init': String,\n '@@transducer/step': function (a, b) {\n return a + b;\n },\n '@@transducer/result': _identity\n };\n var _stepCatObject = {\n '@@transducer/init': Object,\n '@@transducer/step': function (result, input) {\n return _assign(result, isArrayLike(input) ? objOf(input[0], input[1]) : input);\n },\n '@@transducer/result': _identity\n };\n return function _stepCat(obj) {\n if (_isTransformer(obj)) {\n return obj;\n }\n if (isArrayLike(obj)) {\n return _stepCatArray;\n }\n if (typeof obj === 'string') {\n return _stepCatString;\n }\n if (typeof obj === 'object') {\n return _stepCatObject;\n }\n throw new Error('Cannot create transformer for ' + obj);\n };\n }();\n\n var _xdropLastWhile = function () {\n function XDropLastWhile(fn, xf) {\n this.f = fn;\n this.retained = [];\n this.xf = xf;\n }\n XDropLastWhile.prototype['@@transducer/init'] = _xfBase.init;\n XDropLastWhile.prototype['@@transducer/result'] = function (result) {\n this.retained = null;\n return this.xf['@@transducer/result'](result);\n };\n XDropLastWhile.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.retain(result, input) : this.flush(result, input);\n };\n XDropLastWhile.prototype.flush = function (result, input) {\n result = _reduce(this.xf['@@transducer/step'], result, this.retained);\n this.retained = [];\n return this.xf['@@transducer/step'](result, input);\n };\n XDropLastWhile.prototype.retain = function (result, input) {\n this.retained.push(input);\n return result;\n };\n return _curry2(function _xdropLastWhile(fn, xf) {\n return new XDropLastWhile(fn, xf);\n });\n }();\n\n var _xgroupBy = function () {\n function XGroupBy(f, xf) {\n this.xf = xf;\n this.f = f;\n this.inputs = {};\n }\n XGroupBy.prototype['@@transducer/init'] = _xfBase.init;\n XGroupBy.prototype['@@transducer/result'] = function (result) {\n var key;\n for (key in this.inputs) {\n if (_has(key, this.inputs)) {\n result = this.xf['@@transducer/step'](result, this.inputs[key]);\n if (result['@@transducer/reduced']) {\n result = result['@@transducer/value'];\n break;\n }\n }\n }\n this.inputs = null;\n return this.xf['@@transducer/result'](result);\n };\n XGroupBy.prototype['@@transducer/step'] = function (result, input) {\n var key = this.f(input);\n this.inputs[key] = this.inputs[key] || [\n key,\n []\n ];\n this.inputs[key][1] = append(input, this.inputs[key][1]);\n return result;\n };\n return _curry2(function _xgroupBy(f, xf) {\n return new XGroupBy(f, xf);\n });\n }();\n\n /**\n * Creates a new list iteration function from an existing one by adding two new\n * parameters to its callback function: the current index, and the entire list.\n *\n * This would turn, for instance, Ramda's simple `map` function into one that\n * more closely resembles `Array.prototype.map`. Note that this will only work\n * for functions in which the iteration callback function is the first\n * parameter, and where the list is the last parameter. (This latter might be\n * unimportant if the list parameter is not used.)\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Function\n * @category List\n * @sig ((a ... -> b) ... -> [a] -> *) -> (a ..., Int, [a] -> b) ... -> [a] -> *)\n * @param {Function} fn A list iteration function that does not pass index or list to its callback\n * @return {Function} An altered list iteration function that passes (item, index, list) to its callback\n * @example\n *\n * var mapIndexed = R.addIndex(R.map);\n * mapIndexed((val, idx) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);\n * //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']\n */\n var addIndex = _curry1(function addIndex(fn) {\n return curryN(fn.length, function () {\n var idx = 0;\n var origFn = arguments[0];\n var list = arguments[arguments.length - 1];\n var args = _slice(arguments);\n args[0] = function () {\n var result = origFn.apply(this, _concat(arguments, [\n idx,\n list\n ]));\n idx += 1;\n return result;\n };\n return fn.apply(this, args);\n });\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly 2 parameters. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Function\n * @sig (* -> c) -> (a, b -> c)\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity 2.\n * @example\n *\n * var takesThreeArgs = function(a, b, c) {\n * return [a, b, c];\n * };\n * takesThreeArgs.length; //=> 3\n * takesThreeArgs(1, 2, 3); //=> [1, 2, 3]\n *\n * var takesTwoArgs = R.binary(takesThreeArgs);\n * takesTwoArgs.length; //=> 2\n * // Only 2 arguments are passed to the wrapped function\n * takesTwoArgs(1, 2, 3); //=> [1, 2, undefined]\n */\n var binary = _curry1(function binary(fn) {\n return nAry(2, fn);\n });\n\n /**\n * Creates a deep copy of the value which may contain (nested) `Array`s and\n * `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are not\n * copied, but assigned by their reference.\n *\n * Dispatches to a `clone` method if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {*} -> {*}\n * @param {*} value The object or array to clone\n * @return {*} A new object or array.\n * @example\n *\n * var objects = [{}, {}, {}];\n * var objectsClone = R.clone(objects);\n * objects[0] === objectsClone[0]; //=> false\n */\n var clone = _curry1(function clone(value) {\n return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);\n });\n\n /**\n * Returns a curried equivalent of the provided function. The curried function\n * has two unusual capabilities. First, its arguments needn't be provided one\n * at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value `R.__` may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is `R.__`, the\n * following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> a) -> (* -> a)\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curryN\n * @example\n *\n * var addFourNumbers = (a, b, c, d) => a + b + c + d;\n *\n * var curriedAddFourNumbers = R.curry(addFourNumbers);\n * var f = curriedAddFourNumbers(1, 2);\n * var g = f(3);\n * g(4); //=> 10\n */\n var curry = _curry1(function curry(fn) {\n return curryN(fn.length, fn);\n });\n\n /**\n * Returns all but the first `n` elements of the given list, string, or\n * transducer/transformer (or object with a `drop` method).\n *\n * Dispatches to the `drop` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n\n * @param {*} list\n * @return {*}\n * @see R.take, R.transduce\n * @example\n *\n * R.drop(1, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n * R.drop(2, ['foo', 'bar', 'baz']); //=> ['baz']\n * R.drop(3, ['foo', 'bar', 'baz']); //=> []\n * R.drop(4, ['foo', 'bar', 'baz']); //=> []\n * R.drop(3, 'ramda'); //=> 'da'\n */\n var drop = _curry2(_dispatchable('drop', _xdrop, function drop(n, xs) {\n return slice(Math.max(0, n), Infinity, xs);\n }));\n\n /**\n * Returns a list containing all but the last `n` elements of the given `list`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n The number of elements of `xs` to skip.\n * @param {Array} xs The collection to consider.\n * @return {Array}\n * @see R.takeLast\n * @example\n *\n * R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n * R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']\n * R.dropLast(3, ['foo', 'bar', 'baz']); //=> []\n * R.dropLast(4, ['foo', 'bar', 'baz']); //=> []\n * R.dropLast(3, 'ramda'); //=> 'ra'\n */\n var dropLast = _curry2(_dispatchable('dropLast', _xdropLast, _dropLast));\n\n /**\n * Returns a new list containing all but last the`n` elements of a given list,\n * passing each value from the right to the supplied predicate function,\n * skipping elements while the predicate function returns `true`. The predicate\n * function is passed one argument: (value)*.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.takeLastWhile, R.addIndex\n * @example\n *\n * var lteThree = x => x <= 3;\n *\n * R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3, 4]\n */\n var dropLastWhile = _curry2(_dispatchable('dropLastWhile', _xdropLastWhile, _dropLastWhile));\n\n /**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * var a = {}; a.v = a;\n * var b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\n var equals = _curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n });\n\n /**\n * Takes a predicate and a \"filterable\", and returns a new filterable of the\n * same type containing the members of the given filterable which satisfy the\n * given predicate.\n *\n * Dispatches to the `filter` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> f a\n * @param {Function} pred\n * @param {Array} filterable\n * @return {Array}\n * @see R.reject, R.transduce, R.addIndex\n * @example\n *\n * var isEven = n => n % 2 === 0;\n *\n * R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]\n *\n * R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}\n */\n // else\n var filter = _curry2(_dispatchable('filter', _xfilter, function (pred, filterable) {\n return _isObject(filterable) ? _reduce(function (acc, key) {\n if (pred(filterable[key])) {\n acc[key] = filterable[key];\n }\n return acc;\n }, {}, keys(filterable)) : // else\n _filter(pred, filterable);\n }));\n\n /**\n * Returns a new list by pulling every item out of it (and all its sub-arrays)\n * and putting them in a new array, depth-first.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b]\n * @param {Array} list The array to consider.\n * @return {Array} The flattened list.\n * @see R.unnest\n * @example\n *\n * R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);\n * //=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n */\n var flatten = _curry1(_makeFlat(true));\n\n /**\n * Returns a new function much like the supplied one, except that the first two\n * arguments' order is reversed.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a -> b -> c -> ... -> z) -> (b -> a -> c -> ... -> z)\n * @param {Function} fn The function to invoke with its first two parameters reversed.\n * @return {*} The result of invoking `fn` with its first two parameters' order reversed.\n * @example\n *\n * var mergeThree = (a, b, c) => [].concat(a, b, c);\n *\n * mergeThree(1, 2, 3); //=> [1, 2, 3]\n *\n * R.flip(mergeThree)(1, 2, 3); //=> [2, 1, 3]\n */\n var flip = _curry1(function flip(fn) {\n return curry(function (a, b) {\n var args = _slice(arguments);\n args[0] = b;\n args[1] = a;\n return fn.apply(this, args);\n });\n });\n\n /**\n * Returns the first element of the given list or string. In some libraries\n * this function is named `first`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> a | Undefined\n * @sig String -> String\n * @param {Array|String} list\n * @return {*}\n * @see R.tail, R.init, R.last\n * @example\n *\n * R.head(['fi', 'fo', 'fum']); //=> 'fi'\n * R.head([]); //=> undefined\n *\n * R.head('abc'); //=> 'a'\n * R.head(''); //=> ''\n */\n var head = nth(0);\n\n /**\n * Returns all but the last element of the given list or string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.last, R.head, R.tail\n * @example\n *\n * R.init([1, 2, 3]); //=> [1, 2]\n * R.init([1, 2]); //=> [1]\n * R.init([1]); //=> []\n * R.init([]); //=> []\n *\n * R.init('abc'); //=> 'ab'\n * R.init('ab'); //=> 'a'\n * R.init('a'); //=> ''\n * R.init(''); //=> ''\n */\n var init = slice(0, -1);\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of those\n * elements common to both lists. Duplication is determined according to the\n * value returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate function that determines whether\n * the two supplied elements are equal.\n * @param {Array} list1 One list of items to compare\n * @param {Array} list2 A second list of items to compare\n * @return {Array} A new list containing those elements common to both lists.\n * @see R.intersection\n * @example\n *\n * var buffaloSpringfield = [\n * {id: 824, name: 'Richie Furay'},\n * {id: 956, name: 'Dewey Martin'},\n * {id: 313, name: 'Bruce Palmer'},\n * {id: 456, name: 'Stephen Stills'},\n * {id: 177, name: 'Neil Young'}\n * ];\n * var csny = [\n * {id: 204, name: 'David Crosby'},\n * {id: 456, name: 'Stephen Stills'},\n * {id: 539, name: 'Graham Nash'},\n * {id: 177, name: 'Neil Young'}\n * ];\n *\n * R.intersectionWith(R.eqBy(R.prop('id')), buffaloSpringfield, csny);\n * //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]\n */\n var intersectionWith = _curry3(function intersectionWith(pred, list1, list2) {\n var lookupList, filteredList;\n if (list1.length > list2.length) {\n lookupList = list1;\n filteredList = list2;\n } else {\n lookupList = list2;\n filteredList = list1;\n }\n var results = [];\n var idx = 0;\n while (idx < filteredList.length) {\n if (_containsWith(pred, filteredList[idx], lookupList)) {\n results[results.length] = filteredList[idx];\n }\n idx += 1;\n }\n return uniqWith(pred, results);\n });\n\n /**\n * Transforms the items of the list with the transducer and appends the\n * transformed items to the accumulator using an appropriate iterator function\n * based on the accumulator type.\n *\n * The accumulator can be an array, string, object or a transformer. Iterated\n * items will be appended to arrays and concatenated to strings. Objects will\n * be merged directly or 2-item arrays will be merged as key, value pairs.\n *\n * The accumulator can also be a transformer object that provides a 2-arity\n * reducing iterator function, step, 0-arity initial value function, init, and\n * 1-arity result extraction function result. The step function is used as the\n * iterator function in reduce. The result function is used to convert the\n * final accumulator into the return type and in most cases is R.identity. The\n * init function is used to provide the initial accumulator.\n *\n * The iteration is performed with R.reduce after initializing the transducer.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig a -> (b -> b) -> [c] -> a\n * @param {*} acc The initial accumulator value.\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var transducer = R.compose(R.map(R.add(1)), R.take(2));\n *\n * R.into([], transducer, numbers); //=> [2, 3]\n *\n * var intoArray = R.into([]);\n * intoArray(transducer, numbers); //=> [2, 3]\n */\n var into = _curry3(function into(acc, xf, list) {\n return _isTransformer(acc) ? _reduce(xf(acc), acc['@@transducer/init'](), list) : _reduce(xf(_stepCat(acc)), _clone(acc, [], [], false), list);\n });\n\n /**\n * Same as R.invertObj, however this accounts for objects with duplicate values\n * by putting the values into an array.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {s: x} -> {x: [ s, ... ]}\n * @param {Object} obj The object or array to invert\n * @return {Object} out A new object with keys\n * in an array.\n * @example\n *\n * var raceResultsByFirstName = {\n * first: 'alice',\n * second: 'jake',\n * third: 'alice',\n * };\n * R.invert(raceResultsByFirstName);\n * //=> { 'alice': ['first', 'third'], 'jake':['second'] }\n */\n var invert = _curry1(function invert(obj) {\n var props = keys(obj);\n var len = props.length;\n var idx = 0;\n var out = {};\n while (idx < len) {\n var key = props[idx];\n var val = obj[key];\n var list = _has(val, out) ? out[val] : out[val] = [];\n list[list.length] = key;\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new object with the keys of the given object as values, and the\n * values of the given object, which are coerced to strings, as keys. Note\n * that the last key found is preferred when handling the same value.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {s: x} -> {x: s}\n * @param {Object} obj The object or array to invert\n * @return {Object} out A new object\n * @example\n *\n * var raceResults = {\n * first: 'alice',\n * second: 'jake'\n * };\n * R.invertObj(raceResults);\n * //=> { 'alice': 'first', 'jake':'second' }\n *\n * // Alternatively:\n * var raceResults = ['alice', 'jake'];\n * R.invertObj(raceResults);\n * //=> { 'alice': '0', 'jake':'1' }\n */\n var invertObj = _curry1(function invertObj(obj) {\n var props = keys(obj);\n var len = props.length;\n var idx = 0;\n var out = {};\n while (idx < len) {\n var key = props[idx];\n out[obj[key]] = key;\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns `true` if the given value is its type's empty value; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig a -> Boolean\n * @param {*} x\n * @return {Boolean}\n * @see R.empty\n * @example\n *\n * R.isEmpty([1, 2, 3]); //=> false\n * R.isEmpty([]); //=> true\n * R.isEmpty(''); //=> true\n * R.isEmpty(null); //=> false\n * R.isEmpty({}); //=> true\n * R.isEmpty({length: 0}); //=> false\n */\n var isEmpty = _curry1(function isEmpty(x) {\n return x != null && equals(x, empty(x));\n });\n\n /**\n * Returns the last element of the given list or string.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig [a] -> a | Undefined\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.init, R.head, R.tail\n * @example\n *\n * R.last(['fi', 'fo', 'fum']); //=> 'fum'\n * R.last([]); //=> undefined\n *\n * R.last('abc'); //=> 'c'\n * R.last(''); //=> ''\n */\n var last = nth(-1);\n\n /**\n * Returns the position of the last occurrence of an item in an array, or -1 if\n * the item is not included in the array. `R.equals` is used to determine\n * equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Number\n * @param {*} target The item to find.\n * @param {Array} xs The array to search in.\n * @return {Number} the index of the target, or -1 if the target is not found.\n * @see R.indexOf\n * @example\n *\n * R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=> 6\n * R.lastIndexOf(10, [1,2,3,4]); //=> -1\n */\n var lastIndexOf = _curry2(function lastIndexOf(target, xs) {\n if (typeof xs.lastIndexOf === 'function' && !_isArray(xs)) {\n return xs.lastIndexOf(target);\n } else {\n var idx = xs.length - 1;\n while (idx >= 0) {\n if (equals(xs[idx], target)) {\n return idx;\n }\n idx -= 1;\n }\n return -1;\n }\n });\n\n /**\n * Takes a function and\n * a [functor](https://github.com/fantasyland/fantasy-land#functor),\n * applies the function to each of the functor's values, and returns\n * a functor of the same shape.\n *\n * Ramda provides suitable `map` implementations for `Array` and `Object`,\n * so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.\n *\n * Dispatches to the `map` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * Also treats functions as functors and will compose them together.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Functor f => (a -> b) -> f a -> f b\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {Array} list The list to be iterated over.\n * @return {Array} The new list.\n * @see R.transduce, R.addIndex\n * @example\n *\n * var double = x => x * 2;\n *\n * R.map(double, [1, 2, 3]); //=> [2, 4, 6]\n *\n * R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}\n */\n var map = _curry2(_dispatchable('map', _xmap, function map(fn, functor) {\n switch (Object.prototype.toString.call(functor)) {\n case '[object Function]':\n return curryN(functor.length, function () {\n return fn.call(this, functor.apply(this, arguments));\n });\n case '[object Object]':\n return _reduce(function (acc, key) {\n acc[key] = fn(functor[key]);\n return acc;\n }, {}, keys(functor));\n default:\n return _map(fn, functor);\n }\n }));\n\n /**\n * An Object-specific version of `map`. The function is applied to three\n * arguments: *(value, key, obj)*. If only the value is significant, use\n * `map` instead.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig ((*, String, Object) -> *) -> Object -> Object\n * @param {Function} fn\n * @param {Object} obj\n * @return {Object}\n * @see R.map\n * @example\n *\n * var values = { x: 1, y: 2, z: 3 };\n * var prependKeyAndDouble = (num, key, obj) => key + (num * 2);\n *\n * R.mapObjIndexed(prependKeyAndDouble, values); //=> { x: 'x2', y: 'y4', z: 'z6' }\n */\n var mapObjIndexed = _curry2(function mapObjIndexed(fn, obj) {\n return _reduce(function (acc, key) {\n acc[key] = fn(obj[key], key, obj);\n return acc;\n }, {}, keys(obj));\n });\n\n /**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the values\n * associated with the key in each object, with the result being used as the\n * value associated with the key in the returned object. The key will be\n * excluded from the returned object if the resulting value is `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig (a -> a -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.merge, R.mergeWithKey\n * @example\n *\n * R.mergeWith(R.concat,\n * { a: true, values: [10, 20] },\n * { b: true, values: [15, 35] });\n * //=> { a: true, b: true, values: [10, 20, 15, 35] }\n */\n var mergeWith = _curry3(function mergeWith(fn, l, r) {\n return mergeWithKey(function (_, _l, _r) {\n return fn(_l, _r);\n }, l, r);\n });\n\n /**\n * Takes a function `f` and a list of arguments, and returns a function `g`.\n * When applied, `g` returns the result of applying `f` to the arguments\n * provided initially followed by the arguments provided to `g`.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)\n * @param {Function} f\n * @param {Array} args\n * @return {Function}\n * @see R.partialRight\n * @example\n *\n * var multiply = (a, b) => a * b;\n * var double = R.partial(multiply, [2]);\n * double(2); //=> 4\n *\n * var greet = (salutation, title, firstName, lastName) =>\n * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n *\n * var sayHello = R.partial(greet, ['Hello']);\n * var sayHelloToMs = R.partial(sayHello, ['Ms.']);\n * sayHelloToMs('Jane', 'Jones'); //=> 'Hello, Ms. Jane Jones!'\n */\n var partial = _createPartialApplicator(_concat);\n\n /**\n * Takes a function `f` and a list of arguments, and returns a function `g`.\n * When applied, `g` returns the result of applying `f` to the arguments\n * provided to `g` followed by the arguments provided initially.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a, b, c, ..., n) -> x) -> [d, e, f, ..., n] -> ((a, b, c, ...) -> x)\n * @param {Function} f\n * @param {Array} args\n * @return {Function}\n * @see R.partial\n * @example\n *\n * var greet = (salutation, title, firstName, lastName) =>\n * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n *\n * var greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);\n *\n * greetMsJaneJones('Hello'); //=> 'Hello, Ms. Jane Jones!'\n */\n var partialRight = _createPartialApplicator(flip(_concat));\n\n /**\n * Determines whether a nested path on an object has a specific value, in\n * `R.equals` terms. Most likely used to filter a list.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Relation\n * @sig [String] -> * -> {String: *} -> Boolean\n * @param {Array} path The path of the nested property to use\n * @param {*} val The value to compare the nested property with\n * @param {Object} obj The object to check the nested property in\n * @return {Boolean} `true` if the value equals the nested object property,\n * `false` otherwise.\n * @example\n *\n * var user1 = { address: { zipCode: 90210 } };\n * var user2 = { address: { zipCode: 55555 } };\n * var user3 = { name: 'Bob' };\n * var users = [ user1, user2, user3 ];\n * var isFamous = R.pathEq(['address', 'zipCode'], 90210);\n * R.filter(isFamous, users); //=> [ user1 ]\n */\n var pathEq = _curry3(function pathEq(_path, val, obj) {\n return equals(path(_path, obj), val);\n });\n\n /**\n * Returns a new list by plucking the same named property off all objects in\n * the list supplied.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig k -> [{k: v}] -> [v]\n * @param {Number|String} key The key name to pluck off of each object.\n * @param {Array} list The array to consider.\n * @return {Array} The list of values for the given key.\n * @see R.props\n * @example\n *\n * R.pluck('a')([{a: 1}, {a: 2}]); //=> [1, 2]\n * R.pluck(0)([[1, 2], [3, 4]]); //=> [1, 3]\n */\n var pluck = _curry2(function pluck(p, list) {\n return map(prop(p), list);\n });\n\n /**\n * Reasonable analog to SQL `select` statement.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @category Relation\n * @sig [k] -> [{k: v}] -> [{k: v}]\n * @param {Array} props The property names to project\n * @param {Array} objs The objects to query\n * @return {Array} An array of objects with just the `props` properties.\n * @example\n *\n * var abby = {name: 'Abby', age: 7, hair: 'blond', grade: 2};\n * var fred = {name: 'Fred', age: 12, hair: 'brown', grade: 7};\n * var kids = [abby, fred];\n * R.project(['name', 'grade'], kids); //=> [{name: 'Abby', grade: 2}, {name: 'Fred', grade: 7}]\n */\n // passing `identity` gives correct arity\n var project = useWith(_map, [\n pickAll,\n identity\n ]);\n\n /**\n * Returns `true` if the specified object property is equal, in `R.equals`\n * terms, to the given value; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig String -> a -> Object -> Boolean\n * @param {String} name\n * @param {*} val\n * @param {*} obj\n * @return {Boolean}\n * @see R.equals, R.propSatisfies\n * @example\n *\n * var abby = {name: 'Abby', age: 7, hair: 'blond'};\n * var fred = {name: 'Fred', age: 12, hair: 'brown'};\n * var rusty = {name: 'Rusty', age: 10, hair: 'brown'};\n * var alois = {name: 'Alois', age: 15, disposition: 'surly'};\n * var kids = [abby, fred, rusty, alois];\n * var hasBrownHair = R.propEq('hair', 'brown');\n * R.filter(hasBrownHair, kids); //=> [fred, rusty]\n */\n var propEq = _curry3(function propEq(name, val, obj) {\n return propSatisfies(equals(val), name, obj);\n });\n\n /**\n * Returns `true` if the specified object property is of the given type;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Type\n * @sig Type -> String -> Object -> Boolean\n * @param {Function} type\n * @param {String} name\n * @param {*} obj\n * @return {Boolean}\n * @see R.is, R.propSatisfies\n * @example\n *\n * R.propIs(Number, 'x', {x: 1, y: 2}); //=> true\n * R.propIs(Number, 'x', {x: 'foo'}); //=> false\n * R.propIs(Number, 'x', {}); //=> false\n */\n var propIs = _curry3(function propIs(type, name, obj) {\n return propSatisfies(is(type), name, obj);\n });\n\n /**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It may use\n * `R.reduced` to shortcut the iteration.\n *\n * Note: `R.reduce` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n *\n * Dispatches to the `reduce` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig ((a, b) -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduced, R.addIndex\n * @example\n *\n * var numbers = [1, 2, 3];\n * var add = (a, b) => a + b;\n *\n * R.reduce(add, 10, numbers); //=> 16\n */\n var reduce = _curry3(_reduce);\n\n /**\n * Groups the elements of the list according to the result of calling\n * the String-returning function `keyFn` on each element and reduces the elements\n * of each group to a single value via the reducer function `valueFn`.\n *\n * This function is basically a more general `groupBy` function.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category List\n * @sig ((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}\n * @param {Function} valueFn The function that reduces the elements of each group to a single\n * value. Receives two values, accumulator for a particular group and the current element.\n * @param {*} acc The (initial) accumulator value for each group.\n * @param {Function} keyFn The function that maps the list's element into a key.\n * @param {Array} list The array to group.\n * @return {Object} An object with the output of `keyFn` for keys, mapped to the output of\n * `valueFn` for elements which produced that key when passed to `keyFn`.\n * @see R.groupBy, R.reduce\n * @example\n *\n * var reduceToNamesBy = R.reduceBy((acc, student) => acc.concat(student.name), []);\n * var namesByGrade = reduceToNamesBy(function(student) {\n * var score = student.score;\n * return score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A';\n * });\n * var students = [{name: 'Lucy', score: 92},\n * {name: 'Drew', score: 85},\n * // ...\n * {name: 'Bart', score: 62}];\n * namesByGrade(students);\n * // {\n * // 'A': ['Lucy'],\n * // 'B': ['Drew']\n * // // ...,\n * // 'F': ['Bart']\n * // }\n */\n var reduceBy = _curryN(4, [], function reduceBy(valueFn, valueAcc, keyFn, list) {\n return _reduce(function (acc, elt) {\n var key = keyFn(elt);\n acc[key] = valueFn(_has(key, acc) ? acc[key] : valueAcc, elt);\n return acc;\n }, {}, list);\n });\n\n /**\n * The complement of `filter`.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> f a\n * @param {Function} pred\n * @param {Array} filterable\n * @return {Array}\n * @see R.filter, R.transduce, R.addIndex\n * @example\n *\n * var isOdd = (n) => n % 2 === 1;\n *\n * R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]\n *\n * R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}\n */\n var reject = _curry2(function reject(pred, filterable) {\n return filter(_complement(pred), filterable);\n });\n\n /**\n * Returns a fixed list of size `n` containing a specified identical value.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig a -> n -> [a]\n * @param {*} value The value to repeat.\n * @param {Number} n The desired size of the output list.\n * @return {Array} A new array containing `n` `value`s.\n * @example\n *\n * R.repeat('hi', 5); //=> ['hi', 'hi', 'hi', 'hi', 'hi']\n *\n * var obj = {};\n * var repeatedObjs = R.repeat(obj, 5); //=> [{}, {}, {}, {}, {}]\n * repeatedObjs[0] === repeatedObjs[1]; //=> true\n */\n var repeat = _curry2(function repeat(value, n) {\n return times(always(value), n);\n });\n\n /**\n * Adds together all the elements of a list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list An array of numbers\n * @return {Number} The sum of all the numbers in the list.\n * @see R.reduce\n * @example\n *\n * R.sum([2,4,6,8,100,1]); //=> 121\n */\n var sum = reduce(add, 0);\n\n /**\n * Returns a new list containing the last `n` elements of the given list.\n * If `n > list.length`, returns a list of `list.length` elements.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n The number of elements to return.\n * @param {Array} xs The collection to consider.\n * @return {Array}\n * @see R.dropLast\n * @example\n *\n * R.takeLast(1, ['foo', 'bar', 'baz']); //=> ['baz']\n * R.takeLast(2, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n * R.takeLast(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.takeLast(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.takeLast(3, 'ramda'); //=> 'mda'\n */\n var takeLast = _curry2(function takeLast(n, xs) {\n return drop(n >= 0 ? xs.length - n : 0, xs);\n });\n\n /**\n * Initializes a transducer using supplied iterator function. Returns a single\n * item by iterating through the list, successively calling the transformed\n * iterator function and passing it an accumulator value and the current value\n * from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It will be\n * wrapped as a transformer to initialize the transducer. A transformer can be\n * passed directly in place of an iterator function. In both cases, iteration\n * may be stopped early with the `R.reduced` function.\n *\n * A transducer is a function that accepts a transformer and returns a\n * transformer and can be composed directly.\n *\n * A transformer is an an object that provides a 2-arity reducing iterator\n * function, step, 0-arity initial value function, init, and 1-arity result\n * extraction function, result. The step function is used as the iterator\n * function in reduce. The result function is used to convert the final\n * accumulator into the return type and in most cases is R.identity. The init\n * function can be used to provide an initial accumulator, but is ignored by\n * transduce.\n *\n * The iteration is performed with R.reduce after initializing the transducer.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig (c -> c) -> (a,b -> a) -> a -> [b] -> a\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array. Wrapped as transformer, if necessary, and used to\n * initialize the transducer\n * @param {*} acc The initial accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduce, R.reduced, R.into\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var transducer = R.compose(R.map(R.add(1)), R.take(2));\n *\n * R.transduce(transducer, R.flip(R.append), [], numbers); //=> [2, 3]\n */\n var transduce = curryN(4, function transduce(xf, fn, acc, list) {\n return _reduce(xf(typeof fn === 'function' ? _xwrap(fn) : fn), acc, list);\n });\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\n * of each list. Duplication is determined according to the value returned by\n * applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The first and second lists concatenated, with\n * duplicates removed.\n * @see R.union\n * @example\n *\n * var l1 = [{a: 1}, {a: 2}];\n * var l2 = [{a: 1}, {a: 4}];\n * R.unionWith(R.eqBy(R.prop('a')), l1, l2); //=> [{a: 1}, {a: 2}, {a: 4}]\n */\n var unionWith = _curry3(function unionWith(pred, list1, list2) {\n return uniqWith(pred, _concat(list1, list2));\n });\n\n /**\n * Takes a spec object and a test object; returns true if the test satisfies\n * the spec, false otherwise. An object satisfies the spec if, for each of the\n * spec's own properties, accessing that property of the object gives the same\n * value (in `R.equals` terms) as accessing that property of the spec.\n *\n * `whereEq` is a specialization of [`where`](#where).\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @sig {String: *} -> {String: *} -> Boolean\n * @param {Object} spec\n * @param {Object} testObj\n * @return {Boolean}\n * @see R.where\n * @example\n *\n * // pred :: Object -> Boolean\n * var pred = R.whereEq({a: 1, b: 2});\n *\n * pred({a: 1}); //=> false\n * pred({a: 1, b: 2}); //=> true\n * pred({a: 1, b: 2, c: 3}); //=> true\n * pred({a: 1, b: 1}); //=> false\n */\n var whereEq = _curry2(function whereEq(spec, testObj) {\n return where(map(equals, spec), testObj);\n });\n\n var _flatCat = function () {\n var preservingReduced = function (xf) {\n return {\n '@@transducer/init': _xfBase.init,\n '@@transducer/result': function (result) {\n return xf['@@transducer/result'](result);\n },\n '@@transducer/step': function (result, input) {\n var ret = xf['@@transducer/step'](result, input);\n return ret['@@transducer/reduced'] ? _forceReduced(ret) : ret;\n }\n };\n };\n return function _xcat(xf) {\n var rxf = preservingReduced(xf);\n return {\n '@@transducer/init': _xfBase.init,\n '@@transducer/result': function (result) {\n return rxf['@@transducer/result'](result);\n },\n '@@transducer/step': function (result, input) {\n return !isArrayLike(input) ? _reduce(rxf, result, [input]) : _reduce(rxf, result, input);\n }\n };\n };\n }();\n\n // Array.prototype.indexOf doesn't exist below IE9\n // manually crawl the list to distinguish between +0 and -0\n // NaN\n // non-zero numbers can utilise Set\n // all these types can utilise Set\n // null can utilise Set\n // anything else not covered above, defer to R.equals\n var _indexOf = function _indexOf(list, a, idx) {\n var inf, item;\n // Array.prototype.indexOf doesn't exist below IE9\n if (typeof list.indexOf === 'function') {\n switch (typeof a) {\n case 'number':\n if (a === 0) {\n // manually crawl the list to distinguish between +0 and -0\n inf = 1 / a;\n while (idx < list.length) {\n item = list[idx];\n if (item === 0 && 1 / item === inf) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n } else if (a !== a) {\n // NaN\n while (idx < list.length) {\n item = list[idx];\n if (typeof item === 'number' && item !== item) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }\n // non-zero numbers can utilise Set\n return list.indexOf(a, idx);\n // all these types can utilise Set\n case 'string':\n case 'boolean':\n case 'function':\n case 'undefined':\n return list.indexOf(a, idx);\n case 'object':\n if (a === null) {\n // null can utilise Set\n return list.indexOf(a, idx);\n }\n }\n }\n // anything else not covered above, defer to R.equals\n while (idx < list.length) {\n if (equals(list[idx], a)) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n };\n\n var _xchain = _curry2(function _xchain(f, xf) {\n return map(f, _flatCat(xf));\n });\n\n /**\n * Takes a list of predicates and returns a predicate that returns true for a\n * given list of arguments if every one of the provided predicates is satisfied\n * by those arguments.\n *\n * The function returned is a curried function whose arity matches that of the\n * highest-arity predicate.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Logic\n * @sig [(*... -> Boolean)] -> (*... -> Boolean)\n * @param {Array} preds\n * @return {Function}\n * @see R.anyPass\n * @example\n *\n * var isQueen = R.propEq('rank', 'Q');\n * var isSpade = R.propEq('suit', '♠︎');\n * var isQueenOfSpades = R.allPass([isQueen, isSpade]);\n *\n * isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false\n * isQueenOfSpades({rank: 'Q', suit: '♠︎'}); //=> true\n */\n var allPass = _curry1(function allPass(preds) {\n return curryN(reduce(max, 0, pluck('length', preds)), function () {\n var idx = 0;\n var len = preds.length;\n while (idx < len) {\n if (!preds[idx].apply(this, arguments)) {\n return false;\n }\n idx += 1;\n }\n return true;\n });\n });\n\n /**\n * Returns `true` if all elements are unique, in `R.equals` terms, otherwise\n * `false`.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category List\n * @sig [a] -> Boolean\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if all elements are unique, else `false`.\n * @deprecated since v0.20.0\n * @example\n *\n * R.allUniq(['1', 1]); //=> true\n * R.allUniq([1, 1]); //=> false\n * R.allUniq([[42], [42]]); //=> false\n */\n var allUniq = _curry1(function allUniq(list) {\n var len = list.length;\n var idx = 0;\n while (idx < len) {\n if (_indexOf(list, list[idx], idx + 1) >= 0) {\n return false;\n }\n idx += 1;\n }\n return true;\n });\n\n /**\n * Takes a list of predicates and returns a predicate that returns true for a\n * given list of arguments if at least one of the provided predicates is\n * satisfied by those arguments.\n *\n * The function returned is a curried function whose arity matches that of the\n * highest-arity predicate.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Logic\n * @sig [(*... -> Boolean)] -> (*... -> Boolean)\n * @param {Array} preds\n * @return {Function}\n * @see R.allPass\n * @example\n *\n * var gte = R.anyPass([R.gt, R.equals]);\n *\n * gte(3, 2); //=> true\n * gte(2, 2); //=> true\n * gte(2, 3); //=> false\n */\n var anyPass = _curry1(function anyPass(preds) {\n return curryN(reduce(max, 0, pluck('length', preds)), function () {\n var idx = 0;\n var len = preds.length;\n while (idx < len) {\n if (preds[idx].apply(this, arguments)) {\n return true;\n }\n idx += 1;\n }\n return false;\n });\n });\n\n /**\n * ap applies a list of functions to a list of values.\n *\n * Dispatches to the `ap` method of the second argument, if present. Also\n * treats functions as applicatives.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig [f] -> [a] -> [f a]\n * @param {Array} fns An array of functions\n * @param {Array} vs An array of values\n * @return {Array} An array of results of applying each of `fns` to all of `vs` in turn.\n * @example\n *\n * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]\n */\n // else\n var ap = _curry2(function ap(applicative, fn) {\n return typeof applicative.ap === 'function' ? applicative.ap(fn) : typeof applicative === 'function' ? curryN(Math.max(applicative.length, fn.length), function () {\n return applicative.apply(this, arguments)(fn.apply(this, arguments));\n }) : // else\n _reduce(function (acc, f) {\n return _concat(acc, map(f, fn));\n }, [], applicative);\n });\n\n /**\n * Given a spec object recursively mapping properties to functions, creates a\n * function producing an object of the same structure, by mapping each property\n * to the result of calling its associated function with the supplied arguments.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Function\n * @sig {k: ((a, b, ..., m) -> v)} -> ((a, b, ..., m) -> {k: v})\n * @param {Object} spec an object recursively mapping properties to functions for\n * producing the values for these properties.\n * @return {Function} A function that returns an object of the same structure\n * as `spec', with each property set to the value returned by calling its\n * associated function with the supplied arguments.\n * @see R.juxt\n * @example\n *\n * var getMetrics = R.applySpec({\n * sum: R.add,\n * nested: { mul: R.multiply }\n * });\n * getMetrics(2, 4); // => { sum: 6, nested: { mul: 8 } }\n */\n var applySpec = _curry1(function applySpec(spec) {\n spec = map(function (v) {\n return typeof v == 'function' ? v : applySpec(v);\n }, spec);\n return curryN(reduce(max, 0, pluck('length', values(spec))), function () {\n var args = arguments;\n return map(function (f) {\n return apply(f, args);\n }, spec);\n });\n });\n\n /**\n * Returns the result of calling its first argument with the remaining\n * arguments. This is occasionally useful as a converging function for\n * `R.converge`: the left branch can produce a function while the right branch\n * produces a value to be passed to that function as an argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig (*... -> a),*... -> a\n * @param {Function} fn The function to apply to the remaining arguments.\n * @param {...*} args Any number of positional arguments.\n * @return {*}\n * @see R.apply\n * @example\n *\n * var indentN = R.pipe(R.times(R.always(' ')),\n * R.join(''),\n * R.replace(/^(?!$)/gm));\n *\n * var format = R.converge(R.call, [\n * R.pipe(R.prop('indent'), indentN),\n * R.prop('value')\n * ]);\n *\n * format({indent: 2, value: 'foo\\nbar\\nbaz\\n'}); //=> ' foo\\n bar\\n baz\\n'\n */\n var call = curry(function call(fn) {\n return fn.apply(this, _slice(arguments, 1));\n });\n\n /**\n * `chain` maps a function over a list and concatenates the results. `chain`\n * is also known as `flatMap` in some libraries\n *\n * Dispatches to the `chain` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig (a -> [b]) -> [a] -> [b]\n * @param {Function} fn\n * @param {Array} list\n * @return {Array}\n * @example\n *\n * var duplicate = n => [n, n];\n * R.chain(duplicate, [1, 2, 3]); //=> [1, 1, 2, 2, 3, 3]\n */\n var chain = _curry2(_dispatchable('chain', _xchain, function chain(fn, monad) {\n if (typeof monad === 'function') {\n return function () {\n return monad.call(this, fn.apply(this, arguments)).apply(this, arguments);\n };\n }\n return _makeFlat(false)(map(fn, monad));\n }));\n\n /**\n * Returns a function, `fn`, which encapsulates if/else-if/else logic.\n * `R.cond` takes a list of [predicate, transform] pairs. All of the arguments\n * to `fn` are applied to each of the predicates in turn until one returns a\n * \"truthy\" value, at which point `fn` returns the result of applying its\n * arguments to the corresponding transformer. If none of the predicates\n * matches, `fn` returns undefined.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Logic\n * @sig [[(*... -> Boolean),(*... -> *)]] -> (*... -> *)\n * @param {Array} pairs\n * @return {Function}\n * @example\n *\n * var fn = R.cond([\n * [R.equals(0), R.always('water freezes at 0°C')],\n * [R.equals(100), R.always('water boils at 100°C')],\n * [R.T, temp => 'nothing special happens at ' + temp + '°C']\n * ]);\n * fn(0); //=> 'water freezes at 0°C'\n * fn(50); //=> 'nothing special happens at 50°C'\n * fn(100); //=> 'water boils at 100°C'\n */\n var cond = _curry1(function cond(pairs) {\n var arity = reduce(max, 0, map(function (pair) {\n return pair[0].length;\n }, pairs));\n return _arity(arity, function () {\n var idx = 0;\n while (idx < pairs.length) {\n if (pairs[idx][0].apply(this, arguments)) {\n return pairs[idx][1].apply(this, arguments);\n }\n idx += 1;\n }\n });\n });\n\n /**\n * Wraps a constructor function inside a curried function that can be called\n * with the same arguments and returns the same type. The arity of the function\n * returned is specified to allow using variadic constructor functions.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Function\n * @sig Number -> (* -> {*}) -> (* -> {*})\n * @param {Number} n The arity of the constructor function.\n * @param {Function} Fn The constructor function to wrap.\n * @return {Function} A wrapped, curried constructor function.\n * @example\n *\n * // Variadic constructor function\n * var Widget = () => {\n * this.children = Array.prototype.slice.call(arguments);\n * // ...\n * };\n * Widget.prototype = {\n * // ...\n * };\n * var allConfigs = [\n * // ...\n * ];\n * R.map(R.constructN(1, Widget), allConfigs); // a list of Widgets\n */\n var constructN = _curry2(function constructN(n, Fn) {\n if (n > 10) {\n throw new Error('Constructor with greater than ten arguments');\n }\n if (n === 0) {\n return function () {\n return new Fn();\n };\n }\n return curry(nAry(n, function ($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {\n switch (arguments.length) {\n case 1:\n return new Fn($0);\n case 2:\n return new Fn($0, $1);\n case 3:\n return new Fn($0, $1, $2);\n case 4:\n return new Fn($0, $1, $2, $3);\n case 5:\n return new Fn($0, $1, $2, $3, $4);\n case 6:\n return new Fn($0, $1, $2, $3, $4, $5);\n case 7:\n return new Fn($0, $1, $2, $3, $4, $5, $6);\n case 8:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7);\n case 9:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8);\n case 10:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8, $9);\n }\n }));\n });\n\n /**\n * Accepts a converging function and a list of branching functions and returns\n * a new function. When invoked, this new function is applied to some\n * arguments, each branching function is applied to those same arguments. The\n * results of each branching function are passed as arguments to the converging\n * function to produce the return value.\n *\n * @func\n * @memberOf R\n * @since v0.4.2\n * @category Function\n * @sig (x1 -> x2 -> ... -> z) -> [(a -> b -> ... -> x1), (a -> b -> ... -> x2), ...] -> (a -> b -> ... -> z)\n * @param {Function} after A function. `after` will be invoked with the return values of\n * `fn1` and `fn2` as its arguments.\n * @param {Array} functions A list of functions.\n * @return {Function} A new function.\n * @example\n *\n * var add = (a, b) => a + b;\n * var multiply = (a, b) => a * b;\n * var subtract = (a, b) => a - b;\n *\n * //≅ multiply( add(1, 2), subtract(1, 2) );\n * R.converge(multiply, [add, subtract])(1, 2); //=> -3\n *\n * var add3 = (a, b, c) => a + b + c;\n * R.converge(add3, [multiply, add, subtract])(1, 2); //=> 4\n */\n var converge = _curry2(function converge(after, fns) {\n return curryN(reduce(max, 0, pluck('length', fns)), function () {\n var args = arguments;\n var context = this;\n return after.apply(context, _map(function (fn) {\n return fn.apply(context, args);\n }, fns));\n });\n });\n\n /**\n * Counts the elements of a list according to how many match each value of a\n * key generated by the supplied function. Returns an object mapping the keys\n * produced by `fn` to the number of occurrences in the list. Note that all\n * keys are coerced to strings because of how JavaScript objects work.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> String) -> [a] -> {*}\n * @param {Function} fn The function used to map values to keys.\n * @param {Array} list The list to count elements from.\n * @return {Object} An object mapping keys to number of occurrences in the list.\n * @example\n *\n * var numbers = [1.0, 1.1, 1.2, 2.0, 3.0, 2.2];\n * var letters = R.split('', 'abcABCaaaBBc');\n * R.countBy(Math.floor)(numbers); //=> {'1': 3, '2': 2, '3': 1}\n * R.countBy(R.toLower)(letters); //=> {'a': 5, 'b': 4, 'c': 3}\n */\n var countBy = reduceBy(function (acc, elem) {\n return acc + 1;\n }, 0);\n\n /**\n * Returns a new list without any consecutively repeating elements. Equality is\n * determined by applying the supplied predicate two consecutive elements. The\n * first element in a series of equal element is the one being preserved.\n *\n * Dispatches to the `dropRepeatsWith` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list The array to consider.\n * @return {Array} `list` without repeating elements.\n * @see R.transduce\n * @example\n *\n * var l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];\n * R.dropRepeatsWith(R.eqBy(Math.abs), l); //=> [1, 3, 4, -5, 3]\n */\n var dropRepeatsWith = _curry2(_dispatchable('dropRepeatsWith', _xdropRepeatsWith, function dropRepeatsWith(pred, list) {\n var result = [];\n var idx = 1;\n var len = list.length;\n if (len !== 0) {\n result[0] = list[0];\n while (idx < len) {\n if (!pred(last(result), list[idx])) {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n }\n return result;\n }));\n\n /**\n * Takes a function and two values in its domain and returns `true` if the\n * values map to the same value in the codomain; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Relation\n * @sig (a -> b) -> a -> a -> Boolean\n * @param {Function} f\n * @param {*} x\n * @param {*} y\n * @return {Boolean}\n * @example\n *\n * R.eqBy(Math.abs, 5, -5); //=> true\n */\n var eqBy = _curry3(function eqBy(f, x, y) {\n return equals(f(x), f(y));\n });\n\n /**\n * Reports whether two objects have the same value, in `R.equals` terms, for\n * the specified property. Useful as a curried predicate.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig k -> {k: v} -> {k: v} -> Boolean\n * @param {String} prop The name of the property to compare\n * @param {Object} obj1\n * @param {Object} obj2\n * @return {Boolean}\n *\n * @example\n *\n * var o1 = { a: 1, b: 2, c: 3, d: 4 };\n * var o2 = { a: 10, b: 20, c: 3, d: 40 };\n * R.eqProps('a', o1, o2); //=> false\n * R.eqProps('c', o1, o2); //=> true\n */\n var eqProps = _curry3(function eqProps(prop, obj1, obj2) {\n return equals(obj1[prop], obj2[prop]);\n });\n\n /**\n * Splits a list into sub-lists stored in an object, based on the result of\n * calling a String-returning function on each element, and grouping the\n * results according to values returned.\n *\n * Dispatches to the `groupBy` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> String) -> [a] -> {String: [a]}\n * @param {Function} fn Function :: a -> String\n * @param {Array} list The array to group\n * @return {Object} An object with the output of `fn` for keys, mapped to arrays of elements\n * that produced that key when passed to `fn`.\n * @see R.transduce\n * @example\n *\n * var byGrade = R.groupBy(function(student) {\n * var score = student.score;\n * return score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A';\n * });\n * var students = [{name: 'Abby', score: 84},\n * {name: 'Eddy', score: 58},\n * // ...\n * {name: 'Jack', score: 69}];\n * byGrade(students);\n * // {\n * // 'A': [{name: 'Dianne', score: 99}],\n * // 'B': [{name: 'Abby', score: 84}]\n * // // ...,\n * // 'F': [{name: 'Eddy', score: 58}]\n * // }\n */\n var groupBy = _curry2(_dispatchable('groupBy', _xgroupBy, reduceBy(function (acc, item) {\n if (acc == null) {\n acc = [];\n }\n acc.push(item);\n return acc;\n }, null)));\n\n /**\n * Given a function that generates a key, turns a list of objects into an\n * object indexing the objects by the given key. Note that if multiple\n * objects generate the same value for the indexing key only the last value\n * will be included in the generated object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (a -> String) -> [{k: v}] -> {k: {k: v}}\n * @param {Function} fn Function :: a -> String\n * @param {Array} array The array of objects to index\n * @return {Object} An object indexing each array element by the given property.\n * @example\n *\n * var list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];\n * R.indexBy(R.prop('id'), list);\n * //=> {abc: {id: 'abc', title: 'B'}, xyz: {id: 'xyz', title: 'A'}}\n */\n var indexBy = reduceBy(function (acc, elem) {\n return elem;\n }, null);\n\n /**\n * Returns the position of the first occurrence of an item in an array, or -1\n * if the item is not included in the array. `R.equals` is used to determine\n * equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Number\n * @param {*} target The item to find.\n * @param {Array} xs The array to search in.\n * @return {Number} the index of the target, or -1 if the target is not found.\n * @see R.lastIndexOf\n * @example\n *\n * R.indexOf(3, [1,2,3,4]); //=> 2\n * R.indexOf(10, [1,2,3,4]); //=> -1\n */\n var indexOf = _curry2(function indexOf(target, xs) {\n return typeof xs.indexOf === 'function' && !_isArray(xs) ? xs.indexOf(target) : _indexOf(xs, target, 0);\n });\n\n /**\n * juxt applies a list of functions to a list of values.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Function\n * @sig [(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])\n * @param {Array} fns An array of functions\n * @return {Function} A function that returns a list of values after applying each of the original `fns` to its parameters.\n * @see R.applySpec\n * @example\n *\n * var range = R.juxt([Math.min, Math.max]);\n * range(3, 4, 9, -3); //=> [-3, 9]\n */\n var juxt = _curry1(function juxt(fns) {\n return converge(_arrayOf, fns);\n });\n\n /**\n * Returns a lens for the given getter and setter functions. The getter \"gets\"\n * the value of the focus; the setter \"sets\" the value of the focus. The setter\n * should not mutate the data structure.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig (s -> a) -> ((a, s) -> s) -> Lens s a\n * @param {Function} getter\n * @param {Function} setter\n * @return {Lens}\n * @see R.view, R.set, R.over, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lens(R.prop('x'), R.assoc('x'));\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}\n */\n var lens = _curry2(function lens(getter, setter) {\n return function (toFunctorFn) {\n return function (target) {\n return map(function (focus) {\n return setter(focus, target);\n }, toFunctorFn(getter(target)));\n };\n };\n });\n\n /**\n * Returns a lens whose focus is the specified index.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Number -> Lens s a\n * @param {Number} n\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var headLens = R.lensIndex(0);\n *\n * R.view(headLens, ['a', 'b', 'c']); //=> 'a'\n * R.set(headLens, 'x', ['a', 'b', 'c']); //=> ['x', 'b', 'c']\n * R.over(headLens, R.toUpper, ['a', 'b', 'c']); //=> ['A', 'b', 'c']\n */\n var lensIndex = _curry1(function lensIndex(n) {\n return lens(nth(n), update(n));\n });\n\n /**\n * Returns a lens whose focus is the specified path.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig [String] -> Lens s a\n * @param {Array} path The path to use.\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var xyLens = R.lensPath(['x', 'y']);\n *\n * R.view(xyLens, {x: {y: 2, z: 3}}); //=> 2\n * R.set(xyLens, 4, {x: {y: 2, z: 3}}); //=> {x: {y: 4, z: 3}}\n * R.over(xyLens, R.negate, {x: {y: 2, z: 3}}); //=> {x: {y: -2, z: 3}}\n */\n var lensPath = _curry1(function lensPath(p) {\n return lens(path(p), assocPath(p));\n });\n\n /**\n * Returns a lens whose focus is the specified property.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig String -> Lens s a\n * @param {String} k\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}\n */\n var lensProp = _curry1(function lensProp(k) {\n return lens(prop(k), assoc(k));\n });\n\n /**\n * \"lifts\" a function to be the specified arity, so that it may \"map over\" that\n * many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig Number -> (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.lift, R.ap\n * @example\n *\n * var madd3 = R.liftN(3, R.curryN(3, (...args) => R.sum(args)));\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n */\n var liftN = _curry2(function liftN(arity, fn) {\n var lifted = curryN(arity, fn);\n return curryN(arity, function () {\n return _reduce(ap, map(lifted, arguments[0]), _slice(arguments, 1));\n });\n });\n\n /**\n * Returns the mean of the given list of numbers.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list\n * @return {Number}\n * @example\n *\n * R.mean([2, 7, 9]); //=> 6\n * R.mean([]); //=> NaN\n */\n var mean = _curry1(function mean(list) {\n return sum(list) / list.length;\n });\n\n /**\n * Returns the median of the given list of numbers.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list\n * @return {Number}\n * @example\n *\n * R.median([2, 9, 7]); //=> 7\n * R.median([7, 2, 10, 9]); //=> 8\n * R.median([]); //=> NaN\n */\n var median = _curry1(function median(list) {\n var len = list.length;\n if (len === 0) {\n return NaN;\n }\n var width = 2 - len % 2;\n var idx = (len - width) / 2;\n return mean(_slice(list).sort(function (a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }).slice(idx, idx + width));\n });\n\n /**\n * Takes a predicate and a list or other \"filterable\" object and returns the\n * pair of filterable objects of the same type of elements which do and do not\n * satisfy, the predicate, respectively.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> [f a, f a]\n * @param {Function} pred A predicate to determine which side the element belongs to.\n * @param {Array} filterable the list (or other filterable) to partition.\n * @return {Array} An array, containing first the subset of elements that satisfy the\n * predicate, and second the subset of elements that do not satisfy.\n * @see R.filter, R.reject\n * @example\n *\n * R.partition(R.contains('s'), ['sss', 'ttt', 'foo', 'bars']);\n * // => [ [ 'sss', 'bars' ], [ 'ttt', 'foo' ] ]\n *\n * R.partition(R.contains('s'), { a: 'sss', b: 'ttt', foo: 'bars' });\n * // => [ { a: 'sss', foo: 'bars' }, { b: 'ttt' } ]\n */\n var partition = juxt([\n filter,\n reject\n ]);\n\n /**\n * Performs left-to-right function composition. The leftmost function may have\n * any arity; the remaining functions must be unary.\n *\n * In some libraries this function is named `sequence`.\n *\n * **Note:** The result of pipe is not automatically curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.compose\n * @example\n *\n * var f = R.pipe(Math.pow, R.negate, R.inc);\n *\n * f(3, 4); // -(3^4) + 1\n */\n var pipe = function pipe() {\n if (arguments.length === 0) {\n throw new Error('pipe requires at least one argument');\n }\n return _arity(arguments[0].length, reduce(_pipe, arguments[0], tail(arguments)));\n };\n\n /**\n * Performs left-to-right composition of one or more Promise-returning\n * functions. The leftmost function may have any arity; the remaining functions\n * must be unary.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.composeP\n * @example\n *\n * // followersForUser :: String -> Promise [User]\n * var followersForUser = R.pipeP(db.getUserById, db.getFollowers);\n */\n var pipeP = function pipeP() {\n if (arguments.length === 0) {\n throw new Error('pipeP requires at least one argument');\n }\n return _arity(arguments[0].length, reduce(_pipeP, arguments[0], tail(arguments)));\n };\n\n /**\n * Multiplies together all the elements of a list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list An array of numbers\n * @return {Number} The product of all the numbers in the list.\n * @see R.reduce\n * @example\n *\n * R.product([2,4,6,8,100,1]); //=> 38400\n */\n var product = reduce(multiply, 1);\n\n /**\n * Transforms a [Traversable](https://github.com/fantasyland/fantasy-land#traversable)\n * of [Applicative](https://github.com/fantasyland/fantasy-land#applicative) into an\n * Applicative of Traversable.\n *\n * Dispatches to the `sequence` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (Applicative f, Traversable t) => (a -> f a) -> t (f a) -> f (t a)\n * @param {Function} of\n * @param {*} traversable\n * @return {*}\n * @see R.traverse\n * @example\n *\n * R.sequence(Maybe.of, [Just(1), Just(2), Just(3)]); //=> Just([1, 2, 3])\n * R.sequence(Maybe.of, [Just(1), Just(2), Nothing()]); //=> Nothing()\n *\n * R.sequence(R.of, Just([1, 2, 3])); //=> [Just(1), Just(2), Just(3)]\n * R.sequence(R.of, Nothing()); //=> [Nothing()]\n */\n var sequence = _curry2(function sequence(of, traversable) {\n return typeof traversable.sequence === 'function' ? traversable.sequence(of) : reduceRight(function (acc, x) {\n return ap(map(prepend, x), acc);\n }, of([]), traversable);\n });\n\n /**\n * Maps an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning\n * function over a [Traversable](https://github.com/fantasyland/fantasy-land#traversable),\n * then uses [`sequence`](#sequence) to transform the resulting Traversable of Applicative\n * into an Applicative of Traversable.\n *\n * Dispatches to the `sequence` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (Applicative f, Traversable t) => (a -> f a) -> (a -> f b) -> t a -> f (t b)\n * @param {Function} of\n * @param {Function} f\n * @param {*} traversable\n * @return {*}\n * @see R.sequence\n * @example\n *\n * // Returns `Nothing` if the given divisor is `0`\n * safeDiv = n => d => d === 0 ? Nothing() : Just(n / d)\n *\n * R.traverse(Maybe.of, safeDiv(10), [2, 4, 5]); //=> Just([5, 2.5, 2])\n * R.traverse(Maybe.of, safeDiv(10), [2, 0, 5]); //=> Nothing\n */\n var traverse = _curry3(function traverse(of, f, traversable) {\n return sequence(of, map(f, traversable));\n });\n\n /**\n * Shorthand for `R.chain(R.identity)`, which removes one level of nesting from\n * any [Chain](https://github.com/fantasyland/fantasy-land#chain).\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig Chain c => c (c a) -> c a\n * @param {*} list\n * @return {*}\n * @see R.flatten, R.chain\n * @example\n *\n * R.unnest([1, [2], [[3]]]); //=> [1, 2, [3]]\n * R.unnest([[1, 2], [3, 4], [5, 6]]); //=> [1, 2, 3, 4, 5, 6]\n */\n var unnest = chain(_identity);\n\n var _contains = function _contains(a, list) {\n return _indexOf(list, a, 0) >= 0;\n };\n\n // mapPairs :: (Object, [String]) -> [String]\n var _toString = function _toString(x, seen) {\n var recur = function recur(y) {\n var xs = seen.concat([x]);\n return _contains(y, xs) ? '' : _toString(y, xs);\n };\n // mapPairs :: (Object, [String]) -> [String]\n var mapPairs = function (obj, keys) {\n return _map(function (k) {\n return _quote(k) + ': ' + recur(obj[k]);\n }, keys.slice().sort());\n };\n switch (Object.prototype.toString.call(x)) {\n case '[object Arguments]':\n return '(function() { return arguments; }(' + _map(recur, x).join(', ') + '))';\n case '[object Array]':\n return '[' + _map(recur, x).concat(mapPairs(x, reject(function (k) {\n return /^\\d+$/.test(k);\n }, keys(x)))).join(', ') + ']';\n case '[object Boolean]':\n return typeof x === 'object' ? 'new Boolean(' + recur(x.valueOf()) + ')' : x.toString();\n case '[object Date]':\n return 'new Date(' + (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString(x))) + ')';\n case '[object Null]':\n return 'null';\n case '[object Number]':\n return typeof x === 'object' ? 'new Number(' + recur(x.valueOf()) + ')' : 1 / x === -Infinity ? '-0' : x.toString(10);\n case '[object String]':\n return typeof x === 'object' ? 'new String(' + recur(x.valueOf()) + ')' : _quote(x);\n case '[object Undefined]':\n return 'undefined';\n default:\n if (typeof x.toString === 'function') {\n var repr = x.toString();\n if (repr !== '[object Object]') {\n return repr;\n }\n }\n return '{' + mapPairs(x, keys(x)).join(', ') + '}';\n }\n };\n\n /**\n * Performs right-to-left function composition. The rightmost function may have\n * any arity; the remaining functions must be unary.\n *\n * **Note:** The result of compose is not automatically curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig ((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.pipe\n * @example\n *\n * var f = R.compose(R.inc, R.negate, Math.pow);\n *\n * f(3, 4); // -(3^4) + 1\n */\n var compose = function compose() {\n if (arguments.length === 0) {\n throw new Error('compose requires at least one argument');\n }\n return pipe.apply(this, reverse(arguments));\n };\n\n /**\n * Returns the right-to-left Kleisli composition of the provided functions,\n * each of which must return a value of a type supported by [`chain`](#chain).\n *\n * `R.composeK(h, g, f)` is equivalent to `R.compose(R.chain(h), R.chain(g), R.chain(f))`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Function\n * @sig Chain m => ((y -> m z), (x -> m y), ..., (a -> m b)) -> (m a -> m z)\n * @param {...Function}\n * @return {Function}\n * @see R.pipeK\n * @example\n *\n * // parseJson :: String -> Maybe *\n * // get :: String -> Object -> Maybe *\n *\n * // getStateCode :: Maybe String -> Maybe String\n * var getStateCode = R.composeK(\n * R.compose(Maybe.of, R.toUpper),\n * get('state'),\n * get('address'),\n * get('user'),\n * parseJson\n * );\n *\n * getStateCode(Maybe.of('{\"user\":{\"address\":{\"state\":\"ny\"}}}'));\n * //=> Just('NY')\n * getStateCode(Maybe.of('[Invalid JSON]'));\n * //=> Nothing()\n */\n var composeK = function composeK() {\n return compose.apply(this, prepend(identity, map(chain, arguments)));\n };\n\n /**\n * Performs right-to-left composition of one or more Promise-returning\n * functions. The rightmost function may have any arity; the remaining\n * functions must be unary.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((y -> Promise z), (x -> Promise y), ..., (a -> Promise b)) -> (a -> Promise z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.pipeP\n * @example\n *\n * // followersForUser :: String -> Promise [User]\n * var followersForUser = R.composeP(db.getFollowers, db.getUserById);\n */\n var composeP = function composeP() {\n if (arguments.length === 0) {\n throw new Error('composeP requires at least one argument');\n }\n return pipeP.apply(this, reverse(arguments));\n };\n\n /**\n * Wraps a constructor function inside a curried function that can be called\n * with the same arguments and returns the same type.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> {*}) -> (* -> {*})\n * @param {Function} Fn The constructor function to wrap.\n * @return {Function} A wrapped, curried constructor function.\n * @example\n *\n * // Constructor function\n * var Widget = config => {\n * // ...\n * };\n * Widget.prototype = {\n * // ...\n * };\n * var allConfigs = [\n * // ...\n * ];\n * R.map(R.construct(Widget), allConfigs); // a list of Widgets\n */\n var construct = _curry1(function construct(Fn) {\n return constructN(Fn.length, Fn);\n });\n\n /**\n * Returns `true` if the specified value is equal, in `R.equals` terms, to at\n * least one element of the given list; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Boolean\n * @param {Object} a The item to compare against.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the item is in the list, `false` otherwise.\n * @see R.any\n * @example\n *\n * R.contains(3, [1, 2, 3]); //=> true\n * R.contains(4, [1, 2, 3]); //=> false\n * R.contains([42], [[42]]); //=> true\n */\n var contains = _curry2(_contains);\n\n /**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.differenceWith\n * @example\n *\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n */\n var difference = _curry2(function difference(first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n while (idx < firstLen) {\n if (!_contains(first[idx], second) && !_contains(first[idx], out)) {\n out[out.length] = first[idx];\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new list without any consecutively repeating elements. `R.equals`\n * is used to determine equality.\n *\n * Dispatches to the `dropRepeats` method of the first argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig [a] -> [a]\n * @param {Array} list The array to consider.\n * @return {Array} `list` without repeating elements.\n * @see R.transduce\n * @example\n *\n * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=> [1, 2, 3, 4, 2]\n */\n var dropRepeats = _curry1(_dispatchable('dropRepeats', _xdropRepeatsWith(equals), dropRepeatsWith(equals)));\n\n /**\n * \"lifts\" a function of arity > 1 so that it may \"map over\" a list, Function or other\n * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.liftN\n * @example\n *\n * var madd3 = R.lift(R.curry((a, b, c) => a + b + c));\n *\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n *\n * var madd5 = R.lift(R.curry((a, b, c, d, e) => a + b + c + d + e));\n *\n * madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24]\n */\n var lift = _curry1(function lift(fn) {\n return liftN(fn.length, fn);\n });\n\n /**\n * Returns a partial copy of an object omitting the keys specified.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [String] -> {String: *} -> {String: *}\n * @param {Array} names an array of String property names to omit from the new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with properties from `names` not on it.\n * @see R.pick\n * @example\n *\n * R.omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}\n */\n var omit = _curry2(function omit(names, obj) {\n var result = {};\n for (var prop in obj) {\n if (!_contains(prop, names)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n });\n\n /**\n * Returns the left-to-right Kleisli composition of the provided functions,\n * each of which must return a value of a type supported by [`chain`](#chain).\n *\n * `R.pipeK(f, g, h)` is equivalent to `R.pipe(R.chain(f), R.chain(g), R.chain(h))`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Function\n * @sig Chain m => ((a -> m b), (b -> m c), ..., (y -> m z)) -> (m a -> m z)\n * @param {...Function}\n * @return {Function}\n * @see R.composeK\n * @example\n *\n * // parseJson :: String -> Maybe *\n * // get :: String -> Object -> Maybe *\n *\n * // getStateCode :: Maybe String -> Maybe String\n * var getStateCode = R.pipeK(\n * parseJson,\n * get('user'),\n * get('address'),\n * get('state'),\n * R.compose(Maybe.of, R.toUpper)\n * );\n *\n * getStateCode(Maybe.of('{\"user\":{\"address\":{\"state\":\"ny\"}}}'));\n * //=> Just('NY')\n * getStateCode(Maybe.of('[Invalid JSON]'));\n * //=> Nothing()\n */\n var pipeK = function pipeK() {\n return composeK.apply(this, reverse(arguments));\n };\n\n /**\n * Returns the string representation of the given value. `eval`'ing the output\n * should result in a value equivalent to the input value. Many of the built-in\n * `toString` methods do not satisfy this requirement.\n *\n * If the given value is an `[object Object]` with a `toString` method other\n * than `Object.prototype.toString`, this method is invoked with no arguments\n * to produce the return value. This means user-defined constructor functions\n * can provide a suitable `toString` method. For example:\n *\n * function Point(x, y) {\n * this.x = x;\n * this.y = y;\n * }\n *\n * Point.prototype.toString = function() {\n * return 'new Point(' + this.x + ', ' + this.y + ')';\n * };\n *\n * R.toString(new Point(1, 2)); //=> 'new Point(1, 2)'\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category String\n * @sig * -> String\n * @param {*} val\n * @return {String}\n * @example\n *\n * R.toString(42); //=> '42'\n * R.toString('abc'); //=> '\"abc\"'\n * R.toString([1, 2, 3]); //=> '[1, 2, 3]'\n * R.toString({foo: 1, bar: 2, baz: 3}); //=> '{\"bar\": 2, \"baz\": 3, \"foo\": 1}'\n * R.toString(new Date('2001-02-03T04:05:06Z')); //=> 'new Date(\"2001-02-03T04:05:06.000Z\")'\n */\n var toString = _curry1(function toString(val) {\n return _toString(val, []);\n });\n\n /**\n * Returns a new list without values in the first argument.\n * `R.equals` is used to determine equality.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig [a] -> [a] -> [a]\n * @param {Array} list1 The values to be removed from `list2`.\n * @param {Array} list2 The array to remove values from.\n * @return {Array} The new array without values in `list1`.\n * @see R.transduce\n * @example\n *\n * R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]\n */\n var without = _curry2(function (xs, list) {\n return reject(flip(_contains)(xs), list);\n });\n\n // A simple Set type that honours R.equals semantics\n /* globals Set */\n /**\n * Combines the logic for checking whether an item is a member of the set and\n * for adding a new item to the set.\n *\n * @param item The item to check or add to the Set instance.\n * @param shouldAdd If true, the item will be added to the set if it doesn't\n * already exist.\n * @param set The set instance to check or add to.\n * @return {boolean} When shouldAdd is true, this will return true when a new\n * item was added otherwise false. When shouldAdd is false,\n * this will return true if the item already exists, otherwise\n * false.\n */\n // distinguish between +0 and -0\n // these types can all utilise Set\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n // compare functions for reference equality\n /* falls through */\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n // scan through all previously applied items\n var _Set = function () {\n function _Set() {\n /* globals Set */\n this._nativeSet = typeof Set === 'function' ? new Set() : null;\n this._items = {};\n }\n _Set.prototype.add = function (item) {\n return hasOrAdd(item, true, this);\n };\n _Set.prototype.has = function (item) {\n return hasOrAdd(item, false, this);\n };\n /**\n * Combines the logic for checking whether an item is a member of the set and\n * for adding a new item to the set.\n *\n * @param item The item to check or add to the Set instance.\n * @param shouldAdd If true, the item will be added to the set if it doesn't\n * already exist.\n * @param set The set instance to check or add to.\n * @return {boolean} When shouldAdd is true, this will return true when a new\n * item was added otherwise false. When shouldAdd is false,\n * this will return true if the item already exists, otherwise\n * false.\n */\n function hasOrAdd(item, shouldAdd, set) {\n var type = typeof item;\n var prevSize, newSize;\n switch (type) {\n case 'string':\n case 'number':\n // distinguish between +0 and -0\n if (item === 0 && !set._items['-0'] && 1 / item === -Infinity) {\n if (shouldAdd) {\n set._items['-0'] = true;\n }\n return shouldAdd;\n }\n // these types can all utilise Set\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize > prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = {};\n set._items[type][item] = true;\n }\n return shouldAdd;\n } else if (item in set._items[type]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type][item] = true;\n }\n return shouldAdd;\n }\n }\n case 'boolean':\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n if (type in set._items) {\n var bIdx = item ? 1 : 0;\n if (set._items[type][bIdx]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type][bIdx] = true;\n }\n return shouldAdd;\n }\n } else {\n if (shouldAdd) {\n set._items[type] = item ? [\n false,\n true\n ] : [\n true,\n false\n ];\n }\n return shouldAdd;\n }\n case 'function':\n // compare functions for reference equality\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize > prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return shouldAdd;\n }\n if (!_contains(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return shouldAdd;\n }\n }\n return !shouldAdd;\n case 'undefined':\n if (set._items[type]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type] = true;\n }\n return shouldAdd;\n }\n case 'object':\n if (item === null) {\n if (!set._items['null']) {\n if (shouldAdd) {\n set._items['null'] = true;\n }\n return shouldAdd;\n }\n return !shouldAdd;\n }\n /* falls through */\n default:\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n type = Object.prototype.toString.call(item);\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return shouldAdd;\n }\n // scan through all previously applied items\n if (!_contains(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return shouldAdd;\n }\n return !shouldAdd;\n }\n }\n return _Set;\n }();\n\n /**\n * A function wrapping calls to the two functions in an `&&` operation,\n * returning the result of the first function if it is false-y and the result\n * of the second function otherwise. Note that this is short-circuited,\n * meaning that the second function will not be invoked if the first returns a\n * false-y value.\n *\n * In addition to functions, `R.both` also accepts any fantasy-land compatible\n * applicative functor.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)\n * @param {Function} f a predicate\n * @param {Function} g another predicate\n * @return {Function} a function that applies its arguments to `f` and `g` and `&&`s their outputs together.\n * @see R.and\n * @example\n *\n * var gt10 = x => x > 10;\n * var even = x => x % 2 === 0;\n * var f = R.both(gt10, even);\n * f(100); //=> true\n * f(101); //=> false\n */\n var both = _curry2(function both(f, g) {\n return _isFunction(f) ? function _both() {\n return f.apply(this, arguments) && g.apply(this, arguments);\n } : lift(and)(f, g);\n });\n\n /**\n * Takes a function `f` and returns a function `g` such that:\n *\n * - applying `g` to zero or more arguments will give __true__ if applying\n * the same arguments to `f` gives a logical __false__ value; and\n *\n * - applying `g` to zero or more arguments will give __false__ if applying\n * the same arguments to `f` gives a logical __true__ value.\n *\n * `R.complement` will work on all other functors as well.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> *) -> (*... -> Boolean)\n * @param {Function} f\n * @return {Function}\n * @see R.not\n * @example\n *\n * var isEven = n => n % 2 === 0;\n * var isOdd = R.complement(isEven);\n * isOdd(21); //=> true\n * isOdd(42); //=> false\n */\n var complement = lift(not);\n\n /**\n * A function wrapping calls to the two functions in an `||` operation,\n * returning the result of the first function if it is truth-y and the result\n * of the second function otherwise. Note that this is short-circuited,\n * meaning that the second function will not be invoked if the first returns a\n * truth-y value.\n *\n * In addition to functions, `R.either` also accepts any fantasy-land compatible\n * applicative functor.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)\n * @param {Function} f a predicate\n * @param {Function} g another predicate\n * @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.\n * @see R.or\n * @example\n *\n * var gt10 = x => x > 10;\n * var even = x => x % 2 === 0;\n * var f = R.either(gt10, even);\n * f(101); //=> true\n * f(8); //=> true\n */\n var either = _curry2(function either(f, g) {\n return _isFunction(f) ? function _either() {\n return f.apply(this, arguments) || g.apply(this, arguments);\n } : lift(or)(f, g);\n });\n\n /**\n * Turns a named method with a specified arity into a function that can be\n * called directly supplied with arguments and a target object.\n *\n * The returned function is curried and accepts `arity + 1` parameters where\n * the final parameter is the target object.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig Number -> String -> (a -> b -> ... -> n -> Object -> *)\n * @param {Number} arity Number of arguments the returned function should take\n * before the target object.\n * @param {String} method Name of the method to call.\n * @return {Function} A new curried function.\n * @example\n *\n * var sliceFrom = R.invoker(1, 'slice');\n * sliceFrom(6, 'abcdefghijklm'); //=> 'ghijklm'\n * var sliceFrom6 = R.invoker(2, 'slice')(6);\n * sliceFrom6(8, 'abcdefghijklm'); //=> 'gh'\n */\n var invoker = _curry2(function invoker(arity, method) {\n return curryN(arity + 1, function () {\n var target = arguments[arity];\n if (target != null && is(Function, target[method])) {\n return target[method].apply(target, _slice(arguments, 0, arity));\n }\n throw new TypeError(toString(target) + ' does not have a method named \"' + method + '\"');\n });\n });\n\n /**\n * Returns a string made by inserting the `separator` between each element and\n * concatenating all the elements into a single string.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig String -> [a] -> String\n * @param {Number|String} separator The string used to separate the elements.\n * @param {Array} xs The elements to join into a string.\n * @return {String} str The string made by concatenating `xs` with `separator`.\n * @see R.split\n * @example\n *\n * var spacer = R.join(' ');\n * spacer(['a', 2, 3.4]); //=> 'a 2 3.4'\n * R.join('|', [1, 2, 3]); //=> '1|2|3'\n */\n var join = invoker(1, 'join');\n\n /**\n * Creates a new function that, when invoked, caches the result of calling `fn`\n * for a given argument set and returns the result. Subsequent calls to the\n * memoized `fn` with the same argument set will not result in an additional\n * call to `fn`; instead, the cached result for that set of arguments will be\n * returned.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (*... -> a) -> (*... -> a)\n * @param {Function} fn The function to memoize.\n * @return {Function} Memoized version of `fn`.\n * @example\n *\n * var count = 0;\n * var factorial = R.memoize(n => {\n * count += 1;\n * return R.product(R.range(1, n + 1));\n * });\n * factorial(5); //=> 120\n * factorial(5); //=> 120\n * factorial(5); //=> 120\n * count; //=> 1\n */\n var memoize = _curry1(function memoize(fn) {\n var cache = {};\n return _arity(fn.length, function () {\n var key = toString(arguments);\n if (!_has(key, cache)) {\n cache[key] = fn.apply(this, arguments);\n }\n return cache[key];\n });\n });\n\n /**\n * Splits a string into an array of strings based on the given\n * separator.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category String\n * @sig (String | RegExp) -> String -> [String]\n * @param {String|RegExp} sep The pattern.\n * @param {String} str The string to separate into an array.\n * @return {Array} The array of strings from `str` separated by `str`.\n * @see R.join\n * @example\n *\n * var pathComponents = R.split('/');\n * R.tail(pathComponents('/usr/local/bin/node')); //=> ['usr', 'local', 'bin', 'node']\n *\n * R.split('.', 'a.b.c.xyz.d'); //=> ['a', 'b', 'c', 'xyz', 'd']\n */\n var split = invoker(1, 'split');\n\n /**\n * Determines whether a given string matches a given regular expression.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category String\n * @sig RegExp -> String -> Boolean\n * @param {RegExp} pattern\n * @param {String} str\n * @return {Boolean}\n * @see R.match\n * @example\n *\n * R.test(/^x/, 'xyz'); //=> true\n * R.test(/^y/, 'xyz'); //=> false\n */\n var test = _curry2(function test(pattern, str) {\n if (!_isRegExp(pattern)) {\n throw new TypeError('\\u2018test\\u2019 requires a value of type RegExp as its first argument; received ' + toString(pattern));\n }\n return _cloneRegExp(pattern).test(str);\n });\n\n /**\n * The lower case version of a string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to lower case.\n * @return {String} The lower case version of `str`.\n * @see R.toUpper\n * @example\n *\n * R.toLower('XYZ'); //=> 'xyz'\n */\n var toLower = invoker(0, 'toLowerCase');\n\n /**\n * The upper case version of a string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to upper case.\n * @return {String} The upper case version of `str`.\n * @see R.toLower\n * @example\n *\n * R.toUpper('abc'); //=> 'ABC'\n */\n var toUpper = invoker(0, 'toUpperCase');\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list, based upon the value returned by applying the supplied function to\n * each list element. Prefers the first item if the supplied function produces\n * the same value on two items. `R.equals` is used for comparison.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> b) -> [a] -> [a]\n * @param {Function} fn A function used to produce a value to use during comparisons.\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=> [-1, -5, 2, 10]\n */\n var uniqBy = _curry2(function uniqBy(fn, list) {\n var set = new _Set();\n var result = [];\n var idx = 0;\n var appliedItem, item;\n while (idx < list.length) {\n item = list[idx];\n appliedItem = fn(item);\n if (set.add(appliedItem)) {\n result.push(item);\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns the result of concatenating the given lists or strings.\n *\n * Dispatches to the `concat` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a] -> [a]\n * @sig String -> String -> String\n * @param {Array|String} a\n * @param {Array|String} b\n * @return {Array|String}\n *\n * @example\n *\n * R.concat([], []); //=> []\n * R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]\n * R.concat('ABC', 'DEF'); // 'ABCDEF'\n */\n var concat = flip(invoker(1, 'concat'));\n\n /**\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\n * second list, but not both.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` or `list2`, but not both.\n * @see R.symmetricDifferenceWith\n * @example\n *\n * R.symmetricDifference([1,2,3,4], [7,6,5,4,3]); //=> [1,2,7,6,5]\n * R.symmetricDifference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5,1,2]\n */\n var symmetricDifference = _curry2(function symmetricDifference(list1, list2) {\n return concat(difference(list1, list2), difference(list2, list1));\n });\n\n /**\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\n * second list, but not both. Duplication is determined according to the value\n * returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [a] -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` or `list2`, but not both.\n * @see R.symmetricDifference\n * @example\n *\n * var eqA = R.eqBy(R.prop('a'));\n * var l1 = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];\n * var l2 = [{a: 3}, {a: 4}, {a: 5}, {a: 6}];\n * R.symmetricDifferenceWith(eqA, l1, l2); //=> [{a: 1}, {a: 2}, {a: 5}, {a: 6}]\n */\n var symmetricDifferenceWith = _curry3(function symmetricDifferenceWith(pred, list1, list2) {\n return concat(differenceWith(pred, list1, list2), differenceWith(pred, list2, list1));\n });\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list. `R.equals` is used to determine equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniq([1, 1, 2, 1]); //=> [1, 2]\n * R.uniq([1, '1']); //=> [1, '1']\n * R.uniq([[42], [42]]); //=> [[42]]\n */\n var uniq = uniqBy(identity);\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of those\n * elements common to both lists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The list of elements found in both `list1` and `list2`.\n * @see R.intersectionWith\n * @example\n *\n * R.intersection([1,2,3,4], [7,6,5,4,3]); //=> [4, 3]\n */\n var intersection = _curry2(function intersection(list1, list2) {\n var lookupList, filteredList;\n if (list1.length > list2.length) {\n lookupList = list1;\n filteredList = list2;\n } else {\n lookupList = list2;\n filteredList = list1;\n }\n return uniq(_filter(flip(_contains)(lookupList), filteredList));\n });\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\n * of each list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} as The first list.\n * @param {Array} bs The second list.\n * @return {Array} The first and second lists concatenated, with\n * duplicates removed.\n * @example\n *\n * R.union([1, 2, 3], [2, 3, 4]); //=> [1, 2, 3, 4]\n */\n var union = _curry2(compose(uniq, _concat));\n\n var R = {\n F: F,\n T: T,\n __: __,\n add: add,\n addIndex: addIndex,\n adjust: adjust,\n all: all,\n allPass: allPass,\n allUniq: allUniq,\n always: always,\n and: and,\n any: any,\n anyPass: anyPass,\n ap: ap,\n aperture: aperture,\n append: append,\n apply: apply,\n applySpec: applySpec,\n assoc: assoc,\n assocPath: assocPath,\n binary: binary,\n bind: bind,\n both: both,\n call: call,\n chain: chain,\n clamp: clamp,\n clone: clone,\n comparator: comparator,\n complement: complement,\n compose: compose,\n composeK: composeK,\n composeP: composeP,\n concat: concat,\n cond: cond,\n construct: construct,\n constructN: constructN,\n contains: contains,\n converge: converge,\n countBy: countBy,\n curry: curry,\n curryN: curryN,\n dec: dec,\n defaultTo: defaultTo,\n difference: difference,\n differenceWith: differenceWith,\n dissoc: dissoc,\n dissocPath: dissocPath,\n divide: divide,\n drop: drop,\n dropLast: dropLast,\n dropLastWhile: dropLastWhile,\n dropRepeats: dropRepeats,\n dropRepeatsWith: dropRepeatsWith,\n dropWhile: dropWhile,\n either: either,\n empty: empty,\n eqBy: eqBy,\n eqProps: eqProps,\n equals: equals,\n evolve: evolve,\n filter: filter,\n find: find,\n findIndex: findIndex,\n findLast: findLast,\n findLastIndex: findLastIndex,\n flatten: flatten,\n flip: flip,\n forEach: forEach,\n fromPairs: fromPairs,\n groupBy: groupBy,\n groupWith: groupWith,\n gt: gt,\n gte: gte,\n has: has,\n hasIn: hasIn,\n head: head,\n identical: identical,\n identity: identity,\n ifElse: ifElse,\n inc: inc,\n indexBy: indexBy,\n indexOf: indexOf,\n init: init,\n insert: insert,\n insertAll: insertAll,\n intersection: intersection,\n intersectionWith: intersectionWith,\n intersperse: intersperse,\n into: into,\n invert: invert,\n invertObj: invertObj,\n invoker: invoker,\n is: is,\n isArrayLike: isArrayLike,\n isEmpty: isEmpty,\n isNil: isNil,\n join: join,\n juxt: juxt,\n keys: keys,\n keysIn: keysIn,\n last: last,\n lastIndexOf: lastIndexOf,\n length: length,\n lens: lens,\n lensIndex: lensIndex,\n lensPath: lensPath,\n lensProp: lensProp,\n lift: lift,\n liftN: liftN,\n lt: lt,\n lte: lte,\n map: map,\n mapAccum: mapAccum,\n mapAccumRight: mapAccumRight,\n mapObjIndexed: mapObjIndexed,\n match: match,\n mathMod: mathMod,\n max: max,\n maxBy: maxBy,\n mean: mean,\n median: median,\n memoize: memoize,\n merge: merge,\n mergeAll: mergeAll,\n mergeWith: mergeWith,\n mergeWithKey: mergeWithKey,\n min: min,\n minBy: minBy,\n modulo: modulo,\n multiply: multiply,\n nAry: nAry,\n negate: negate,\n none: none,\n not: not,\n nth: nth,\n nthArg: nthArg,\n objOf: objOf,\n of: of,\n omit: omit,\n once: once,\n or: or,\n over: over,\n pair: pair,\n partial: partial,\n partialRight: partialRight,\n partition: partition,\n path: path,\n pathEq: pathEq,\n pathOr: pathOr,\n pathSatisfies: pathSatisfies,\n pick: pick,\n pickAll: pickAll,\n pickBy: pickBy,\n pipe: pipe,\n pipeK: pipeK,\n pipeP: pipeP,\n pluck: pluck,\n prepend: prepend,\n product: product,\n project: project,\n prop: prop,\n propEq: propEq,\n propIs: propIs,\n propOr: propOr,\n propSatisfies: propSatisfies,\n props: props,\n range: range,\n reduce: reduce,\n reduceBy: reduceBy,\n reduceRight: reduceRight,\n reduced: reduced,\n reject: reject,\n remove: remove,\n repeat: repeat,\n replace: replace,\n reverse: reverse,\n scan: scan,\n sequence: sequence,\n set: set,\n slice: slice,\n sort: sort,\n sortBy: sortBy,\n split: split,\n splitAt: splitAt,\n splitEvery: splitEvery,\n splitWhen: splitWhen,\n subtract: subtract,\n sum: sum,\n symmetricDifference: symmetricDifference,\n symmetricDifferenceWith: symmetricDifferenceWith,\n tail: tail,\n take: take,\n takeLast: takeLast,\n takeLastWhile: takeLastWhile,\n takeWhile: takeWhile,\n tap: tap,\n test: test,\n times: times,\n toLower: toLower,\n toPairs: toPairs,\n toPairsIn: toPairsIn,\n toString: toString,\n toUpper: toUpper,\n transduce: transduce,\n transpose: transpose,\n traverse: traverse,\n trim: trim,\n tryCatch: tryCatch,\n type: type,\n unapply: unapply,\n unary: unary,\n uncurryN: uncurryN,\n unfold: unfold,\n union: union,\n unionWith: unionWith,\n uniq: uniq,\n uniqBy: uniqBy,\n uniqWith: uniqWith,\n unless: unless,\n unnest: unnest,\n until: until,\n update: update,\n useWith: useWith,\n values: values,\n valuesIn: valuesIn,\n view: view,\n when: when,\n where: where,\n whereEq: whereEq,\n without: without,\n wrap: wrap,\n xprod: xprod,\n zip: zip,\n zipObj: zipObj,\n zipWith: zipWith\n };\n /* eslint-env amd */\n\n /* TEST_ENTRY_POINT */\n\n if (typeof exports === 'object') {\n module.exports = R;\n } else if (typeof define === 'function' && define.amd) {\n define(function() { return R; });\n } else {\n this.R = R;\n }\n\n}.call(this));\n\n},{}],388:[function(require,module,exports){\n(function (global){\n/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === \"object\" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}]},{},[19])\n\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// bedwig.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var sa = require('./sourceadapters');\n var dalliance_registerParserFactory = sa.registerParserFactory;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n}\n\n\nfunction BedWigParser(type) {\n this.type = type;\n}\n\nBedWigParser.prototype.createSession = function(sink) {\n if (this.type == 'wig')\n return new WigParseSession(this, sink);\n else\n return new BedParseSession(this, sink);\n}\n\nvar __KV_REGEXP=/([^=]+)=(.+)/;\nvar __SPACE_REGEXP=/\\s/;\nvar BED_COLOR_REGEXP = new RegExp(\"^[0-9]+,[0-9]+,[0-9]+\");\n\nfunction BedParseSession(parser, sink) {\n this.parser = parser;\n this.sink = sink;\n}\n\nBedParseSession.prototype.parse = function(line) {\n var toks = line.split(__SPACE_REGEXP);\n if (toks.length < 3)\n return;\n\n var start = parseInt(toks[1]) + 1;\n var end = parseInt(toks[2]);\n\n var f = {segment: toks[0], \n min: start,\n max: end};\n\n if (toks.length > 3 && toks[3] !== '.') {\n f.label = toks[3];\n }\n\n if (toks.length > 4) {\n f.score = parseFloat(toks[4])\n }\n\n if (toks.length > 5) {\n f.orientation = toks[5];\n }\n\n if (toks.length > 8) {\n var color = toks[8];\n if (BED_COLOR_REGEXP.test(color)) {\n f.itemRgb = 'rgb(' + color + ')';\n }\n }\n\n if (toks.length >= 12) {\n var thickStart = parseInt(toks[6]);\n var thickEnd = parseInt(toks[7]);\n var blockCount = parseInt(toks[9]);\n var blockSizes = toks[10].split(',').map(function(x) {return parseInt(x)});\n var blockStarts = toks[11].split(',').map(function(x) {return parseInt(x)});\n\n f.type = 'transcript'\n var grp = new DASGroup();\n grp.id = toks[3];\n grp.type = 'transcript'\n grp.notes = [];\n f.groups = [grp];\n\n if (toks.length > 12) {\n var geneId = toks[12];\n var geneName = geneId;\n if (toks.length > 13) {\n geneName = toks[13];\n }\n var gg = new DASGroup();\n gg.id = geneId;\n gg.label = geneName;\n gg.type = 'gene';\n f.groups.push(gg);\n } \n\n var spans = null;\n for (var b = 0; b < blockCount; ++b) {\n var bmin = blockStarts[b] + start;\n var bmax = bmin + blockSizes[b];\n var span = new Range(bmin, bmax);\n if (spans) {\n spans = union(spans, span);\n } else {\n spans = span;\n }\n }\n \n var tsList = spans.ranges();\n for (var s = 0; s < tsList.length; ++s) {\n var ts = tsList[s];\n var bf = shallowCopy(f);\n bf.min = ts.min();\n bf.max = ts.max();\n this.sink(bf);\n }\n\n if (thickEnd > thickStart) {\n var codingRegion = (f.orientation == '+') ? \n new Range(thickStart, thickEnd + 3) : \n new Range(thickStart - 3, thickEnd);\n // +/- 3 to account for stop codon\n\n var tl = intersection(spans, codingRegion);\n if (tl) {\n f.type = 'translation';\n var tlList = tl.ranges();\n var readingFrame = 0;\n for (var s = 0; s < tlList.length; ++s) {\n // Record reading frame for every exon\n var index = s;\n if (f.orientation == '-')\n index = tlList.length - s - 1;\n var ts = tlList[index];\n var bf = shallowCopy(f);\n bf.min = ts.min();\n bf.max = ts.max();\n f.readframe = readingFrame;\n var length = ts.max() - ts.min();\n readingFrame = (readingFrame + length) % 3;\n this.sink(bf);\n }\n }\n }\n } else {\n this.sink(f);\n }\n}\n\nBedParseSession.prototype.flush = function() {};\n\nfunction WigParseSession(parser, sink) {\n this.parser = parser;\n this.sink = sink;\n this.wigState = null;\n}\n\nWigParseSession.prototype.parse = function(line) {\n var toks = line.split(__SPACE_REGEXP);\n\n if (toks[0] == 'fixedStep') {\n this.wigState = 'fixedStep';\n this.chr = this.pos = this.step = null;\n this.span = 1;\n\n for (var ti = 1; ti < toks.length; ++ti) {\n var m = __KV_REGEXP.exec(toks[ti]);\n if (m) {\n if (m[1] == 'chrom') {\n this.chr = m[2];\n } else if (m[1] == 'start') {\n this.pos = parseInt(m[2]);\n } else if (m[1] == 'step') {\n this.step = parseInt(m[2]);\n } else if (m[1] == 'span') {\n this.span = parseInt(m[2]);\n }\n }\n }\n } else if (toks[0] == 'variableStep') {\n this.wigState = 'variableStep';\n this.chr = null;\n this.span = 1;\n\n for (var ti = 1; ti < toks.length; ++ti) {\n var m = __KV_REGEXP.exec(toks[ti]);\n if (m[1] == 'chrom') {\n this.chr = m[2];\n } else if (m[1] == 'span') {\n this.span = parseInt(m[2]);\n }\n }\n } else {\n if (!this.wigState) {\n if (toks.length < 4)\n return;\n\n var f = {segment: toks[0], \n min: parseInt(toks[1]) + 1, \n max: parseInt(toks[2]),\n score: parseFloat(toks[3])};\n\n this.sink(f);\n } else if (this.wigState == 'fixedStep') {\n if (toks.length != 1)\n return;\n var score = parseFloat(toks[0]);\n var f = {segment: this.chr, min: this.pos, max: this.pos + this.span - 1, score: score};\n this.pos += this.step;\n this.sink(f);\n } else if (this.wigState == 'variableStep') {\n if (toks.length != 2)\n return;\n var pos = parseInt(toks[0]);\n var score = parseFloat(toks[1]);\n var f = {segment: this.chr, min: pos, max: pos + this.span - 1, score: score};\n this.sink(f);\n }\n }\n}\n\nWigParseSession.prototype.flush = function() {};\n\nBedWigParser.prototype.getStyleSheet = function(callback) {\n var thisB = this;\n var stylesheet = new DASStylesheet();\n\n if (this.type == 'wig') {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'HISTOGRAM';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n } else {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue'\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'red'\n wigStyle.HEIGHT = 10;\n wigStyle.BUMP = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'translation'}, null, wigStyle);\n \n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'white';\n densStyle.COLOR2 = 'black';\n densStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'density'}, null, densStyle);\n }\n\n return callback(stylesheet);\n}\n\ndalliance_registerParserFactory('bed', function(t) {return new BedWigParser(t)});\ndalliance_registerParserFactory('wig', function(t) {return new BedWigParser(t)});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// bigwig.js: indexed binary WIG (and BED) files\n//\n\n\"use strict\";\n\n\nif (typeof(require) !== 'undefined') {\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var das = require('./das');\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n\n var bin = require('./bin');\n var readInt = bin.readInt;\n\n var jszlib = require('jszlib');\n var jszlib_inflate_buffer = jszlib.inflateBuffer;\n var arrayCopy = jszlib.arrayCopy;\n}\n\nvar BIG_WIG_MAGIC = 0x888FFC26;\nvar BIG_WIG_MAGIC_BE = 0x26FC8F88;\nvar BIG_BED_MAGIC = 0x8789F2EB;\nvar BIG_BED_MAGIC_BE = 0xEBF28987;\n\n\nvar BIG_WIG_TYPE_GRAPH = 1;\nvar BIG_WIG_TYPE_VSTEP = 2;\nvar BIG_WIG_TYPE_FSTEP = 3;\n \nvar M1 = 256;\nvar M2 = 256*256;\nvar M3 = 256*256*256;\nvar M4 = 256*256*256*256;\n\nvar BED_COLOR_REGEXP = new RegExp(\"^[0-9]+,[0-9]+,[0-9]+\");\n\nfunction bwg_readOffset(ba, o) {\n var offset = ba[o] + ba[o+1]*M1 + ba[o+2]*M2 + ba[o+3]*M3 + ba[o+4]*M4;\n return offset;\n}\n\nfunction BigWig() {\n}\n\nBigWig.prototype.readChromTree = function(callback) {\n var thisB = this;\n this.chromsToIDs = {};\n this.idsToChroms = {};\n this.maxID = 0;\n\n var udo = this.unzoomedDataOffset;\n var eb = (udo - this.chromTreeOffset) & 3;\n udo = udo + 4 - eb;\n\n this.data.slice(this.chromTreeOffset, udo - this.chromTreeOffset).fetch(function(bpt) {\n var ba = new Uint8Array(bpt);\n var sa = new Int16Array(bpt);\n var la = new Int32Array(bpt);\n var bptMagic = la[0];\n var blockSize = la[1];\n var keySize = la[2];\n var valSize = la[3];\n var itemCount = bwg_readOffset(ba, 16);\n var rootNodeOffset = 32;\n\n var bptReadNode = function(offset) {\n var nodeType = ba[offset];\n var cnt = sa[(offset/2) + 1];\n offset += 4;\n for (var n = 0; n < cnt; ++n) {\n if (nodeType == 0) {\n offset += keySize;\n var childOffset = bwg_readOffset(ba, offset);\n offset += 8;\n childOffset -= thisB.chromTreeOffset;\n bptReadNode(childOffset);\n } else {\n var key = '';\n for (var ki = 0; ki < keySize; ++ki) {\n var charCode = ba[offset++];\n if (charCode != 0) {\n key += String.fromCharCode(charCode);\n }\n }\n var chromId = (ba[offset+3]<<24) | (ba[offset+2]<<16) | (ba[offset+1]<<8) | (ba[offset+0]);\n var chromSize = (ba[offset + 7]<<24) | (ba[offset+6]<<16) | (ba[offset+5]<<8) | (ba[offset+4]);\n offset += 8;\n\n thisB.chromsToIDs[key] = chromId;\n if (key.indexOf('chr') == 0) {\n thisB.chromsToIDs[key.substr(3)] = chromId;\n }\n thisB.idsToChroms[chromId] = key;\n thisB.maxID = Math.max(thisB.maxID, chromId);\n }\n }\n };\n bptReadNode(rootNodeOffset);\n\n callback(thisB);\n });\n}\n\nfunction BigWigView(bwg, cirTreeOffset, cirTreeLength, isSummary) {\n this.bwg = bwg;\n this.cirTreeOffset = cirTreeOffset;\n this.cirTreeLength = cirTreeLength;\n this.isSummary = isSummary;\n}\n\n\n\nBigWigView.prototype.readWigData = function(chrName, min, max, callback) {\n var chr = this.bwg.chromsToIDs[chrName];\n if (chr === undefined) {\n // Not an error because some .bwgs won't have data for all chromosomes.\n return callback([]);\n } else {\n this.readWigDataById(chr, min, max, callback);\n }\n}\n\nBigWigView.prototype.readWigDataById = function(chr, min, max, callback) {\n var thisB = this;\n if (!this.cirHeader) {\n this.bwg.data.slice(this.cirTreeOffset, 48).fetch(function(result) {\n thisB.cirHeader = result;\n var la = new Int32Array(thisB.cirHeader);\n thisB.cirBlockSize = la[1];\n thisB.readWigDataById(chr, min, max, callback);\n });\n return;\n }\n\n var blocksToFetch = [];\n var outstanding = 0;\n\n var beforeBWG = Date.now();\n\n var filter = function(chromId, fmin, fmax, toks) {\n return ((chr < 0 || chromId == chr) && fmin <= max && fmax >= min);\n }\n\n var cirFobRecur = function(offset, level) {\n if (thisB.bwg.instrument)\n console.log('level=' + level + '; offset=' + offset + '; time=' + (Date.now()|0));\n\n outstanding += offset.length;\n\n if (offset.length == 1 && offset[0] - thisB.cirTreeOffset == 48 && thisB.cachedCirRoot) {\n cirFobRecur2(thisB.cachedCirRoot, 0, level);\n --outstanding;\n if (outstanding == 0) {\n thisB.fetchFeatures(filter, blocksToFetch, callback);\n }\n return;\n }\n\n var maxCirBlockSpan = 4 + (thisB.cirBlockSize * 32); // Upper bound on size, based on a completely full leaf node.\n var spans;\n for (var i = 0; i < offset.length; ++i) {\n var blockSpan = new Range(offset[i], offset[i] + maxCirBlockSpan);\n spans = spans ? union(spans, blockSpan) : blockSpan;\n }\n \n var fetchRanges = spans.ranges();\n for (var r = 0; r < fetchRanges.length; ++r) {\n var fr = fetchRanges[r];\n cirFobStartFetch(offset, fr, level);\n }\n }\n\n var cirFobStartFetch = function(offset, fr, level, attempts) {\n var length = fr.max() - fr.min();\n thisB.bwg.data.slice(fr.min(), fr.max() - fr.min()).fetch(function(resultBuffer) {\n for (var i = 0; i < offset.length; ++i) {\n if (fr.contains(offset[i])) {\n cirFobRecur2(resultBuffer, offset[i] - fr.min(), level);\n\n if (offset[i] - thisB.cirTreeOffset == 48 && offset[i] - fr.min() == 0)\n thisB.cachedCirRoot = resultBuffer;\n\n --outstanding;\n if (outstanding == 0) {\n thisB.fetchFeatures(filter, blocksToFetch, callback);\n }\n }\n }\n });\n }\n\n var cirFobRecur2 = function(cirBlockData, offset, level) {\n var ba = new Uint8Array(cirBlockData);\n var sa = new Int16Array(cirBlockData);\n var la = new Int32Array(cirBlockData);\n\n var isLeaf = ba[offset];\n var cnt = sa[offset/2 + 1];\n offset += 4;\n\n if (isLeaf != 0) {\n for (var i = 0; i < cnt; ++i) {\n var lo = offset/4;\n var startChrom = la[lo];\n var startBase = la[lo + 1];\n var endChrom = la[lo + 2];\n var endBase = la[lo + 3];\n var blockOffset = bwg_readOffset(ba, offset+16);\n var blockSize = bwg_readOffset(ba, offset+24);\n if (((chr < 0 || startChrom < chr) || (startChrom == chr && startBase <= max)) &&\n ((chr < 0 || endChrom > chr) || (endChrom == chr && endBase >= min)))\n {\n blocksToFetch.push({offset: blockOffset, size: blockSize});\n }\n offset += 32;\n }\n } else {\n var recurOffsets = [];\n for (var i = 0; i < cnt; ++i) {\n var lo = offset/4;\n var startChrom = la[lo];\n var startBase = la[lo + 1];\n var endChrom = la[lo + 2];\n var endBase = la[lo + 3];\n var blockOffset = bwg_readOffset(ba, offset+16);\n if ((chr < 0 || startChrom < chr || (startChrom == chr && startBase <= max)) &&\n (chr < 0 || endChrom > chr || (endChrom == chr && endBase >= min)))\n {\n recurOffsets.push(blockOffset);\n }\n offset += 24;\n }\n if (recurOffsets.length > 0) {\n cirFobRecur(recurOffsets, level + 1);\n }\n }\n };\n\n cirFobRecur([thisB.cirTreeOffset + 48], 1);\n}\n\n\nBigWigView.prototype.fetchFeatures = function(filter, blocksToFetch, callback) {\n var thisB = this;\n\n blocksToFetch.sort(function(b0, b1) {\n return (b0.offset|0) - (b1.offset|0);\n });\n\n if (blocksToFetch.length == 0) {\n callback([]);\n } else {\n var features = [];\n var createFeature = function(chr, fmin, fmax, opts) {\n if (!opts) {\n opts = {};\n }\n \n var f = new DASFeature();\n f._chromId = chr;\n f.segment = thisB.bwg.idsToChroms[chr];\n f.min = fmin;\n f.max = fmax;\n f.type = thisB.bwg.type;\n \n for (var k in opts) {\n f[k] = opts[k];\n }\n \n features.push(f);\n };\n\n var tramp = function() {\n if (blocksToFetch.length == 0) {\n var afterBWG = Date.now();\n // dlog('BWG fetch took ' + (afterBWG - beforeBWG) + 'ms');\n callback(features);\n return; // just in case...\n } else {\n var block = blocksToFetch[0];\n if (block.data) {\n thisB.parseFeatures(block.data, createFeature, filter);\n blocksToFetch.splice(0, 1);\n tramp();\n } else {\n var fetchStart = block.offset;\n var fetchSize = block.size;\n var bi = 1;\n while (bi < blocksToFetch.length && blocksToFetch[bi].offset == (fetchStart + fetchSize)) {\n fetchSize += blocksToFetch[bi].size;\n ++bi;\n }\n\n thisB.bwg.data.slice(fetchStart, fetchSize).fetch(function(result) {\n var offset = 0;\n var bi = 0;\n while (offset < fetchSize) {\n var fb = blocksToFetch[bi];\n \n var data;\n if (thisB.bwg.uncompressBufSize > 0) {\n data = jszlib_inflate_buffer(result, offset + 2, fb.size - 2);\n } else {\n var tmp = new Uint8Array(fb.size); // FIXME is this really the best we can do?\n arrayCopy(new Uint8Array(result, offset, fb.size), 0, tmp, 0, fb.size);\n data = tmp.buffer;\n }\n fb.data = data;\n \n offset += fb.size;\n ++bi;\n }\n tramp();\n });\n }\n }\n }\n tramp();\n }\n}\n\nBigWigView.prototype.parseFeatures = function(data, createFeature, filter) {\n var ba = new Uint8Array(data);\n\n if (this.isSummary) {\n var sa = new Int16Array(data);\n var la = new Int32Array(data);\n var fa = new Float32Array(data);\n\n var itemCount = data.byteLength/32;\n for (var i = 0; i < itemCount; ++i) {\n var chromId = la[(i*8)];\n var start = la[(i*8)+1];\n var end = la[(i*8)+2];\n var validCnt = la[(i*8)+3];\n var minVal = fa[(i*8)+4];\n var maxVal = fa[(i*8)+5];\n var sumData = fa[(i*8)+6];\n var sumSqData = fa[(i*8)+7];\n \n if (filter(chromId, start + 1, end)) {\n var summaryOpts = {type: 'bigwig', score: sumData/validCnt, maxScore: maxVal};\n if (this.bwg.type == 'bigbed') {\n summaryOpts.type = 'density';\n }\n createFeature(chromId, start + 1, end, summaryOpts);\n }\n }\n } else if (this.bwg.type == 'bigwig') {\n var sa = new Int16Array(data);\n var la = new Int32Array(data);\n var fa = new Float32Array(data);\n\n var chromId = la[0];\n var blockStart = la[1];\n var blockEnd = la[2];\n var itemStep = la[3];\n var itemSpan = la[4];\n var blockType = ba[20];\n var itemCount = sa[11];\n \n if (blockType == BIG_WIG_TYPE_FSTEP) {\n for (var i = 0; i < itemCount; ++i) {\n var score = fa[i + 6];\n var fmin = blockStart + (i*itemStep) + 1, fmax = blockStart + (i*itemStep) + itemSpan;\n if (filter(chromId, fmin, fmax))\n createFeature(chromId, fmin, fmax, {score: score});\n }\n } else if (blockType == BIG_WIG_TYPE_VSTEP) {\n for (var i = 0; i < itemCount; ++i) {\n var start = la[(i*2) + 6] + 1;\n var end = start + itemSpan - 1;\n var score = fa[(i*2) + 7];\n if (filter(chromId, start, end))\n createFeature(chromId, start, end, {score: score});\n }\n } else if (blockType == BIG_WIG_TYPE_GRAPH) {\n for (var i = 0; i < itemCount; ++i) {\n var start = la[(i*3) + 6] + 1;\n var end = la[(i*3) + 7];\n var score = fa[(i*3) + 8];\n if (start > end) {\n start = end;\n }\n if (filter(chromId, start, end))\n createFeature(chromId, start, end, {score: score});\n }\n } else {\n console.log('Currently not handling bwgType=' + blockType);\n }\n } else if (this.bwg.type == 'bigbed') {\n var offset = 0;\n var dfc = this.bwg.definedFieldCount;\n var schema = this.bwg.schema;\n\n while (offset < ba.length) {\n var chromId = (ba[offset+3]<<24) | (ba[offset+2]<<16) | (ba[offset+1]<<8) | (ba[offset+0]);\n var start = (ba[offset+7]<<24) | (ba[offset+6]<<16) | (ba[offset+5]<<8) | (ba[offset+4]);\n var end = (ba[offset+11]<<24) | (ba[offset+10]<<16) | (ba[offset+9]<<8) | (ba[offset+8]);\n offset += 12;\n var rest = '';\n while (true) {\n var ch = ba[offset++];\n if (ch != 0) {\n rest += String.fromCharCode(ch);\n } else {\n break;\n }\n }\n\n var featureOpts = {};\n \n var bedColumns;\n if (rest.length > 0) {\n bedColumns = rest.split('\\t');\n } else {\n bedColumns = [];\n }\n if (bedColumns.length > 0 && dfc > 3) {\n featureOpts.label = bedColumns[0];\n }\n if (bedColumns.length > 1 && dfc > 4) {\n var score = parseInt(bedColumns[1]);\n if (!isNaN(score))\n featureOpts.score = score;\n }\n if (bedColumns.length > 2 && dfc > 5) {\n featureOpts.orientation = bedColumns[2];\n }\n if (bedColumns.length > 5 && dfc > 8) {\n var color = bedColumns[5];\n if (BED_COLOR_REGEXP.test(color)) {\n featureOpts.itemRgb = 'rgb(' + color + ')';\n }\n }\n\n if (bedColumns.length > dfc-3 && schema) {\n for (var col = dfc - 3; col < bedColumns.length; ++col) {\n featureOpts[schema.fields[col+3].name] = bedColumns[col];\n }\n }\n\n if (filter(chromId, start + 1, end, bedColumns)) {\n if (dfc < 12) {\n createFeature(chromId, start + 1, end, featureOpts);\n } else {\n var thickStart = bedColumns[3]|0;\n var thickEnd = bedColumns[4]|0;\n var blockCount = bedColumns[6]|0;\n var blockSizes = bedColumns[7].split(',');\n var blockStarts = bedColumns[8].split(',');\n\n if (featureOpts.exonFrames) {\n var exonFrames = featureOpts.exonFrames.split(',');\n featureOpts.exonFrames = undefined;\n }\n \n featureOpts.type = 'transcript'\n var grp = new DASGroup();\n for (var k in featureOpts) {\n grp[k] = featureOpts[k];\n }\n grp.id = bedColumns[0];\n grp.segment = this.bwg.idsToChroms[chromId];\n grp.min = start + 1;\n grp.max = end;\n grp.notes = [];\n featureOpts.groups = [grp];\n\n // Moving towards using bigGenePred model, but will\n // still support old Dalliance-style BED12+gene-name for the\n // foreseeable future.\n if (bedColumns.length > 9) {\n var geneId = featureOpts.geneName || bedColumns[9];\n var geneName = geneId;\n if (bedColumns.length > 10) {\n geneName = bedColumns[10];\n }\n if (featureOpts.geneName2)\n geneName = featureOpts.geneName2;\n\n var gg = shallowCopy(grp);\n gg.id = geneId;\n gg.label = geneName;\n gg.type = 'gene';\n featureOpts.groups.push(gg);\n }\n\n var spanList = [];\n for (var b = 0; b < blockCount; ++b) {\n var bmin = (blockStarts[b]|0) + start;\n var bmax = bmin + (blockSizes[b]|0);\n var span = new Range(bmin, bmax);\n spanList.push(span);\n }\n var spans = union(spanList);\n \n var tsList = spans.ranges();\n for (var s = 0; s < tsList.length; ++s) {\n var ts = tsList[s];\n createFeature(chromId, ts.min() + 1, ts.max(), featureOpts);\n }\n\n if (thickEnd > thickStart) {\n var codingRegion = (featureOpts.orientation == '+') ?\n new Range(thickStart, thickEnd + 3) :\n new Range(thickStart - 3, thickEnd);\n // +/- 3 to account for stop codon\n\n var tl = intersection(spans, codingRegion);\n if (tl) {\n featureOpts.type = 'translation';\n var tlList = tl.ranges();\n var readingFrame = 0;\n\n var tlOffset = 0;\n while (tlList[0].min() > tsList[tlOffset].max())\n tlOffset++;\n\n for (var s = 0; s < tlList.length; ++s) {\n // Record reading frame for every exon\n var index = s;\n if (featureOpts.orientation == '-')\n index = tlList.length - s - 1;\n var ts = tlList[index];\n featureOpts.readframe = readingFrame;\n if (exonFrames) {\n var brf = parseInt(exonFrames[index + tlOffset]);\n if (typeof(brf) === 'number' && brf >= 0 && brf <= 2) {\n featureOpts.readframe = brf;\n featureOpts.readframeExplicit = true;\n }\n }\n var length = ts.max() - ts.min();\n readingFrame = (readingFrame + length) % 3;\n createFeature(chromId, ts.min() + 1, ts.max(), featureOpts);\n }\n }\n }\n }\n }\n }\n } else {\n throw Error(\"Don't know what to do with \" + this.bwg.type);\n }\n}\n\n//\n// nasty cut/paste, should roll back in!\n//\n\nBigWigView.prototype.getFirstAdjacent = function(chrName, pos, dir, callback) {\n var chr = this.bwg.chromsToIDs[chrName];\n if (chr === undefined) {\n // Not an error because some .bwgs won't have data for all chromosomes.\n return callback([]);\n } else {\n this.getFirstAdjacentById(chr, pos, dir, callback);\n }\n}\n\nBigWigView.prototype.getFirstAdjacentById = function(chr, pos, dir, callback) {\n var thisB = this;\n if (!this.cirHeader) {\n this.bwg.data.slice(this.cirTreeOffset, 48).fetch(function(result) {\n thisB.cirHeader = result;\n var la = new Int32Array(thisB.cirHeader);\n thisB.cirBlockSize = la[1];\n thisB.getFirstAdjacentById(chr, pos, dir, callback);\n });\n return;\n }\n\n var blockToFetch = null;\n var bestBlockChr = -1;\n var bestBlockOffset = -1;\n\n var outstanding = 0;\n\n var beforeBWG = Date.now();\n\n var cirFobRecur = function(offset, level) {\n outstanding += offset.length;\n\n var maxCirBlockSpan = 4 + (thisB.cirBlockSize * 32); // Upper bound on size, based on a completely full leaf node.\n var spans;\n for (var i = 0; i < offset.length; ++i) {\n var blockSpan = new Range(offset[i], offset[i] + maxCirBlockSpan);\n spans = spans ? union(spans, blockSpan) : blockSpan;\n }\n \n var fetchRanges = spans.ranges();\n for (var r = 0; r < fetchRanges.length; ++r) {\n var fr = fetchRanges[r];\n cirFobStartFetch(offset, fr, level);\n }\n }\n\n var cirFobStartFetch = function(offset, fr, level, attempts) {\n var length = fr.max() - fr.min();\n thisB.bwg.data.slice(fr.min(), fr.max() - fr.min()).fetch(function(resultBuffer) {\n for (var i = 0; i < offset.length; ++i) {\n if (fr.contains(offset[i])) {\n cirFobRecur2(resultBuffer, offset[i] - fr.min(), level);\n --outstanding;\n if (outstanding == 0) {\n if (!blockToFetch) {\n if (dir > 0 && (chr != 0 || pos > 0)) {\n return thisB.getFirstAdjacentById(0, 0, dir, callback);\n } else if (dir < 0 && (chr != thisB.bwg.maxID || pos < 1000000000)) {\n return thisB.getFirstAdjacentById(thisB.bwg.maxID, 1000000000, dir, callback);\n }\n return callback([]);\n }\n\n thisB.fetchFeatures(function(chrx, fmin, fmax, toks) {\n return (dir < 0 && (chrx < chr || fmax < pos)) || (dir > 0 && (chrx > chr || fmin > pos));\n }, [blockToFetch], function(features) {\n var bestFeature = null;\n var bestChr = -1;\n var bestPos = -1;\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n var chrx = f._chromId, fmin = f.min, fmax = f.max;\n if (bestFeature == null || ((dir < 0) && (chrx > bestChr || fmax > bestPos)) || ((dir > 0) && (chrx < bestChr || fmin < bestPos))) {\n bestFeature = f;\n bestPos = (dir < 0) ? fmax : fmin;\n bestChr = chrx;\n }\n }\n\n if (bestFeature != null) \n return callback([bestFeature]);\n else\n return callback([]);\n });\n }\n }\n }\n });\n }\n\n var cirFobRecur2 = function(cirBlockData, offset, level) {\n var ba = new Uint8Array(cirBlockData);\n var sa = new Int16Array(cirBlockData);\n var la = new Int32Array(cirBlockData);\n\n var isLeaf = ba[offset];\n var cnt = sa[offset/2 + 1];\n offset += 4;\n\n if (isLeaf != 0) {\n for (var i = 0; i < cnt; ++i) {\n var lo = offset/4;\n var startChrom = la[lo];\n var startBase = la[lo + 1];\n var endChrom = la[lo + 2];\n var endBase = la[lo + 3];\n var blockOffset = bwg_readOffset(ba, offset+16);\n var blockSize = bwg_readOffset(ba, offset+24);\n if ((dir < 0 && ((startChrom < chr || (startChrom == chr && startBase <= pos)))) ||\n (dir > 0 && ((endChrom > chr || (endChrom == chr && endBase >= pos)))))\n {\n // console.log('Got an interesting block: startBase=' + startChrom + ':' + startBase + '; endBase=' + endChrom + ':' + endBase + '; offset=' + blockOffset + '; size=' + blockSize);\n if (/_random/.exec(thisB.bwg.idsToChroms[startChrom])) {\n // dlog('skipping random: ' + thisB.bwg.idsToChroms[startChrom]);\n } else if (blockToFetch == null || ((dir < 0) && (endChrom > bestBlockChr || (endChrom == bestBlockChr && endBase > bestBlockOffset)) ||\n (dir > 0) && (startChrom < bestBlockChr || (startChrom == bestBlockChr && startBase < bestBlockOffset))))\n {\n // dlog('best is: startBase=' + startChrom + ':' + startBase + '; endBase=' + endChrom + ':' + endBase + '; offset=' + blockOffset + '; size=' + blockSize);\n blockToFetch = {offset: blockOffset, size: blockSize};\n bestBlockOffset = (dir < 0) ? endBase : startBase;\n bestBlockChr = (dir < 0) ? endChrom : startChrom;\n }\n }\n offset += 32;\n }\n } else {\n var bestRecur = -1;\n var bestPos = -1;\n var bestChr = -1;\n for (var i = 0; i < cnt; ++i) {\n var lo = offset/4;\n var startChrom = la[lo];\n var startBase = la[lo + 1];\n var endChrom = la[lo + 2];\n var endBase = la[lo + 3];\n var blockOffset = (la[lo + 4]<<32) | (la[lo + 5]);\n if ((dir < 0 && ((startChrom < chr || (startChrom == chr && startBase <= pos)) &&\n (endChrom >= chr))) ||\n (dir > 0 && ((endChrom > chr || (endChrom == chr && endBase >= pos)) &&\n (startChrom <= chr))))\n {\n if (bestRecur < 0 || endBase > bestPos) {\n bestRecur = blockOffset;\n bestPos = (dir < 0) ? endBase : startBase;\n bestChr = (dir < 0) ? endChrom : startChrom;\n }\n }\n offset += 24;\n }\n if (bestRecur >= 0) {\n cirFobRecur([bestRecur], level + 1);\n }\n }\n };\n \n\n cirFobRecur([thisB.cirTreeOffset + 48], 1);\n}\n\nBigWig.prototype.readWigData = function(chrName, min, max, callback) {\n this.getUnzoomedView().readWigData(chrName, min, max, callback);\n}\n\nBigWig.prototype.getUnzoomedView = function() {\n if (!this.unzoomedView) {\n var cirLen = 4000;\n var nzl = this.zoomLevels[0];\n if (nzl) {\n cirLen = this.zoomLevels[0].dataOffset - this.unzoomedIndexOffset;\n }\n this.unzoomedView = new BigWigView(this, this.unzoomedIndexOffset, cirLen, false);\n }\n return this.unzoomedView;\n}\n\nBigWig.prototype.getZoomedView = function(z) {\n var zh = this.zoomLevels[z];\n if (!zh.view) {\n zh.view = new BigWigView(this, zh.indexOffset, /* this.zoomLevels[z + 1].dataOffset - zh.indexOffset */ 4000, true);\n }\n return zh.view;\n}\n\nfunction makeBwg(data, callback, name) {\n var bwg = new BigWig();\n bwg.data = data;\n bwg.name = name;\n bwg.data.slice(0, 512).salted().fetch(function(result) {\n if (!result) {\n return callback(null, \"Couldn't fetch file\");\n }\n\n var header = result;\n var ba = new Uint8Array(header);\n var sa = new Int16Array(header);\n var la = new Int32Array(header);\n var magic = ba[0] + (M1 * ba[1]) + (M2 * ba[2]) + (M3 * ba[3]);\n if (magic == BIG_WIG_MAGIC) {\n bwg.type = 'bigwig';\n } else if (magic == BIG_BED_MAGIC) {\n bwg.type = 'bigbed';\n } else if (magic == BIG_WIG_MAGIC_BE || magic == BIG_BED_MAGIC_BE) {\n return callback(null, \"Currently don't support big-endian BBI files\");\n \n } else {\n return callback(null, \"Not a supported format, magic=0x\" + magic.toString(16));\n \n }\n\n bwg.version = sa[2]; // 4\n bwg.numZoomLevels = sa[3]; // 6\n bwg.chromTreeOffset = bwg_readOffset(ba, 8);\n bwg.unzoomedDataOffset = bwg_readOffset(ba, 16);\n bwg.unzoomedIndexOffset = bwg_readOffset(ba, 24);\n bwg.fieldCount = sa[16]; // 32\n bwg.definedFieldCount = sa[17]; // 34\n bwg.asOffset = bwg_readOffset(ba, 36);\n bwg.totalSummaryOffset = bwg_readOffset(ba, 44);\n bwg.uncompressBufSize = la[13]; // 52\n bwg.extHeaderOffset = bwg_readOffset(ba, 56);\n\n bwg.zoomLevels = [];\n for (var zl = 0; zl < bwg.numZoomLevels; ++zl) {\n var zlReduction = la[zl*6 + 16]\n var zlData = bwg_readOffset(ba, zl*24 + 72);\n var zlIndex = bwg_readOffset(ba, zl*24 + 80);\n bwg.zoomLevels.push({reduction: zlReduction, dataOffset: zlData, indexOffset: zlIndex});\n }\n\n bwg.readChromTree(function() {\n bwg.getAutoSQL(function(as) {\n bwg.schema = as;\n return callback(bwg);\n });\n });\n }, {timeout: 5000}); // Potential timeout on first request to catch mixed-content errors on\n // Chromium.\n}\n\n\nBigWig.prototype._tsFetch = function(zoom, chr, min, max, callback) {\n var bwg = this;\n if (zoom >= this.zoomLevels.length - 1) {\n if (!this.topLevelReductionCache) {\n this.getZoomedView(this.zoomLevels.length - 1).readWigDataById(-1, 0, 300000000, function(feats) {\n bwg.topLevelReductionCache = feats;\n return bwg._tsFetch(zoom, chr, min, max, callback);\n });\n } else {\n var f = [];\n var c = this.topLevelReductionCache;\n for (var fi = 0; fi < c.length; ++fi) {\n if (c[fi]._chromId == chr) {\n f.push(c[fi]);\n }\n }\n return callback(f);\n }\n } else {\n var view;\n if (zoom < 0) {\n view = this.getUnzoomedView();\n } else {\n view = this.getZoomedView(zoom);\n }\n return view.readWigDataById(chr, min, max, callback);\n }\n}\n\nBigWig.prototype.thresholdSearch = function(chrName, referencePoint, dir, threshold, callback) {\n dir = (dir<0) ? -1 : 1;\n var bwg = this;\n var initialChr = this.chromsToIDs[chrName];\n var candidates = [{chrOrd: 0, chr: initialChr, zoom: bwg.zoomLevels.length - 4, min: 0, max: 300000000, fromRef: true}]\n for (var i = 1; i <= this.maxID + 1; ++i) {\n var chrId = (initialChr + (dir*i)) % (this.maxID + 1);\n if (chrId < 0) \n chrId += (this.maxID + 1);\n candidates.push({chrOrd: i, chr: chrId, zoom: bwg.zoomLevels.length - 1, min: 0, max: 300000000})\n }\n \n function fbThresholdSearchRecur() {\n \tif (candidates.length == 0) {\n \t return callback(null);\n \t}\n \tcandidates.sort(function(c1, c2) {\n \t var d = c1.zoom - c2.zoom;\n \t if (d != 0)\n \t\t return d;\n\n d = c1.chrOrd - c2.chrOrd;\n if (d != 0)\n return d;\n \t else\n \t\t return c1.min - c2.min * dir;\n \t});\n\n\t var candidate = candidates.splice(0, 1)[0];\n bwg._tsFetch(candidate.zoom, candidate.chr, candidate.min, candidate.max, function(feats) {\n var rp = dir > 0 ? 0 : 300000000;\n if (candidate.fromRef)\n rp = referencePoint;\n \n for (var fi = 0; fi < feats.length; ++fi) {\n \t var f = feats[fi];\n var score;\n if (f.maxScore != undefined)\n score = f.maxScore;\n else\n score = f.score;\n\n if (dir > 0) {\n \t if (score > threshold) {\n \t\t if (candidate.zoom < 0) {\n \t\t if (f.min > rp)\n return callback(f);\n \t\t } else if (f.max > rp) {\n \t\t candidates.push({chr: candidate.chr, chrOrd: candidate.chrOrd, zoom: candidate.zoom - 2, min: f.min, max: f.max, fromRef: candidate.fromRef});\n \t\t }\n }\n } else {\n if (score > threshold) {\n \t\t if (candidate.zoom < 0) {\n \t if (f.max < rp)\n \t\t\t return callback(f);\n } else if (f.min < rp) {\n candidates.push({chr: candidate.chr, chrOrd: candidate.chrOrd, zoom: candidate.zoom - 2, min: f.min, max: f.max, fromRef: candidate.fromRef});\n }\n \t }\n }\n \t }\n fbThresholdSearchRecur();\n });\n }\n \n fbThresholdSearchRecur();\n}\n\nBigWig.prototype.getAutoSQL = function(callback) {\n var thisB = this;\n if (!this.asOffset)\n return callback(null);\n\n\n this.data.slice(this.asOffset, 2048).fetch(function(result) {\n var ba = new Uint8Array(result);\n var s = '';\n for (var i = 0; i < ba.length; ++i) {\n if (ba[i] == 0)\n break;\n s += String.fromCharCode(ba[i]);\n }\n \n /* \n * Quick'n'dirty attempt to parse autoSql format.\n * See: http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/059/5949/5949l2.html\n */\n\n var header_re = /(\\w+)\\s+(\\w+)\\s+(\"([^\"]+)\")?\\s+\\(\\s*/;\n var field_re = /([\\w\\[\\]]+)\\s+(\\w+)\\s*;\\s*(\"([^\"]+)\")?\\s*/g;\n\n var headerMatch = header_re.exec(s);\n if (headerMatch) {\n var as = {\n declType: headerMatch[1],\n name: headerMatch[2],\n comment: headerMatch[4],\n\n fields: []\n };\n\n s = s.substring(headerMatch[0]);\n for (var m = field_re.exec(s); m != null; m = field_re.exec(s)) {\n as.fields.push({type: m[1],\n name: m[2],\n comment: m[4]});\n }\n\n return callback(as);\n }\n });\n}\n\nBigWig.prototype.getExtraIndices = function(callback) {\n var thisB = this;\n if (this.version < 4 || this.extHeaderOffset == 0 || this.type != 'bigbed') {\n return callback(null);\n } else {\n this.data.slice(this.extHeaderOffset, 64).fetch(function(result) {\n if (!result) {\n return callback(null, \"Couldn't fetch extension header\");\n }\n\n var ba = new Uint8Array(result);\n var sa = new Int16Array(result);\n var la = new Int32Array(result);\n \n var extHeaderSize = sa[0];\n var extraIndexCount = sa[1];\n var extraIndexListOffset = bwg_readOffset(ba, 4);\n\n if (extraIndexCount == 0) {\n return callback(null);\n }\n\n // FIXME 20byte records only make sense for single-field indices.\n // Right now, these seem to be the only things around, but the format\n // is actually more general.\n thisB.data.slice(extraIndexListOffset, extraIndexCount * 20).fetch(function(eil) {\n if (!eil) {\n return callback(null, \"Couldn't fetch index info\");\n }\n\n var ba = new Uint8Array(eil);\n var sa = new Int16Array(eil);\n var la = new Int32Array(eil);\n\n var indices = [];\n for (var ii = 0; ii < extraIndexCount; ++ii) {\n var eiType = sa[ii*10];\n var eiFieldCount = sa[ii*10 + 1];\n var eiOffset = bwg_readOffset(ba, ii*20 + 4);\n var eiField = sa[ii*10 + 8]\n var index = new BBIExtraIndex(thisB, eiType, eiFieldCount, eiOffset, eiField);\n indices.push(index);\n }\n callback(indices);\n });\n });\n }\n}\n\nfunction BBIExtraIndex(bbi, type, fieldCount, offset, field) {\n this.bbi = bbi;\n this.type = type;\n this.fieldCount = fieldCount;\n this.offset = offset;\n this.field = field;\n}\n\nBBIExtraIndex.prototype.lookup = function(name, callback) {\n var thisB = this;\n\n this.bbi.data.slice(this.offset, 32).fetch(function(bpt) {\n var ba = new Uint8Array(bpt);\n var sa = new Int16Array(bpt);\n var la = new Int32Array(bpt);\n var bptMagic = la[0];\n var blockSize = la[1];\n var keySize = la[2];\n var valSize = la[3];\n var itemCount = bwg_readOffset(ba, 16);\n var rootNodeOffset = 32;\n\n function bptReadNode(nodeOffset) {\n thisB.bbi.data.slice(nodeOffset, 4 + (blockSize * (keySize + valSize))).fetch(function(node) {\n var ba = new Uint8Array(node);\n var sa = new Uint16Array(node);\n var la = new Uint32Array(node);\n\n var nodeType = ba[0];\n var cnt = sa[1];\n\n var offset = 4;\n if (nodeType == 0) {\n var lastChildOffset = null;\n for (var n = 0; n < cnt; ++n) {\n var key = '';\n for (var ki = 0; ki < keySize; ++ki) {\n var charCode = ba[offset++];\n if (charCode != 0) {\n key += String.fromCharCode(charCode);\n }\n }\n\n var childOffset = bwg_readOffset(ba, offset);\n offset += 8;\n \n if (name.localeCompare(key) < 0 && lastChildOffset) {\n bptReadNode(lastChildOffset);\n return;\n }\n lastChildOffset = childOffset;\n }\n bptReadNode(lastChildOffset);\n } else {\n for (var n = 0; n < cnt; ++n) {\n var key = '';\n for (var ki = 0; ki < keySize; ++ki) {\n var charCode = ba[offset++];\n if (charCode != 0) {\n key += String.fromCharCode(charCode);\n }\n }\n \n // Specific for EI case.\n if (key == name) {\n var start = bwg_readOffset(ba, offset);\n var length = readInt(ba, offset + 8);\n\n return thisB.bbi.getUnzoomedView().fetchFeatures(\n function(chr, min, max, toks) {\n if (toks && toks.length > thisB.field - 3)\n return toks[thisB.field - 3] == name;\n }, \n [{offset: start, size: length}], \n callback);\n }\n offset += valSize;\n }\n return callback([]);\n }\n });\n }\n\n bptReadNode(thisB.offset + rootNodeOffset);\n });\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n makeBwg: makeBwg,\n BIG_BED_MAGIC: BIG_BED_MAGIC,\n BIG_WIG_MAGIC: BIG_WIG_MAGIC\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// bin.js general binary data support\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n\n var sha1 = require('./sha1');\n var b64_sha1 = sha1.b64_sha1;\n\n var Promise = require('es6-promise').Promise;\n}\n\nfunction BlobFetchable(b) {\n this.blob = b;\n}\n\nBlobFetchable.prototype.slice = function(start, length) {\n var b;\n\n if (this.blob.slice) {\n if (length) {\n b = this.blob.slice(start, start + length);\n } else {\n b = this.blob.slice(start);\n }\n } else {\n if (length) {\n b = this.blob.webkitSlice(start, start + length);\n } else {\n b = this.blob.webkitSlice(start);\n }\n }\n return new BlobFetchable(b);\n}\n\nBlobFetchable.prototype.salted = function() {return this;}\n\nif (typeof(FileReader) !== 'undefined') {\n // console.log('defining async BlobFetchable.fetch');\n\n BlobFetchable.prototype.fetch = function(callback) {\n var reader = new FileReader();\n reader.onloadend = function(ev) {\n callback(bstringToBuffer(reader.result));\n };\n reader.readAsBinaryString(this.blob);\n }\n\n} else {\n // if (console && console.log)\n // console.log('defining sync BlobFetchable.fetch');\n\n BlobFetchable.prototype.fetch = function(callback) {\n var reader = new FileReaderSync();\n try {\n var res = reader.readAsArrayBuffer(this.blob);\n callback(res);\n } catch (e) {\n callback(null, e);\n }\n }\n}\n\nfunction URLFetchable(url, start, end, opts) {\n if (!opts) {\n if (typeof start === 'object') {\n opts = start;\n start = undefined;\n } else {\n opts = {};\n }\n }\n\n this.url = url;\n this.start = start || 0;\n if (end) {\n this.end = end;\n }\n this.opts = opts;\n}\n\nURLFetchable.prototype.slice = function(s, l) {\n if (s < 0) {\n throw 'Bad slice ' + s;\n }\n\n var ns = this.start, ne = this.end;\n if (ns && s) {\n ns = ns + s;\n } else {\n ns = s || ns;\n }\n if (l && ns) {\n ne = ns + l - 1;\n } else {\n ne = ne || l - 1;\n }\n return new URLFetchable(this.url, ns, ne, this.opts);\n}\n\nvar seed=0;\nvar isSafari = typeof(navigator) !== 'undefined' &&\n navigator.userAgent.indexOf('Safari') >= 0 &&\n navigator.userAgent.indexOf('Chrome') < 0 ;\n\nURLFetchable.prototype.fetchAsText = function(callback) {\n var thisB = this;\n\n this.getURL().then(function(url) {\n try {\n var req = new XMLHttpRequest();\n var length;\n if ((isSafari || thisB.opts.salt) && url.indexOf('?') < 0) {\n url = url + '?salt=' + b64_sha1('' + Date.now() + ',' + (++seed));\n }\n req.open('GET', url, true);\n \n if (thisB.end) {\n if (thisB.end - thisB.start > 100000000) {\n throw 'Monster fetch!';\n }\n req.setRequestHeader('Range', 'bytes=' + thisB.start + '-' + thisB.end);\n length = thisB.end - thisB.start + 1;\n }\n\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status == 200 || req.status == 206) {\n return callback(req.responseText);\n } else {\n return callback(null);\n }\n }\n };\n if (thisB.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n } catch (e) {\n return callback(null);\n }\n }).catch(function(err) {\n console.log(err);\n return callback(null, err);\n });\n}\n\nURLFetchable.prototype.salted = function() {\n var o = shallowCopy(this.opts);\n o.salt = true;\n return new URLFetchable(this.url, this.start, this.end, o);\n}\n\nURLFetchable.prototype.getURL = function() {\n if (this.opts.resolver) {\n return this.opts.resolver(this.url).then(function (urlOrObj) {\n if (typeof urlOrObj === 'string') {\n return urlOrObj;\n } else {\n return urlOrObj.url;\n }\n });\n } else {\n return Promise.resolve(this.url);\n }\n}\n\nURLFetchable.prototype.fetch = function(callback, opts) {\n var thisB = this;\n \n opts = opts || {};\n var attempt = opts.attempt || 1;\n var truncatedLength = opts.truncatedLength;\n if (attempt > 3) {\n return callback(null);\n }\n\n this.getURL().then(function(url) {\n try {\n var timeout;\n if (opts.timeout && !thisB.opts.credentials) {\n timeout = setTimeout(\n function() {\n console.log('timing out ' + url);\n req.abort();\n return callback(null, 'Timeout');\n },\n opts.timeout\n );\n }\n \n var req = new XMLHttpRequest();\n var length;\n if ((isSafari || thisB.opts.salt) && url.indexOf('?') < 0) {\n url = url + '?salt=' + b64_sha1('' + Date.now() + ',' + (++seed));\n }\n req.open('GET', url, true);\n req.overrideMimeType('text/plain; charset=x-user-defined');\n if (thisB.end) {\n if (thisB.end - thisB.start > 100000000) {\n throw 'Monster fetch!';\n }\n req.setRequestHeader('Range', 'bytes=' + thisB.start + '-' + thisB.end);\n length = thisB.end - thisB.start + 1;\n }\n req.responseType = 'arraybuffer';\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (timeout)\n clearTimeout(timeout);\n if (req.status == 200 || req.status == 206) {\n if (req.response) {\n var bl = req.response.byteLength;\n if (length && length != bl && (!truncatedLength || bl != truncatedLength)) {\n return thisB.fetch(callback, {attempt: attempt + 1, truncatedLength: bl});\n } else {\n return callback(req.response);\n }\n } else if (req.mozResponseArrayBuffer) {\n return callback(req.mozResponseArrayBuffer);\n } else {\n var r = req.responseText;\n if (length && length != r.length && (!truncatedLength || r.length != truncatedLength)) {\n return thisB.fetch(callback, {attempt: attempt + 1, truncatedLength: r.length});\n } else {\n return callback(bstringToBuffer(req.responseText));\n }\n }\n } else {\n return thisB.fetch(callback, {attempt: attempt + 1});\n }\n }\n };\n if (thisB.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n } catch (e) {\n return callback(null);\n }\n }).catch(function(err) {\n console.log(err);\n return callback(null, err);\n });\n}\n \nfunction bstringToBuffer(result) {\n if (!result) {\n return null;\n }\n\n var ba = new Uint8Array(result.length);\n for (var i = 0; i < ba.length; ++i) {\n ba[i] = result.charCodeAt(i);\n }\n return ba.buffer;\n}\n\n// Read from Uint8Array\n\nvar convertBuffer = new ArrayBuffer(8);\nvar ba = new Uint8Array(convertBuffer);\nvar fa = new Float32Array(convertBuffer);\n\nfunction readFloat(buf, offset) {\n ba[0] = buf[offset];\n ba[1] = buf[offset+1];\n ba[2] = buf[offset+2];\n ba[3] = buf[offset+3];\n return fa[0];\n}\n\nfunction readInt64(ba, offset) {\n return (ba[offset + 7] << 24) | (ba[offset + 6] << 16) | (ba[offset + 5] << 8) | (ba[offset + 4]);\n}\n\nfunction readInt(ba, offset) {\n return (ba[offset + 3] << 24) | (ba[offset + 2] << 16) | (ba[offset + 1] << 8) | (ba[offset]);\n}\n\nfunction readShort(ba, offset) {\n return (ba[offset + 1] << 8) | (ba[offset]);\n}\n\nfunction readByte(ba, offset) {\n return ba[offset];\n}\n\nfunction readIntBE(ba, offset) {\n return (ba[offset] << 24) | (ba[offset + 1] << 16) | (ba[offset + 2] << 8) | (ba[offset + 3]);\n}\n\n// Exports if we are being used as a module\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n BlobFetchable: BlobFetchable,\n URLFetchable: URLFetchable,\n\n readInt: readInt,\n readIntBE: readIntBE,\n readInt64: readInt64,\n readShort: readShort,\n readByte: readByte,\n readFloat: readFloat\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// browser-us.js: standard UI wiring\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n\n var nf = require('./numformats');\n var formatLongInt = nf.formatLongInt;\n\n var makeZoomSlider = require('./zoomslider');\n\n // For side effects\n\n require('./tier-edit');\n require('./export-config');\n require('./export-ui');\n require('./export-image');\n require('./svg-export');\n require('./session');\n}\n\n/*\n * Quite a bit of this ought to be done using a templating system, but\n * since web-components isn't quite ready for prime time yet we'll stick\n * with constructing it all in Javascript for now...\n */\n\nBrowser.prototype.initUI = function(holder, genomePanel) {\n if (!this.noSourceCSS) {\n ['bootstrap-scoped.css', 'dalliance-scoped.css', 'font-awesome.min.css'].forEach(function(path) {\n document.head.appendChild(makeElement('link', '', {\n rel: 'stylesheet',\n href: this.resolveURL('$$css/' + path)\n }));\n }.bind(this));\n }\n\n var b = this;\n\n if (!b.disableDefaultFeaturePopup) {\n this.addFeatureListener(function(ev, feature, hit, tier) {\n b.featurePopup(ev, feature, hit, tier);\n });\n }\n\n holder.classList.add('dalliance');\n var toolbar = b.toolbar = makeElement('div', null, {className: 'btn-toolbar toolbar'});\n\n var title = b.coordSystem.speciesName + ' ' + b.nameForCoordSystem(b.coordSystem);\n if (this.setDocumentTitle) {\n document.title = title + ' :: dalliance';\n }\n\n var locField = makeElement('input', '', {className: 'loc-field'});\n b.makeTooltip(locField, 'Enter a genomic location or gene name');\n var locStatusField = makeElement('p', '', {className: 'loc-status'});\n\n var zoomInBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-search-plus'})], {className: 'btn'});\n var zoomSlider = new makeZoomSlider({width: b.zoomSliderWidth});\n b.makeTooltip(zoomSlider, \"Highlighted button shows current zoom level, gray button shows inactive zoom level (click or tap SPACE to toggle).\")\n\n var zoomOutBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-search-minus'})], {className: 'btn'});\n\n var clearHighlightsButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-eraser'})], {className: 'btn'});\n\n var addTrackBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-plus'})], {className: 'btn'});\n var favBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-bookmark'})], {className: 'btn'});\n var svgBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-print'})], {className: 'btn'});\n var resetBtn = makeElement('a', [makeElement('i', null, {className: 'fa fa-refresh'})], {className: 'btn'});\n var optsButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-cogs'})], {className: 'btn'});\n var helpButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-question'})], {className: 'btn'});\n\n var tierEditButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-road'})], {className: 'btn'});\n b.makeTooltip(tierEditButton, 'Configure currently selected track(s) (E)')\n\n var leapLeftButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-angle-left'})], {className: 'btn'}, {width: '5px'});\n var leapRightButton = makeElement('a', [makeElement('i', null, {className: 'fa fa-angle-right'})], {className: 'btn pull-right'}, {width: '5px'});\n\n var modeButtons = makeElement('div', null, {className: 'btn-group pull-right'});\n if (!this.noTrackAdder)\n modeButtons.appendChild(addTrackBtn);\n if (!this.noTrackEditor)\n modeButtons.appendChild(tierEditButton);\n if (!this.noExport)\n modeButtons.appendChild(svgBtn);\n if (!this.noOptions)\n modeButtons.appendChild(optsButton);\n if (!this.noHelp)\n modeButtons.appendChild(helpButton);\n\n this.setUiMode = function(m) {\n this.uiMode = m;\n var mb = {help: helpButton, add: addTrackBtn, opts: optsButton, 'export': svgBtn, tier: tierEditButton};\n for (var x in mb) {\n if (x == m)\n mb[x].classList.add('active');\n else\n mb[x].classList.remove('active');\n }\n }\n\n if (!this.noLeapButtons)\n toolbar.appendChild(leapRightButton);\n\n if (modeButtons.firstChild)\n toolbar.appendChild(modeButtons);\n \n if (!this.noLeapButtons)\n toolbar.appendChild(leapLeftButton);\n if (!this.noTitle) {\n toolbar.appendChild(makeElement('div', makeElement('h4', title, {}, {margin: '0px'}), {className: 'btn-group title'}));\n }\n if (!this.noLocationField)\n toolbar.appendChild(makeElement('div', [locField, locStatusField], {className: 'btn-group loc-group'}));\n if (!this.noClearHighlightsButton)\n toolbar.appendChild(clearHighlightsButton);\n\n if (!this.noZoomSlider) {\n toolbar.appendChild(makeElement('div', [zoomInBtn,\n makeElement('span', zoomSlider, {className: 'btn'}),\n zoomOutBtn], {className: 'btn-group'}));\n }\n \n if (this.toolbarBelow) {\n holder.appendChild(genomePanel);\n holder.appendChild(toolbar);\n } else {\n holder.appendChild(toolbar);\n holder.appendChild(genomePanel);\n }\n\n\n var lt2 = Math.log(2) / Math.log(10);\n var lt5 = Math.log(5) / Math.log(10);\n var roundSliderValue = function(x) {\n var ltx = (x / b.zoomExpt + Math.log(b.zoomBase)) / Math.log(10);\n \n var whole = ltx|0\n var frac = ltx - whole;\n var rounded\n\n if (frac < 0.01)\n rounded = whole;\n else if (frac <= (lt2 + 0.01))\n rounded = whole + lt2;\n else if (frac <= (lt5 + 0.01))\n rounded = whole + lt5;\n else {\n rounded = whole + 1;\n }\n\n return (rounded * Math.log(10) -Math.log(b.zoomBase)) * b.zoomExpt;\n }\n\n var markSlider = function(x) {\n zoomSlider.addLabel(x, humanReadableScale(Math.exp(x / b.zoomExpt) * b.zoomBase));\n }\n\n this.addViewListener(function(chr, min, max, _oldZoom, zoom) {\n locField.value = (chr + ':' + formatLongInt(min) + '..' + formatLongInt(max));\n zoomSlider.min = zoom.min|0;\n zoomSlider.max = zoom.max|0;\n if (zoom.isSnapZooming) {\n zoomSlider.value = zoom.alternate\n zoomSlider.value2 = zoom.current;\n zoomSlider.active = 2;\n } else {\n zoomSlider.value = zoom.current;\n zoomSlider.value2 = zoom.alternate;\n zoomSlider.active = 1;\n }\n\n if (zoom.current == zoom.min)\n zoomInBtn.classList.add('disabled');\n else\n zoomInBtn.classList.remove('disabled');\n\n if (zoom.current == zoom.max)\n zoomOutBtn.classList.add('disabled');\n else\n zoomOutBtn.classList.remove('disabled');\n\n zoomSlider.removeLabels();\n var zmin = zoom.min;\n var zmax = zoom.max;\n var zrange = zmax - zmin;\n\n \n var numSliderTicks = 4;\n if (b.zoomSliderWidth && b.zoomSliderWidth < 150)\n numSliderTicks = 3;\n markSlider(roundSliderValue(zmin));\n for (var sti = 1; sti < numSliderTicks - 1; ++sti) {\n markSlider(roundSliderValue(zmin + (1.0 * sti * zrange / (numSliderTicks -1))));\n }\n markSlider(roundSliderValue(zmax));\n\n if (b.storeStatus) {\n b.storeViewStatus();\n }\n\n if (b.highlights.length > 0) {\n clearHighlightsButton.style.display = 'inline-block';\n } else {\n clearHighlightsButton.style.display = 'none';\n }\n });\n\n this.addTierListener(function() {\n if (b.storeStatus) {\n b.storeTierStatus();\n }\n });\n\n locField.addEventListener('keydown', function(ev) {\n if (ev.keyCode == 40) {\n ev.preventDefault(); ev.stopPropagation();\n b.setSelectedTier(0);\n } if (ev.keyCode == 10 || ev.keyCode == 13) {\n ev.preventDefault();\n\n\n var g = locField.value;\n b.search(g, function(err) {\n if (err) {\n locStatusField.textContent = '' + err;\n } else {\n locStatusField.textContent = '';\n }\n });\n }\n }, false);\n \n var trackAddPopup;\n addTrackBtn.addEventListener('click', function(ev) {\n if (trackAddPopup && trackAddPopup.displayed) {\n b.removeAllPopups();\n } else {\n trackAddPopup = b.showTrackAdder(ev);\n }\n }, false);\n b.makeTooltip(addTrackBtn, 'Add a new track from the registry or an indexed file. (A)');\n\n zoomInBtn.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n\n b.zoomStep(-10);\n }, false);\n b.makeTooltip(zoomInBtn, 'Zoom in (+)');\n\n zoomOutBtn.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n\n b.zoomStep(10);\n }, false);\n b.makeTooltip(zoomOutBtn, 'Zoom out (-)');\n\n zoomSlider.addEventListener('change', function(ev) {\n var wantSnap = zoomSlider.active == 2;\n if (wantSnap != b.isSnapZooming) {\n b.savedZoom = b.zoomSliderValue - b.zoomMin;\n b.isSnapZooming = wantSnap;\n }\n var activeZSV = zoomSlider.active == 1 ? zoomSlider.value : zoomSlider.value2;\n\n \tb.zoomSliderValue = (1.0 * activeZSV);\n \tb.zoom(Math.exp((1.0 * activeZSV) / b.zoomExpt));\n }, false);\n\n favBtn.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n }, false);\n b.makeTooltip(favBtn, 'Favourite regions');\n\n svgBtn.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n b.openExportPanel();\n }, false);\n b.makeTooltip(svgBtn, 'Export publication-quality SVG. (X)');\n\n var optsPopup;\n optsButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n\n b.toggleOptsPopup(ev);\n }, false);\n b.makeTooltip(optsButton, 'Configure options.');\n\n helpButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n b.toggleHelpPopup(ev);\n });\n b.makeTooltip(helpButton, 'Help; Keyboard shortcuts. (H)');\n\n tierEditButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n if (b.selectedTiers.length == 1) {\n b.openTierPanel(b.tiers[b.selectedTiers[0]]);\n }\n }, false);\n\n leapLeftButton.addEventListener('click', function(ev) {\n b.leap(b.reverseKeyScrolling ? -1 : 1, false);\n }, false);\n b.makeTooltip(leapLeftButton, function(ev) {\n var st = b.getSelectedTier();\n var tier;\n if (st >= 0)\n tier = b.tiers[st];\n\n if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof(tier.quantLeapThreshold) == 'number') {\n return 'Jump to the next region with a score above the threshold in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\"\" (ctrl+LEFT)';\n } else if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'leap')) {\n return 'Jump to the next feature in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\" (ctrl+LEFT)';\n } else {\n return 'Jump left (shift+LEFT)';\n }\n });\n\n leapRightButton.addEventListener('click', function(ev) {\n b.leap(b.reverseKeyScrolling ? 1 : -1, false);\n }, false);\n b.makeTooltip(leapRightButton, function(ev) {\n var st = b.getSelectedTier();\n var tier;\n if (st >= 0)\n tier = b.tiers[st];\n\n if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof(tier.quantLeapThreshold) == 'number') {\n return 'Jump to the next region with a score above the threshold in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\"\" (ctrl+RIGHT)';\n } else if (tier && tier.featureSource && b.sourceAdapterIsCapable(tier.featureSource, 'leap')) {\n return 'Jump to the next feature in the selected track \"' + (tier.config.name || tier.dasSource.name) + '\" (ctrl+RIGHT)';\n } else {\n return 'Jump right (shift+RIGHT)';\n }\n });\n b.addTierSelectionListener(function() {\n var st = b.getSelectedTier();\n var tier;\n if (st >= 0)\n tier = b.tiers[st];\n\n var canLeap = false;\n if (tier && tier.featureSource) {\n if (b.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof(tier.quantLeapThreshold) == 'number')\n canLeap = true;\n else if (b.sourceAdapterIsCapable(tier.featureSource, 'leap'))\n canLeap = true;\n }\n\n leapLeftButton.firstChild.className = canLeap ? 'fa fa-angle-double-left' : 'fa fa-angle-left';\n leapRightButton.firstChild.className = canLeap ? 'fa fa-angle-double-right' : 'fa fa-angle-right';\n });\n\n clearHighlightsButton.addEventListener('click', function(ev) {\n b.clearHighlights();\n }, false);\n b.makeTooltip(clearHighlightsButton, 'Clear highlights (C)');\n\n b.addTierSelectionWrapListener(function(dir) {\n if (dir < 0) {\n b.setSelectedTier(null);\n locField.focus();\n }\n });\n\n b.addTierSelectionListener(function(sel) {\n if (b.uiMode === 'tier') {\n if (sel.length == 0) {\n b.hideToolPanel();\n b.manipulatingTier = null;\n b.uiMode = 'none';\n } else {\n var ft = b.tiers[sel[0]];\n if (ft != b.manipulatingTier) {\n b.openTierPanel(ft);\n }\n }\n }\n });\n\n var uiKeyHandler = function(ev) {\n // console.log('bukh: ' + ev.keyCode);\n if (ev.keyCode == 65 || ev.keyCode == 97) { // a\n ev.preventDefault(); ev.stopPropagation();\n b.showTrackAdder();\n } else if (ev.keyCode == 72 || ev.keyCode == 104) { // h\n ev.stopPropagation(); ev.preventDefault();\n b.toggleHelpPopup(ev);\n } else if (ev.keyCode == 69 || ev.keyCode == 101) { //e\n ev.stopPropagation(); ev.preventDefault();\n if (b.selectedTiers.length == 1) {\n b.openTierPanel(b.tiers[b.selectedTiers[0]]);\n }\n } else if (ev.keyCode == 88 || ev.keyCode == 120) { // x\n ev.stopPropagation(); ev.preventDefault();\n b.openExportPanel();\n } else if (ev.keyCode == 67 || ev.keyCode == 99) { // c\n ev.stopPropagation(); ev.preventDefault();\n b.clearHighlights();\n }\n };\n\n holder.addEventListener('focus', function(ev) {\n holder.addEventListener('keydown', uiKeyHandler, false);\n }, false);\n holder.addEventListener('blur', function(ev) {\n holder.removeEventListener('keydown', uiKeyHandler, false);\n }, false);\n\n holder.addEventListener('keydown', function(ev) {\n if (ev.keyCode === 27) {\n if (b.uiMode !== 'none') {\n // Only consume event if tool panel is open.\n ev.preventDefault();\n ev.stopPropagation();\n b.setUiMode('none');\n b.hideToolPanel();\n\n if (b.selectedTiers && b.selectedTiers.length > 0) {\n b.browserHolder.focus();\n }\n }\n }\n }, false);\n}\n\nBrowser.prototype.showToolPanel = function(panel, nowrap) {\n var thisB = this;\n\n if (this.activeToolPanel) {\n this.activeToolPanel.parentElement.removeChild(this.activeToolPanel);\n }\n\n var content;\n if (nowrap)\n content = panel;\n else\n content = makeElement('div', panel, {}, {overflowY: 'auto', width: '100%'});\n\n\n var divider = makeElement('div', makeElement('i', null, {className: 'fa fa-caret-right'}), {className: 'tool-divider'});\n divider.addEventListener('click', function(ev) {\n thisB.hideToolPanel();\n thisB.setUiMode('none');\n }, false);\n this.makeTooltip(divider, 'Close tool panel (ESC)');\n this.activeToolPanel = makeElement('div', [divider, content], {className: 'tool-holder'});\n this.svgHolder.appendChild(this.activeToolPanel);\n this.resizeViewer();\n\n var thisB = this;\n}\n\nBrowser.prototype.hideToolPanel = function() {\n if (this.activeToolPanel) {\n this.activeToolPanel.parentElement.removeChild(this.activeToolPanel);\n }\n this.svgHolder.style.width = '100%';\n this.activeToolPanel = null;\n this.resizeViewer();\n}\n\nBrowser.prototype.toggleHelpPopup = function(ev) {\n if (this.uiMode === 'help') {\n this.hideToolPanel();\n this.setUiMode('none');\n } else {\n var helpFrame = makeElement('iframe', null, {scrolling: 'yes', seamless: 'seamless', src: this.resolveURL('$$help/index.html'), className: 'help-panel'});\n this.showToolPanel(helpFrame, false);\n this.setUiMode('help');\n }\n}\n\nBrowser.prototype.toggleOptsPopup = function(ev) {\n var b = this;\n\n if (this.uiMode === 'opts') {\n this.hideToolPanel();\n this.setUiMode('none');\n } else {\n var optsForm = makeElement('div', null, {className: 'form-horizontal'}, {boxSizing: 'border-box', MozBoxSizing: 'border-box', display: 'inline-block', verticalAlign: 'top'});\n var optsTable = makeElement('table');\n optsTable.cellPadding = 5;\n\n var scrollModeButton = makeElement('input', '', {type: 'checkbox', checked: b.reverseScrolling});\n scrollModeButton.addEventListener('change', function(ev) {\n b.reverseScrolling = scrollModeButton.checked;\n b.storeStatus();\n }, false);\n optsTable.appendChild(makeElement('tr', [makeElement('td', 'Reverse trackpad scrolling', {align: 'right'}), makeElement('td', scrollModeButton)]));\n\n var scrollKeyButton = makeElement('input', '', {type: 'checkbox', checked: b.reverseKeyScrolling});\n scrollKeyButton.addEventListener('change', function(ev) {\n b.reverseKeyScrolling = scrollKeyButton.checked;\n b.storeStatus();\n }, false);\n optsTable.appendChild(makeElement('tr', [makeElement('td', 'Reverse scrolling buttons and keys', {align: 'right'}), makeElement('td', scrollKeyButton)]));\n\n\n var rulerSelect = makeElement('select');\n rulerSelect.appendChild(makeElement('option', 'Left', {value: 'left'}));\n rulerSelect.appendChild(makeElement('option', 'Center', {value: 'center'}));\n rulerSelect.appendChild(makeElement('option', 'Right', {value: 'right'}));\n rulerSelect.appendChild(makeElement('option', 'None', {value: 'none'}));\n rulerSelect.value = b.rulerLocation;\n rulerSelect.addEventListener('change', function(ev) {\n b.rulerLocation = rulerSelect.value;\n b.positionRuler();\n for (var ti = 0; ti < b.tiers.length; ++ti) {\n b.tiers[ti].paintQuant();\n }\n b.storeStatus();\n }, false);\n optsTable.appendChild(makeElement('tr', [makeElement('td', 'Vertical guideline', {align: 'right'}), makeElement('td', rulerSelect)]));\n \n var singleBaseHighlightButton = makeElement('input', '', {type: 'checkbox', checked: b.singleBaseHighlight}); \n singleBaseHighlightButton.addEventListener('change', function(ev) {\n b.singleBaseHighlight = singleBaseHighlightButton.checked;\n b.positionRuler();\n b.storeStatus();\n }, false);\n singleBaseHighlightButton.setAttribute('id','singleBaseHightlightButton'); // making this because access is required when the key 'u' is pressed and the options are visible\n optsTable.appendChild(makeElement('tr', [makeElement('td', 'Display and highlight current genome location', {align: 'right'}), makeElement('td', singleBaseHighlightButton)]));\n \n optsForm.appendChild(optsTable);\n\n var resetButton = makeElement('button', 'Reset browser', {className: 'btn'}, {marginLeft: 'auto', marginRight: 'auto', display: 'block'});\n resetButton.addEventListener('click', function(ev) {\n b.reset();\n }, false);\n optsForm.appendChild(resetButton);\n\n this.showToolPanel(optsForm);\n this.setUiMode('opts');\n }\n}\n\nfunction humanReadableScale(x) {\n var suffix = 'bp';\n if (x > 1000000000) {\n x /= 1000000000;\n suffix = 'Gb';\n } else if (x > 1000000) {\n x /= 1000000\n suffix = 'Mb';\n } else if (x > 1000) {\n x /= 1000;\n suffix = 'kb';\n }\n return '' + Math.round(x) + suffix;\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// cbrowser.js: canvas browser container\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var Observed = utils.Observed;\n var Awaited = utils.Awaited;\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n var miniJSONify = utils.miniJSONify;\n var shallowCopy = utils.shallowCopy;\n var textXHR = utils.textXHR;\n\n var tier = require('./tier');\n var DasTier = tier.DasTier;\n\n var sha1 = require('./sha1');\n var hex_sha1 = sha1.hex_sha1;\n\n var thub = require('./thub');\n var connectTrackHub = thub.connectTrackHub;\n\n var VERSION = require('./version');\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n var formatLongInt = nf.formatLongInt;\n\n var Chainset = require('./chainset').Chainset;\n\n var Promise = require('es6-promise').Promise;\n\n var sourcecompare = require('./sourcecompare');\n var sourcesAreEqual = sourcecompare.sourcesAreEqual;\n var sourcesAreEqualModuloStyle = sourcecompare.sourcesAreEqualModuloStyle;\n var sourceDataURI = sourcecompare.sourceDataURI;\n var sourceStyleURI = sourcecompare.sourceStyleURI;\n\n var DefaultRenderer = require('./default-renderer');\n\n var MultiRenderer = require('./multi-renderer');\n var SubRenderer = require('./sub-renderer');\n\n var DummyRenderer = require('./dummy-renderer');\n}\n\nfunction Region(chr, min, max) {\n this.min = min;\n this.max = max;\n this.chr = chr;\n}\n\nfunction Browser(opts) {\n if (!opts) {\n opts = {};\n }\n\n this.renderers =\n { 'default': DefaultRenderer,\n 'dummy': DummyRenderer,\n 'multi': MultiRenderer,\n 'sub': SubRenderer\n };\n\n this.defaultRenderer = opts.renderer || DefaultRenderer;\n\n this.prefix = '//www.biodalliance.org/release-0.14/';\n\n this.sources = [];\n this.tiers = [];\n this.tierGroups = {};\n\n this.searchOnlySources = [];\n this.searchOnlySourceHolders = [];\n\n this.featureListeners = [];\n this.featureHoverListeners = [];\n this.viewListeners = [];\n this.regionSelectListeners = [];\n this.tierListeners = [];\n this.tierSelectionListeners = [];\n this.tierSelectionWrapListeners = [];\n\n this.cookieKey = 'browser';\n\n this.chains = {};\n\n this.pageName = 'svgHolder'\n this.zoomFactor = 1.0;\n this.maxPixelsPerBase = 10;\n this.origin = 0;\n this.targetQuantRes = 1.0;\n this.featurePanelWidth = 750;\n this.zoomBase = 100;\n this.zoomExpt = 30.0; // Back to being fixed....\n this.zoomSliderValue = 100;\n this.entryPoints = null;\n this.currentSeqMax = -1; // init once EPs are fetched.\n\n this.highlights = [];\n this.selectedTiers = [1];\n\n this.maxViewWidth = 500000;\n this.defaultSubtierMax = 100;\n\n this.highZoomThreshold = 0.2;\n this.mediumZoomThreshold = 0.01\n\n this.minExtraWidth = 100.0;\n this.maxExtraWidth = 1000.0;\n \n // Options.\n\n this.reverseScrolling = false;\n this.rulerLocation = 'center';\n this.defaultHighlightFill = 'red';\n this.defaultHighlightAlpha = 0.3;\n this.exportHighlights = true;\n this.exportRuler = true;\n this.exportBanner = true;\n this.exportRegion = true;\n this.singleBaseHighlight = true;\n\n // Visual config.\n\n // this.tierBackgroundColors = [\"rgb(245,245,245)\", \"rgb(230,230,250)\" /* 'white' */];\n this.tierBackgroundColors = [\"rgb(245,245,245)\", 'white'];\n this.minTierHeight = 20;\n this.noDefaultLabels = false;\n\n // Registry\n\n this.availableSources = new Observed();\n this.defaultSources = [];\n this.mappableSources = {};\n\n // Central DAS Registry no longer available 2015-05\n\n this.registry = null; // '//www.dasregistry.org/das/sources';\n this.noRegistryTabs = true;\n\n this.defaultTrackAdderTab = null;\n\n this.hubs = [];\n this.hubObjects = [];\n\n this.sourceCache = new SourceCache();\n\n this.retina = true;\n\n this.useFetchWorkers = true;\n this.maxWorkers = 2;\n this.workerPath = '$$worker-all.js';\n this.resolvers = {};\n this.resolverSeed = 1;\n\n this.assemblyNamePrimary = true;\n this.assemblyNameUcsc = true;\n\n this.defaultSearchRegionPadding = 10000;\n\n // HTTP warning support\n\n this.httpCanaryURL = 'http://www.biodalliance.org/http-canary.txt';\n this.httpWarningURL = '//www.biodalliance.org/https.html';\n\n this.initListeners = [];\n\n if (opts.baseColors) {\n this.baseColors = opts.baseColors\n } else {\n this.baseColors = {\n A: 'green',\n C: 'blue',\n G: 'orange',\n T: 'red',\n '-' : 'hotpink', // deletion\n 'I' : 'red' // insertion\n };\n }\n\n if (opts.viewStart !== undefined && typeof(opts.viewStart) !== 'number') {\n throw Error('viewStart must be an integer');\n }\n if (opts.viewEnd !== undefined && typeof(opts.viewEnd) !== 'number') {\n throw Error('viewEnd must be an integer');\n }\n if (opts.offscreenInitWidth !== undefined && typeof(opts.offscreenInitWidth) !== 'number') {\n throw Error('offscreenInitWidth must be an integer');\n }\n\n for (var k in opts) {\n this[k] = opts[k];\n }\n \n if (typeof(opts.uiPrefix) === 'string' && typeof(opts.prefix) !== 'string') {\n this.prefix = opts.uiPrefix;\n }\n // If the prefix only starts with a single '/' this is relative to the current\n // site, so we need to prefix the prefix with //{hostname}\n if (this.prefix.indexOf('//') < 0 && this.prefix.indexOf('/') === 0) {\n var location = window.location.hostname;\n if (window.location.port) {\n location += ':' + window.location.port\n };\n this.prefix = '//' + location + this.prefix;\n }\n if (this.prefix.indexOf('//') === 0) {\n var proto = window.location.protocol;\n if (proto == 'http:' || proto == 'https:') {\n // Protocol-relative URLs okay.\n } else {\n console.log(window.location.protocol);\n console.log('WARNING: prefix is set to a protocol-relative URL (' + this.prefix + ' when loading from a non-HTTP source');\n this.prefix = 'http:' + this.prefix;\n }\n }\n\n if (!this.coordSystem) {\n throw Error('Coordinate system must be configured');\n }\n\n if (this.chr === undefined || this.viewStart === undefined || this.viewEnd === undefined) {\n throw Error('Viewed region (chr:start..end) must be defined');\n }\n\n var thisB = this;\n\n if (document.readyState === 'complete') {\n thisB.realInit();\n } else {\n var loadListener = function(ev) {\n window.removeEventListener('load', loadListener, false);\n thisB.realInit();\n }\n window.addEventListener('load', loadListener, false);\n }\n}\n\nBrowser.prototype.resolveURL = function(url) {\n return url.replace('$$', this.prefix);\n}\n\nBrowser.prototype.destroy = function() {\n window.removeEventListener('resize', this.resizeListener, false);\n if (this.fetchWorkers) {\n for (const worker of this.fetchWorkers) {\n worker.terminate();\n }\n }\n}\n\nBrowser.prototype.realInit = function() {\n var self = this;\n var thisB = this;\n\n if (this.wasInitialized) {\n console.log('Attemping to call realInit on an already-initialized Dalliance instance');\n return;\n }\n\n this.wasInitialized = true;\n\n if (typeof(navigator) !== 'undefined') {\n var ua = navigator.userAgent || 'dummy';\n if (ua.indexOf('Trident') >= 0 && ua.indexOf('rv:11') >= 0) {\n // console.log('Detected IE11, disabling tier pinning.');\n this.disablePinning = true;\n }\n }\n\n this.defaultChr = this.chr;\n this.defaultStart = this.viewStart;\n this.defaultEnd = this.viewEnd;\n this.defaultSources = [];\n for (var i = 0; i < this.sources.length; ++i) {\n var s = this.sources[i];\n if (s)\n this.defaultSources.push(s);\n }\n\n if (this.restoreStatus) {\n this.statusRestored = this.restoreStatus();\n }\n\n if (this.injectionPoint && this.injectionPoint instanceof Element) {\n this.browserHolderHolder = this.injectionPoint;\n } else if (this.injectionPoint) {\n this.browserHolderHolder = document.getElementById(this.injectionPoint);\n if (!this.browserHolderHolder) {\n throw Error('injectionPoint must point to a valid DOM element of element ID');\n }\n } else {\n this.browserHolderHolder = document.getElementById(this.pageName);\n if (!this.browserHolderHolder) {\n throw Error('pageName must be a valid element ID (or use the injectionPoint option instead)');\n }\n }\n \n this.browserHolderHolder.classList.add('dalliance-injection-point');\n this.browserHolder = makeElement('div', null, {className: 'dalliance dalliance-root', tabIndex: -1});\n if (this.maxHeight) {\n this.browserHolder.style.maxHeight = this.maxHeight + 'px';\n } else if (this.maxHeight != undefined) {\n this.browserHolder.style.maxHeight = null;\n }\n removeChildren(this.browserHolderHolder);\n this.browserHolderHolder.appendChild(this.browserHolder);\n this.svgHolder = makeElement('div', null, {className: 'main-holder'});\n\n this.initUI(this.browserHolder, this.svgHolder);\n\n this.pinnedTierHolder = makeElement('div', null, {className: 'tier-holder tier-holder-pinned'});\n this.tierHolder = makeElement('div', this.makeLoader(24), {className: 'tier-holder tier-holder-rest'});\n\n this.locSingleBase = makeElement('span', '', {className: 'loc-single-base'});\n var locSingleBaseHolder = makeElement('div', this.locSingleBase,{className: 'loc-single-base-holder'});\n // Add listener to update single base location\n this.addViewListener(function(chr, minFloor, maxFloor, zoomSliderValue, zoomSliderDict, min, max) {\n // Just setting textContent causes layout flickering in Blink.\n // This approach means that the element is never empty.\n var loc = Math.round((max + min) / 2);\n self.locSingleBase.appendChild(document.createTextNode(chr + ':' + formatLongInt(loc)));\n self.locSingleBase.removeChild(self.locSingleBase.firstChild);\n });\n\n if (this.disablePinning) {\n this.tierHolderHolder = this.tierHolder;\n } else {\n this.tierHolderHolder = makeElement('div', [locSingleBaseHolder, this.pinnedTierHolder, this.tierHolder], {className: 'tier-holder-holder'});\n this.svgHolder.appendChild(this.tierHolderHolder);\n }\n this.svgHolder.appendChild(this.tierHolderHolder);\n\n this.bhtmlRoot = makeElement('div');\n if (!this.disablePoweredBy) {\n this.bhtmlRoot.appendChild(makeElement('span', ['Powered by ', makeElement('a', 'Biodalliance', {href: 'http://www.biodalliance.org/'}), ' ' + VERSION], {className: 'powered-by'}));\n }\n this.browserHolder.appendChild(this.bhtmlRoot);\n\n this.resizeListener = function(ev) {\n thisB.resizeViewer();\n };\n\n this.ruler = makeElement('div', null, {className: 'guideline'})\n this.ruler2 = makeElement('div', null, {className: 'single-base-guideline'});\n this.tierHolderHolder.appendChild(this.ruler);\n this.tierHolderHolder.appendChild(this.ruler2);\n this.chainConfigs = this.chains || {};\n this.chains = {};\n for (var k in this.chainConfigs) {\n var cc = this.chainConfigs[k];\n if (cc instanceof Chainset) {\n console.log('WARNING: Should no longer use \"new Chainset\" in Biodalliance configurations.');\n }\n this.chains[k] = new Chainset(cc);\n }\n\n var promisedWorkers;\n if (this.maxWorkers > 0) {\n var pw = [];\n for (var fi = 0; fi < this.maxWorkers; ++fi)\n pw.push(makeFetchWorker(this));\n promisedWorkers = Promise.all(pw);\n } else {\n promisedWorkers = Promise.resolve([]);\n }\n\n this.fetchWorkers = null;\n this.nextWorker = 0;\n promisedWorkers.then(function(v) {\n console.log('Booted ' + v.length + ' workers');\n thisB.fetchWorkers = v;\n }, function(v) {\n console.log('Failed to boot workers', v);\n }).then(function() {\n if (self.offscreenInitWidth || (window.getComputedStyle(thisB.browserHolderHolder).display != 'none' &&\n thisB.tierHolder.getBoundingClientRect().width > 0))\n {\n setTimeout(function() {thisB.realInit2()}, 1);\n } else {\n var pollInterval = setInterval(function() {\n if (window.getComputedStyle(thisB.browserHolderHolder).display != 'none' &&\n thisB.tierHolder.getBoundingClientRect().width > 0)\n {\n clearInterval(pollInterval);\n thisB.realInit2();\n }\n }, 300);\n }\n });\n}\n\nBrowser.prototype.realInit2 = function() {\n var thisB = this;\n\n // Remove the loader icon, if needed\n removeChildren(this.tierHolder);\n removeChildren(this.pinnedTierHolder);\n\n this.featurePanelWidth = this.tierHolder.getBoundingClientRect().width | thisB.offscreenInitWidth | 0;\n window.addEventListener('resize', this.resizeListener, false);\n\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n if (!this.zoomMax) {\n this.zoomMax = this.zoomExpt * Math.log(this.maxViewWidth / this.zoomBase);\n this.zoomMin = this.zoomExpt * Math.log(this.featurePanelWidth / this.maxPixelsPerBase / this.zoomBase);\n }\n this.zoomSliderValue = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n // Event handlers\n\n this.tierHolderHolder.addEventListener('mousewheel', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n\n if (ev.wheelDeltaX) {\n var delta = ev.wheelDeltaX/5;\n if (!thisB.reverseScrolling) {\n delta = -delta;\n }\n thisB.move(delta);\n }\n\n if (ev.wheelDeltaY) {\n var delta = ev.wheelDeltaY;\n if (thisB.reverseScrolling) {\n delta = -delta;\n }\n thisB.tierHolder.scrollTop += delta;\n }\n }, false);\n\n this.tierHolderHolder.addEventListener('MozMousePixelScroll', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n if (ev.axis == 1) {\n if (ev.detail != 0) {\n var delta = ev.detail/4;\n if (thisB.reverseScrolling) {\n delta = -delta;\n }\n thisB.move(delta);\n }\n } else {\n var delta = ev.detail;\n if (!thisB.reverseScrolling) {\n delta = -delta;\n }\n\n thisB.tierHolder.scrollTop += delta;\n }\n }, false);\n\n this.tierHolderHolder.addEventListener('touchstart', function(ev) {return thisB.touchStartHandler(ev)}, false);\n this.tierHolderHolder.addEventListener('touchmove', function(ev) {return thisB.touchMoveHandler(ev)}, false);\n this.tierHolderHolder.addEventListener('touchend', function(ev) {return thisB.touchEndHandler(ev)}, false);\n this.tierHolderHolder.addEventListener('touchcancel', function(ev) {return thisB.touchCancelHandler(ev)}, false);\n\n var keyHandler = function(ev) {\n // console.log('cbkh: ' + ev.keyCode);\n if (ev.keyCode == 13) { // enter\n var layoutsChanged = false;\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n var t = thisB.tiers[ti];\n if (t.wantedLayoutHeight && t.wantedLayoutHeight != t.layoutHeight) {\n t.layoutHeight = t.wantedLayoutHeight;\n t.clipTier();\n layoutsChanged = true;\n }\n }\n if (layoutsChanged) {\n thisB.arrangeTiers();\n }\n } else if (ev.keyCode == 32 || ev.charCode == 32) { // space\n if (!thisB.isSnapZooming) {\n thisB.isSnapZooming = true;\n var newZoom = (thisB.savedZoom || 0.0) + thisB.zoomMin;\n thisB.savedZoom = thisB.zoomSliderValue - thisB.zoomMin;\n thisB.zoomSliderValue = newZoom;\n thisB.zoom(Math.exp((1.0 * newZoom) / thisB.zoomExpt));\n } else {\n thisB.isSnapZooming = false;\n var newZoom = (thisB.savedZoom || 20.0) + thisB.zoomMin;\n thisB.savedZoom = thisB.zoomSliderValue - thisB.zoomMin;\n thisB.zoomSliderValue = newZoom;\n thisB.zoom(Math.exp((1.0 * newZoom) / thisB.zoomExpt));\n }\n ev.stopPropagation(); ev.preventDefault();\n } else if (ev.keyCode == 85) { // u\n if (thisB.uiMode === 'opts') { // if the options are visible, toggle the checkbox too\n var check = document.getElementById(\"singleBaseHightlightButton\").checked;\n document.getElementById(\"singleBaseHightlightButton\").checked = !check;\n }\n thisB.singleBaseHighlight = !thisB.singleBaseHighlight;\n thisB.positionRuler();\n ev.stopPropagation(); ev.preventDefault();\n } else if (ev.keyCode == 39) { // right arrow\n ev.stopPropagation(); ev.preventDefault();\n thisB.scrollArrowKey(ev, -1);\n } else if (ev.keyCode == 37) { // left arrow\n ev.stopPropagation(); ev.preventDefault();\n thisB.scrollArrowKey(ev, 1);\n } else if (ev.keyCode == 38 || ev.keyCode == 87) { // up arrow | w\n ev.stopPropagation(); ev.preventDefault();\n\n if (ev.shiftKey) {\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var tt = thisB.tiers[st];\n var ch = tt.forceHeight || tt.subtiers[0].height;\n if (ch >= 40) {\n tt.mergeConfig({height: ch-10});\n }\n } else if (ev.ctrlKey || ev.metaKey) {\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var tt = thisB.tiers[st];\n\n if (tt.quantLeapThreshold) {\n var th = tt.subtiers[0].height;\n var tq = tt.subtiers[0].quant;\n if (!tq)\n return;\n\n var qmin = 1.0 * tq.min;\n var qmax = 1.0 * tq.max;\n\n var qscale = (qmax - qmin) / th;\n tt.mergeConfig({quantLeapThreshold: qmin + ((Math.round((tt.quantLeapThreshold - qmin)/qscale)|0)+1)*qscale});\n\n tt.notify('Threshold: ' + formatQuantLabel(tt.quantLeapThreshold));\n }\n } else if (ev.altKey) {\n var cnt = thisB.selectedTiers.length;\n if (cnt == 0)\n return;\n\n var st = thisB.selectedTiers[0];\n var contiguous = true;\n var mt = [];\n for (var si = 0; si < thisB.selectedTiers.length; ++si) {\n mt.push(thisB.tiers[thisB.selectedTiers[si]]);\n if (si > 0 && thisB.selectedTiers[si] - thisB.selectedTiers[si - 1] != 1)\n contiguous = false;\n }\n\n if (contiguous && st <= 0)\n return;\n\n for (var si = thisB.selectedTiers.length - 1; si >= 0; --si)\n thisB.tiers.splice(thisB.selectedTiers[si], 1);\n\n thisB.selectedTiers.splice(0, cnt);\n\n var ip = contiguous ? st - 1 : st;\n for (var si = 0; si < mt.length; ++si) {\n thisB.tiers.splice(ip+si, 0, mt[si]);\n thisB.selectedTiers.push(ip + si);\n }\n\n thisB.withPreservedSelection(thisB._ensureTiersGrouped);\n thisB.markSelectedTiers();\n thisB.notifyTierSelection();\n thisB.reorderTiers();\n thisB.notifyTier(\"selected\", st);\n } else {\n var st = thisB.getSelectedTier();\n if (st > 0) {\n thisB.setSelectedTier(st - 1);\n var nst = thisB.tiers[thisB.getSelectedTier()];\n var top = nst.row.offsetTop, bottom = top + nst.row.offsetHeight;\n if (top < thisB.tierHolder.scrollTop || bottom > thisB.tierHolder.scrollTop + thisB.tierHolder.offsetHeight) {\n thisB.tierHolder.scrollTop = top;\n }\n } else {\n thisB.notifyTierSelectionWrap(-1);\n }\n }\n } else if (ev.keyCode == 40 || ev.keyCode == 83) { // down arrow | s\n ev.stopPropagation(); ev.preventDefault();\n\n if (ev.shiftKey) {\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var tt = thisB.tiers[st];\n var ch = tt.forceHeight || tt.subtiers[0].height;\n tt.mergeConfig({height: ch+10});\n } else if (ev.ctrlKey || ev.metaKey) {\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var tt = thisB.tiers[st];\n\n if (tt.quantLeapThreshold) {\n var th = tt.subtiers[0].height;\n var tq = tt.subtiers[0].quant;\n if (!tq)\n return;\n\n var qmin = 1.0 * tq.min;\n var qmax = 1.0 * tq.max;\n var qscale = (qmax - qmin) / th;\n\n var it = Math.round((tt.quantLeapThreshold - qmin)/qscale)|0;\n if (it > 1) {\n tt.mergeConfig({quantLeapThreshold: qmin + (it-1)*qscale});\n tt.notify('Threshold: ' + formatQuantLabel(tt.quantLeapThreshold));\n }\n }\n } else if (ev.altKey) {\n var cnt = thisB.selectedTiers.length;\n if (cnt == 0)\n return;\n\n var st = thisB.selectedTiers[0];\n var discontig = 0;\n var mt = [];\n for (var si = 0; si < thisB.selectedTiers.length; ++si) {\n mt.push(thisB.tiers[thisB.selectedTiers[si]]);\n if (si > 0)\n discontig += (thisB.selectedTiers[si] - thisB.selectedTiers[si - 1] - 1);\n }\n var contiguous = discontig == 0;\n\n if (contiguous && st + cnt >= thisB.tiers.length)\n return;\n\n for (var si = thisB.selectedTiers.length - 1; si >= 0; --si)\n thisB.tiers.splice(thisB.selectedTiers[si], 1);\n\n thisB.selectedTiers.splice(0, cnt);\n\n var ip = contiguous ? st + 1 : st + discontig;\n for (var si = 0; si < mt.length; ++si) {\n thisB.tiers.splice(ip+si, 0, mt[si]);\n thisB.selectedTiers.push(ip + si);\n }\n\n thisB.withPreservedSelection(function() {\n thisB._ensureTiersGrouped(true);\n });\n thisB.markSelectedTiers();\n thisB.notifyTierSelection();\n thisB.reorderTiers();\n thisB.notifyTier(\"selected\", st);\n } else {\n var st = thisB.getSelectedTier();\n if (st < thisB.tiers.length -1) {\n thisB.setSelectedTier(st + 1);\n var nst = thisB.tiers[thisB.getSelectedTier()];\n var top = nst.row.offsetTop, bottom = top + nst.row.offsetHeight;\n if (top < thisB.tierHolder.scrollTop || bottom > thisB.tierHolder.scrollTop + thisB.tierHolder.offsetHeight) {\n thisB.tierHolder.scrollTop = Math.min(top, bottom - thisB.tierHolder.offsetHeight);\n }\n }\n }\n } else if (ev.keyCode == 187 || ev.keyCode == 61) { // +\n ev.stopPropagation(); ev.preventDefault();\n thisB.zoomStep(-10);\n } else if (ev.keyCode == 189 || ev.keyCode == 173) { // -\n ev.stopPropagation(); ev.preventDefault();\n thisB.zoomStep(10);\n } else if (ev.keyCode == 73 || ev.keyCode == 105) { // i\n ev.stopPropagation(); ev.preventDefault();\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var t = thisB.tiers[st];\n if (!t.infoVisible) {\n t.infoElement.style.display = 'block';\n t.updateHeight();\n t.infoVisible = true;\n } else {\n t.infoElement.style.display = 'none';\n t.updateHeight();\n t.infoVisible = false;\n }\n } else if (ev.keyCode == 84 || ev.keyCode == 116) { // t\n var bumpStatus;\n if( ev.shiftKey ){\n ev.stopPropagation(); ev.preventDefault();\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n var t = thisB.tiers[ti];\n if (t.dasSource.collapseSuperGroups) {\n if (bumpStatus === undefined) {\n bumpStatus = !t.bumped;\n }\n t.mergeConfig({bumped: bumpStatus});\n }\n }\n } else if (!ev.ctrlKey && !ev.metaKey) {\n ev.stopPropagation(); ev.preventDefault();\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var t = thisB.tiers[st];\n\n if (t.dasSource.collapseSuperGroups) {\n if (bumpStatus === undefined) {\n bumpStatus = !t.bumped;\n }\n t.mergeConfig({bumped: bumpStatus});\n }\n }\n } else if (ev.keyCode == 77 || ev.keyCode == 109) { // m\n ev.stopPropagation(); ev.preventDefault();\n if ((ev.ctrlKey || ev.metaKey) && thisB.selectedTiers.length > 1) {\n thisB.mergeSelectedTiers();\n }\n } else if (ev.keyCode == 68 || ev.keyCode == 100) { // d\n ev.stopPropagation(); ev.preventDefault();\n if (ev.ctrlKey || ev.metaKey) {\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n thisB.addTier(thisB.tiers[st].dasSource);\n }\n } else if (ev.keyCode == 80 || ev.keyCode == 112) { // p\n if (ev.ctrlKey || ev.metaKey) {\n // Need to be careful because order of tiers could change\n // once we start updating pinning.\n var tt = [];\n for (var st = 0; st < thisB.selectedTiers.length; ++st) {\n tt.push(thisB.tiers[thisB.selectedTiers[st]]);\n }\n for (var ti = 0; ti < tt.length; ++ti) {\n tt[ti].mergeConfig({pinned: !tt[ti].pinned});\n }\n }\n } else {\n // console.log('key: ' + ev.keyCode + '; char: ' + ev.charCode);\n }\n };\n\n this.browserHolder.addEventListener('focus', function(ev) {\n thisB.browserHolder.addEventListener('keydown', keyHandler, false);\n }, false);\n this.browserHolder.addEventListener('blur', function(ev) {\n thisB.browserHolder.removeEventListener('keydown', keyHandler, false);\n }, false);\n\n // Popup support (does this really belong here? FIXME)\n this.hPopupHolder = makeElement('div');\n this.hPopupHolder.style['font-family'] = 'helvetica';\n this.hPopupHolder.style['font-size'] = '12pt';\n this.hPopupHolder.classList.add('dalliance');\n document.body.appendChild(this.hPopupHolder);\n\n for (var t = 0; t < this.sources.length; ++t) {\n var source = this.sources[t];\n if (!source)\n continue;\n\n var config = {};\n if (this.restoredConfigs) {\n config = this.restoredConfigs[t];\n }\n\n if (!source.disabled) {\n this.makeTier(source, config).then(function(tier) {\n thisB.refreshTier(tier);\n });\n }\n }\n\n for (const source of this.searchOnlySources) {\n if (!source.disabled) {\n const {features} = this.createSources(source);\n\n if (features) {\n this.searchOnlySourceHolders.push({\n dasSource: source,\n featureSource: features\n });\n }\n }\n }\n\n if (this.onFirstRender) {\n Promise.all(this.tiers.map(t => t.firstRenderPromise))\n .then(() => this.onFirstRender())\n .catch((err) => console.log(err));\n }\n\n thisB._ensureTiersGrouped();\n thisB.arrangeTiers();\n thisB.reorderTiers();\n\n\n var ss = this.getSequenceSource();\n if (ss) {\n ss.getSeqInfo(this.chr, function(si) {\n if (si)\n thisB.currentSeqMax = si.length;\n else\n thisB.currentSeqMax = -1;\n });\n }\n\n this.queryRegistry();\n for (var m in this.chains) {\n this.queryRegistry(m, true);\n }\n\n if (this.hubs) {\n for (var hi = 0; hi < this.hubs.length; ++hi) {\n var hc = this.hubs[hi];\n if (typeof hc == 'string') {\n hc = {url: hc};\n };\n\n (function(hc) {\n connectTrackHub(hc.url, function(hub, err) {\n if (err) {\n console.log(err);\n } else {\n var tdb;\n if (hc.genome)\n tdb = hub.genomes[hc.genome];\n else\n tdb = hub.genomes[thisB.coordSystem.ucscName];\n\n if (tdb) {\n if (hc.mapping)\n tdb.mapping = hc.mapping;\n if (hc.label)\n tdb.hub.altLabel = hc.label\n thisB.hubObjects.push(tdb);\n }\n }\n }, hc);\n })(hc);\n }\n }\n\n if (this.fullScreen) {\n this.setFullScreenHeight();\n }\n\n if (!this.statusRestored && this.storeStatus) {\n this.storeStatus();\n }\n\n thisB.setLocation(this.chr, this.viewStart, this.viewEnd, function () {\n thisB.setSelectedTier(1);\n // Ping any init listeners.\n for (var ii = 0; ii < thisB.initListeners.length; ++ii) {\n try {\n thisB.initListeners[ii].call(thisB);\n } catch (e) {\n console.log(e);\n }\n }\n });\n}\n\n//\n// Touch event support\n//\n\nBrowser.prototype.touchStartHandler = function(ev) {\n // Events not consumed so they can be interpretted as clicks as well.\n\n this.touchOriginX = ev.touches[0].pageX;\n this.touchOriginY = ev.touches[0].pageY;\n if (ev.touches.length == 2) {\n var sep = Math.abs(ev.touches[0].pageX - ev.touches[1].pageX);\n this.zooming = true;\n this.zoomLastSep = this.zoomInitialSep = sep;\n this.zoomInitialScale = this.scale;\n }\n}\n\nBrowser.prototype.touchMoveHandler = function(ev) {\n // These events *are* consumed to ensure we never get any dragging that\n // we don't manage ourselves.\n\n ev.stopPropagation(); ev.preventDefault();\n\n if (ev.touches.length == 1) {\n var touchX = ev.touches[0].pageX;\n var touchY = ev.touches[0].pageY;\n if (this.touchOriginX && touchX != this.touchOriginX) {\n this.move(touchX - this.touchOriginX);\n }\n if (this.touchOriginY && touchY != this.touchOriginY) {\n this.tierHolder.scrollTop -= (touchY - this.touchOriginY);\n }\n this.touchOriginX = touchX;\n this.touchOriginY = touchY;\n } else if (this.zooming && ev.touches.length == 2) {\n var sep = Math.abs(ev.touches[0].pageX - ev.touches[1].pageX);\n if (sep != this.zoomLastSep) {\n var cp = (ev.touches[0].pageX + ev.touches[1].pageX)/2;\n var scp = this.viewStart + (cp/this.scale)|0\n this.scale = this.zoomInitialScale * (sep/this.zoomInitialSep);\n this.viewStart = scp - (cp/this.scale)|0;\n for (var i = 0; i < this.tiers.length; ++i) {\n tiers[i].getRenderer().drawTier(tiers[i]);\n }\n }\n this.zoomLastSep = sep;\n }\n}\n\nBrowser.prototype.touchEndHandler = function(ev) {\n}\n\nBrowser.prototype.touchCancelHandler = function(ev) {\n}\n\n\nBrowser.prototype.makeTier = function(source, config) {\n try {\n return this.realMakeTier(source, config);\n } catch (e) {\n console.log('Error initializing', source);\n console.log(e.stack || e);\n }\n}\n\nBrowser.prototype.realMakeTier = function(source, config) {\n var thisB = this;\n var background = null;\n if (this.tierBackgroundColors) {\n background = this.tierBackgroundColors[this.tiers.length % this.tierBackgroundColors.length];\n }\n\n var tier = new DasTier(this, source, config, background);\n tier.oorigin = this.viewStart\n\n var isDragging = false;\n var dragOrigin, dragMoveOrigin;\n var hoverTimeout;\n\n var featureLookup = function(rx, ry) {\n var st = tier.subtiers;\n if (!st) {\n return;\n }\n\n var sti = 0;\n ry -= tier.padding;;\n while (sti < st.length && ry > st[sti].height && sti < (st.length - 1)) {\n ry = ry - st[sti].height - tier.padding;\n ++sti;\n }\n if (sti >= st.length) {\n return;\n }\n\n var glyphs = st[sti].glyphs;\n var viewCenter = (thisB.viewStart + thisB.viewEnd)/2;\n var offset = (tier.glyphCacheOrigin - thisB.viewStart)*thisB.scale;\n rx -= offset;\n\n return glyphLookup(glyphs, rx, ry);\n }\n\n var dragMoveHandler = function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n var rx = ev.clientX;\n if (rx != dragMoveOrigin) {\n thisB.move((rx - dragMoveOrigin), true);\n dragMoveOrigin = rx;\n }\n thisB.isDragging = true;\n }\n\n var dragUpHandler = function(ev) {\n window.removeEventListener('mousemove', dragMoveHandler, true);\n window.removeEventListener('mouseup', dragUpHandler, true);\n thisB.move((ev.clientX - dragMoveOrigin)); // Snap back (FIXME: consider animation)\n }\n\n\n tier.viewport.addEventListener('mousedown', function(ev) {\n thisB.browserHolder.focus();\n ev.preventDefault();\n var br = tier.row.getBoundingClientRect();\n var rx = ev.clientX, ry = ev.clientY;\n\n window.addEventListener('mousemove', dragMoveHandler, true);\n window.addEventListener('mouseup', dragUpHandler, true);\n dragOrigin = dragMoveOrigin = rx;\n thisB.isDragging = false; // Not dragging until a movement event arrives.\n }, false);\n\n tier.viewport.addEventListener('mousemove', function(ev) {\n var br = tier.row.getBoundingClientRect();\n var rx = ev.clientX - br.left, ry = ev.clientY - br.top;\n\n var hit = featureLookup(rx, ry);\n if (hit && hit.length > 0) {\n tier.row.style.cursor = 'pointer';\n } else {\n tier.row.style.cursor = 'default';\n }\n\n if (hoverTimeout) {\n clearTimeout(hoverTimeout);\n }\n\n if (isDragging) {\n // if (tier.dasSource.tier_type !== 'sequence' && rx != dragMoveOrigin) {\n // thisB.move((rx - dragMoveOrigin));\n // dragMoveOrigin = rx;\n // }\n } else {\n hoverTimeout = setTimeout(function() {\n var hit = featureLookup(rx, ry);\n if (hit && hit.length > 0) {\n thisB.notifyFeatureHover(ev, hit[hit.length - 1], hit, tier);\n }\n }, 1000);\n }\n });\n\n var doubleClickTimeout = null;\n tier.viewport.addEventListener('mouseup', function(ev) {\n var br = tier.row.getBoundingClientRect();\n var rx = ev.clientX - br.left, ry = ev.clientY - br.top;\n\n var hit = featureLookup(rx, ry);\n if (hit && hit.length > 0 && !thisB.isDragging) {\n if (doubleClickTimeout) {\n clearTimeout(doubleClickTimeout);\n doubleClickTimeout = null;\n thisB.featureDoubleClick(hit, rx, ry);\n } else {\n doubleClickTimeout = setTimeout(function() {\n doubleClickTimeout = null;\n thisB.notifyFeature(ev, hit[hit.length-1], hit, tier);\n }, 500);\n }\n }\n\n if (thisB.isDragging && rx != dragOrigin && tier.sequenceSource) {\n var a = thisB.viewStart + (rx/thisB.scale);\n var b = thisB.viewStart + (dragOrigin/thisB.scale);\n\n var min, max;\n if (a < b) {\n min = a|0; max = b|0;\n } else {\n min = b|0; max = a|0;\n }\n\n thisB.notifyRegionSelect(thisB.chr, min, max);\n }\n thisB.isDragging = false;\n }, false);\n\n tier.viewport.addEventListener('mouseout', function(ev) {\n isDragging = false;\n });\n\n tier.removeButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n if (thisB.tiers[ti] === tier) {\n thisB.removeTier({index: ti});\n break;\n }\n }\n }, false);\n tier.nameButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n\n if (ev.shiftKey) {\n var hitTier = -1;\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n if (thisB.tiers[ti] === tier) {\n hitTier = ti;\n break;\n }\n }\n if (hitTier >= 0) {\n var i = thisB.selectedTiers.indexOf(hitTier);\n if (i >= 0) {\n thisB.selectedTiers.splice(i, 1);\n } else {\n thisB.selectedTiers.push(hitTier);\n thisB.selectedTiers.sort();\n }\n thisB.markSelectedTiers();\n thisB.notifyTierSelection();\n\n if (thisB.selectedTiers.length > 0) {\n thisB.browserHolder.focus();\n } else {\n thisB.notifyTierSelectionWrap(-1);\n }\n }\n } else {\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n if (thisB.tiers[ti] === tier) {\n thisB.browserHolder.focus();\n if (thisB.selectedTiers.length != 1 || thisB.selectedTiers[0] != ti) {\n thisB.setSelectedTier(ti);\n return;\n }\n }\n }\n\n if (!tier.infoVisible) {\n tier.infoElement.style.display = 'block';\n tier.updateHeight();\n tier.infoVisible = true;\n } else {\n tier.infoElement.style.display = 'none';\n tier.updateHeight();\n tier.infoVisible = false;\n }\n }\n }, false);\n tier.bumpButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n var bumpStatus;\n var t = tier;\n if (t.dasSource.collapseSuperGroups) {\n if (bumpStatus === undefined) {\n bumpStatus = !t.bumped;\n }\n t.mergeConfig({bumped: bumpStatus});\n }\n }, false);\n\n\n var dragLabel;\n var dragTierHolder;\n var dragTierHolderScrollLimit;\n var tierOrdinal;\n var yAtLastReorder;\n var tiersWereReordered = false;\n\n var labelDragHandler = function(ev) {\n var label = tier.label;\n\n ev.stopPropagation(); ev.preventDefault();\n if (!dragLabel) {\n if (tier.pinned) {\n dragTierHolder = thisB.pinnedTierHolder;\n } else {\n dragTierHolder = thisB.tierHolder;\n }\n dragTierHolderScrollLimit = dragTierHolder.scrollHeight - dragTierHolder.offsetHeight;\n\n dragLabel = label.cloneNode(true);\n dragLabel.style.cursor = 'pointer';\n dragTierHolder.appendChild(dragLabel);\n label.style.visibility = 'hidden';\n\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n if (thisB.tiers[ti] === tier) {\n tierOrdinal = ti;\n break;\n }\n }\n\n yAtLastReorder = ev.clientY;\n }\n\n var holderBCR = dragTierHolder.getBoundingClientRect();\n dragLabel.style.left = (label.getBoundingClientRect().left - holderBCR.left) + 'px';\n dragLabel.style.top = (ev.clientY - holderBCR.top + dragTierHolder.scrollTop - 10) + 'px';\n\n var pty = ev.clientY - holderBCR.top + dragTierHolder.scrollTop;\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n var tt = thisB.tiers[ti];\n if (tt.pinned ^ tier.pinned)\n continue;\n\n var ttr = tt.row.getBoundingClientRect();\n pty -= (ttr.bottom - ttr.top);\n if (pty < 0) {\n if (ti < tierOrdinal && ev.clientY < yAtLastReorder || ti > tierOrdinal && ev.clientY > yAtLastReorder) {\n thisB.withPreservedSelection(function() {\n thisB.tiers.splice(tierOrdinal, 1);\n thisB.tiers.splice(ti, 0, tier);\n thisB._ensureTiersGrouped(ti > tierOrdinal);\n });\n\n for (var tix = 0; tix < thisB.tiers.length; ++tix)\n if (thisB.tiers[tix] == tier)\n tierOrdinal = tix;\n\n yAtLastReorder = ev.clientY;\n thisB.reorderTiers();\n dragTierHolder.appendChild(dragLabel); // Because reorderTiers removes all children.\n tiersWereReordered = true;\n }\n break;\n }\n }\n\n if (dragLabel.offsetTop < dragTierHolder.scrollTop) {\n dragTierHolder.scrollTop -= (dragTierHolder.scrollTop - dragLabel.offsetTop);\n } else if ((dragLabel.offsetTop + dragLabel.offsetHeight) > (dragTierHolder.scrollTop + dragTierHolder.offsetHeight)) {\n dragTierHolder.scrollTop = Math.min(dragTierHolder.scrollTop +\n (dragLabel.offsetTop + dragLabel.offsetHeight) -\n (dragTierHolder.scrollTop + dragTierHolder.offsetHeight),\n dragTierHolderScrollLimit);\n }\n };\n\n var labelReleaseHandler = function(ev) {\n var label = tier.label;\n\n ev.stopPropagation(); ev.preventDefault();\n if (dragLabel) {\n dragLabel.style.cursor = 'auto';\n dragTierHolder.removeChild(dragLabel);\n dragLabel = null;\n label.style.visibility = 'visible';\n }\n document.removeEventListener('mousemove', labelDragHandler, false);\n document.removeEventListener('mouseup', labelReleaseHandler, false);\n\n if (tiersWereReordered) {\n for (var ti = 0; ti < thisB.tiers.length; ++ti) {\n if (thisB.tiers[ti] == tier) {\n thisB.setSelectedTier(ti);\n break;\n }\n }\n thisB.notifyTier(\"reordered\", tier);\n }\n };\n\n tier.label.addEventListener('mousedown', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n tiersWereReordered = false;\n document.addEventListener('mousemove', labelDragHandler, false);\n document.addEventListener('mouseup', labelReleaseHandler, false);\n }, false);\n\n this.tiers.push(tier); // NB this currently tells any extant knownSpace about the new tier.\n\n // fetches stylesheet\n return tier.init().then(function (updatedTier) {\n updatedTier.currentlyHeight = 50;\n thisB.updateHeight();\n updatedTier.updateLabel();\n\n thisB.withPreservedSelection(thisB._ensureTiersGrouped);\n updatedTier._updateFromConfig();\n thisB.reorderTiers();\n\n return updatedTier;\n });\n}\n\nBrowser.prototype.reorderTiers = function() {\n removeChildren(this.tierHolder);\n removeChildren(this.pinnedTierHolder);\n if (this.disablePinning) {\n this.tierHolder.appendChild(this.ruler);\n this.tierHolder.appendChild(this.ruler2);\n }\n var hasPinned = false;\n var pinnedTiers = [], unpinnedTiers = [];\n for (var i = 0; i < this.tiers.length; ++i) {\n var t = this.tiers[i];\n var visible = ['sub','dummy'].indexOf(this.tiers[i].dasSource.renderer) === -1;\n if (t.pinned && !this.disablePinning) {\n pinnedTiers.push(t);\n if (visible)\n this.pinnedTierHolder.appendChild(this.tiers[i].row);\n hasPinned = true;\n } else {\n unpinnedTiers.push(t);\n if (visible)\n this.tierHolder.appendChild(this.tiers[i].row);\n }\n }\n\n this.withPreservedSelection(function() {\n this.tiers.splice(0, this.tiers.length);\n for (var i = 0; i < pinnedTiers.length; ++i)\n this.tiers.push(pinnedTiers[i]);\n for (var i = 0; i < unpinnedTiers.length; ++i)\n this.tiers.push(unpinnedTiers[i]);\n });\n\n if (hasPinned)\n this.pinnedTierHolder.classList.add('tier-holder-pinned-full');\n else\n this.pinnedTierHolder.classList.remove('tier-holder-pinned-full');\n\n this.arrangeTiers();\n}\n\nBrowser.prototype.withPreservedSelection = function(f) {\n var st = [];\n for (var xi = 0; xi < this.selectedTiers.length; ++xi) {\n st.push(this.tiers[this.selectedTiers[xi]]);\n }\n\n f.call(this);\n\n this.selectedTiers = [];\n for (var sti = 0; sti < this.tiers.length; ++sti) {\n if (st.indexOf(this.tiers[sti]) >= 0)\n this.selectedTiers.push(sti);\n }\n}\n\nBrowser.prototype.refreshTier = function(tier, tierCallback) {\n var renderer = this.getTierRenderer(tier);\n if (tier.dasSource.renderer === 'multi') {\n renderer.drawTier(tier);\n } else {\n var renderCallback = tierCallback || renderer.renderTier;\n if (this.knownSpace) {\n this.knownSpace.invalidate(tier, renderCallback);\n }\n }\n}\n\nBrowser.prototype.getTierRenderer = function(tier) {\n var renderer = tier.dasSource.renderer || this.defaultRenderer;\n if (typeof(renderer) === 'string') {\n return this.renderers[renderer];\n } else if (typeof(renderer.renderTier) === 'function' &&\n typeof(renderer.drawTier) === 'function') {\n return renderer;\n } else {\n console.log(\"Tier doesn't have a renderer\");\n }\n}\n\n/* Internal use only, assumes selection is being managed elsewhere... */\n\nBrowser.prototype._ensureTiersGrouped = function(down) {\n var groupedTiers = {};\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var t = this.tiers[ti];\n if (t.dasSource.tierGroup) {\n pusho(groupedTiers, t.dasSource.tierGroup, t);\n }\n }\n\n var newTiers = [];\n if (down)\n this.tiers.reverse();\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var t = this.tiers[ti];\n if (t.dasSource.tierGroup) {\n var nt = groupedTiers[t.dasSource.tierGroup];\n if (nt) {\n if (down)\n nt.reverse();\n for (var nti = 0; nti < nt.length; ++nti)\n newTiers.push(nt[nti]);\n groupedTiers[t.dasSource.tierGroup] = null;\n }\n } else {\n newTiers.push(t);\n }\n }\n if (down)\n newTiers.reverse();\n this.tiers.splice(0, this.tiers.length);\n for (var nti = 0; nti < newTiers.length; ++nti)\n this.tiers.push(newTiers[nti]);\n}\n\nBrowser.prototype.arrangeTiers = function() {\n var arrangedTiers = [];\n var groupedTiers = {};\n\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var t = this.tiers[ti];\n if (t.pinned) {\n arrangedTiers.push(t);\n if (t.dasSource.tierGroup) {\n pusho(groupedTiers, t.dasSource.tierGroup, t);\n }\n }\n\n }\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var t = this.tiers[ti];\n if (!t.pinned) {\n arrangedTiers.push(t);\n if (t.dasSource.tierGroup) {\n pusho(groupedTiers, t.dasSource.tierGroup, t);\n }\n }\n }\n\n for (var g in groupedTiers) {\n var tiers = groupedTiers[g];\n var tierGroup = this.tierGroups[g];\n if (!tierGroup) {\n tierGroup = {\n element: makeElement(\n 'div',\n makeElement('span', g, {className: 'tier-group-label'}),\n {className: \"tier-group\"})\n };\n this.tierGroups[g] = tierGroup;\n }\n\n if (tierGroup.element.parentNode)\n tierGroup.element.parentNode.removeChild(tierGroup.element);\n\n var holder = tiers[0].pinned ? this.pinnedTierHolder : this.tierHolder;\n var min = 10000000, max = 0;\n for (var ti = 0; ti < tiers.length; ++ti) {\n var row = tiers[ti].row;\n min = Math.min(min, row.offsetTop);\n max = Math.max(max, row.offsetTop + row.offsetHeight);\n }\n tierGroup.element.style.top = min + 'px';\n tierGroup.element.style.left = '0px';\n tierGroup.element.style.height = (max-min) + 'px';\n holder.appendChild(tierGroup.element);\n }\n\n if (this.tierBackgroundColors) {\n for (var ti = 0; ti < arrangedTiers.length; ++ti) {\n var t = arrangedTiers[ti];\n t.setBackground(this.tierBackgroundColors[ti % this.tierBackgroundColors.length]);\n if (t.dasSource.tierGroup)\n t.label.style.left = '18px';\n else\n t.label.style.left = '2px';\n t.background = this.tierBackgroundColors[ti % this.tierBackgroundColors.length];\n }\n }\n}\n\nBrowser.prototype.refresh = function() {\n this.retrieveTierData(this.tiers);\n this.drawOverlays();\n this.positionRuler();\n};\n\nvar defaultTierRenderer = function(status, tier) {\n console.log(\"DEPRECATED!\");\n}\n\nBrowser.prototype.retrieveTierData = function(tiers) {\n this.notifyLocation();\n var width = (this.viewEnd - this.viewStart) + 1;\n var minExtraW = (this.minExtraWidth / this.scale)|0;\n var maxExtraW = (this.maxExtraWidth / this.scale)|0;\n\n var newOrigin = (this.viewStart + this.viewEnd) / 2;\n var oh = newOrigin - this.origin;\n this.origin = newOrigin;\n this.scaleAtLastRedraw = this.scale;\n for (var t = 0; t < tiers.length; ++t) {\n var od = oh;\n if (tiers[t].originHaxx) {\n od += tiers[t].originHaxx;\n }\n tiers[t].originHaxx = od;\n }\n\n var scaledQuantRes = this.targetQuantRes / this.scale;\n\n var innerDrawnStart = Math.max(1, (this.viewStart|0) - minExtraW);\n var innerDrawnEnd = Math.min((this.viewEnd|0) + minExtraW, ((this.currentSeqMax|0) > 0 ? (this.currentSeqMax|0) : 1000000000))\n var outerDrawnStart = Math.max(1, (this.viewStart|0) - maxExtraW);\n var outerDrawnEnd = Math.min((this.viewEnd|0) + maxExtraW, ((this.currentSeqMax|0) > 0 ? (this.currentSeqMax|0) : 1000000000));\n\n if (!this.knownSpace || this.knownSpace.chr !== this.chr) {\n var ss = this.getSequenceSource();\n if (this.knownSpace)\n this.knownSpace.cancel();\n // known space is created based on the entire tier list, for future caching purposes, even if only a subset of the tiers are needed to be rendered now.\n this.knownSpace = new KnownSpace(this.tiers, this.chr, outerDrawnStart, outerDrawnEnd, scaledQuantRes, ss);\n }\n\n var seg = this.knownSpace.bestCacheOverlapping(this.chr, innerDrawnStart, innerDrawnEnd);\n if (seg && seg.min <= innerDrawnStart && seg.max >= innerDrawnEnd) {\n this.drawnStart = Math.max(seg.min, outerDrawnStart);\n this.drawnEnd = Math.min(seg.max, outerDrawnEnd);\n } else {\n this.drawnStart = outerDrawnStart;\n this.drawnEnd = outerDrawnEnd;\n }\n // send in the subset of tiers to retrieve.\n this.knownSpace.retrieveFeatures(tiers,\n this.chr,\n this.drawnStart,\n this.drawnEnd,\n scaledQuantRes);\n}\n\nfunction setSources(msh, availableSources, maybeMapping) {\n if (maybeMapping) {\n for (var s = 0; s < availableSources.length; ++s) {\n availableSources[s].mapping = maybeMapping;\n }\n }\n msh.set(availableSources);\n}\n\nBrowser.prototype.queryRegistry = function(maybeMapping, tryCache) {\n if (!this.registry)\n return;\n\n var thisB = this;\n var coords, msh;\n if (maybeMapping) {\n coords = this.chains[maybeMapping].coords;\n if (!thisB.mappableSources[maybeMapping]) {\n thisB.mappableSources[maybeMapping] = new Observed();\n }\n msh = thisB.mappableSources[maybeMapping];\n } else {\n coords = this.coordSystem;\n msh = this.availableSources;\n }\n var cacheHash = hex_sha1(miniJSONify(coords));\n if (tryCache) {\n var cacheTime = localStorage['dalliance.registry.' + cacheHash + '.last_queried'];\n if (cacheTime) {\n try {\n setSources(msh, JSON.parse(localStorage['dalliance.registry.' + cacheHash + '.sources']), maybeMapping);\n var cacheAge = (Date.now()|0) - (cacheTime|0);\n if (cacheAge < (12 * 60 * 60 * 1000)) {\n return;\n }\n } catch (rex) {\n console.log('Bad registry cache: ' + rex);\n }\n }\n }\n\n var rurl = this.registry;\n if (rurl.indexOf('//') == 0) {\n var proto = window.location.protocol;\n if (proto != 'https:' && proto != 'http:')\n rurl = 'http:' + rurl;\n }\n new DASRegistry(rurl).sources(function(sources) {\n var availableSources = [];\n for (var s = 0; s < sources.length; ++s) {\n var source = sources[s];\n if (!source.coords || source.coords.length == 0) {\n continue;\n }\n var scoords = source.coords[0];\n if (scoords.taxon != coords.taxon || scoords.auth != coords.auth || scoords.version != coords.version) {\n continue;\n }\n availableSources.push(source);\n }\n\n localStorage['dalliance.registry.' + cacheHash + '.sources'] = JSON.stringify(availableSources);\n localStorage['dalliance.registry.' + cacheHash + '.last_queried'] = '' + Date.now();\n\n setSources(msh, availableSources, maybeMapping);\n }, function(error) {\n // msh.set(null);\n }, coords);\n}\n\n//\n// Navigation\n//\n\nBrowser.prototype.move = function(pos, soft)\n{\n var wid = this.viewEnd - this.viewStart;\n var nStart = this.viewStart - ((1.0 * pos) / this.scale);\n var nEnd = nStart + wid;\n\n if (!soft) {\n if (this.currentSeqMax > 0 && nEnd > this.currentSeqMax) {\n nEnd = this.currentSeqMax;\n nStart = this.viewEnd - wid;\n }\n if (nStart < 1) {\n nStart = 1;\n nEnd = nStart + wid;\n }\n }\n\n this.setLocation(null, nStart, nEnd, null, soft);\n}\n\nBrowser.prototype.zoomStep = function(delta) {\n var oz = 1.0 * this.zoomSliderValue;\n var nz = oz + delta;\n if (nz < this.zoomMin) {\n nz= this.zoomMin;\n }\n if (nz > this.zoomMax) {\n nz = this.zoomMax;\n }\n\n if (nz != oz) {\n this.zoomSliderValue = nz; // FIXME maybe ought to set inside zoom!\n this.zoom(Math.exp((1.0 * nz) / this.zoomExpt));\n }\n}\n\nBrowser.prototype.zoom = function(factor) {\n this.zoomFactor = factor;\n var viewCenter = Math.round((this.viewStart + this.viewEnd) / 2.0)|0;\n this.viewStart = viewCenter - this.zoomBase * this.zoomFactor / 2;\n this.viewEnd = viewCenter + this.zoomBase * this.zoomFactor / 2;\n if (this.currentSeqMax > 0 && (this.viewEnd > this.currentSeqMax + 5)) {\n var len = this.viewEnd - this.viewStart + 1;\n this.viewEnd = this.currentSeqMax;\n this.viewStart = this.viewEnd - len + 1;\n }\n if (this.viewStart < 1) {\n var len = this.viewEnd - this.viewStart + 1;\n this.viewStart = 1;\n this.viewEnd = this.viewStart + len - 1;\n }\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart)\n var width = this.viewEnd - this.viewStart + 1;\n\n var scaleRat = (this.scale / this.scaleAtLastRedraw);\n\n this.notifyLocation();\n this.refresh();\n}\n\nBrowser.prototype.spaceCheck = function(dontRefresh) {\n if (!this.knownSpace || this.knownSpace.chr !== this.chr) {\n this.refresh();\n return;\n }\n\n var width = ((this.viewEnd - this.viewStart)|0) + 1;\n var minExtraW = (this.minExtraWidth / this.scale)|0;\n var maxExtraW = (this.maxExtraWidth / this.scale)|0;\n\n if ((this.drawnStart|0) > Math.max(1, ((this.viewStart|0) - minExtraW)|0) || (this.drawnEnd|0) < Math.min((this.viewEnd|0) + minExtraW, ((this.currentSeqMax|0) > 0 ? (this.currentSeqMax|0) : 1000000000))) {\n this.refresh();\n }\n}\n\nBrowser.prototype.resizeViewer = function(skipRefresh) {\n var width = this.tierHolder.getBoundingClientRect().width | 0;\n if (width == 0)\n return;\n\n var oldFPW = Math.max(this.featurePanelWidth, 300); // Can get silly values stored\n // when the browser is hidden.\n this.featurePanelWidth = width|0;\n\n if (oldFPW != this.featurePanelWidth) {\n this.zoomMax = this.zoomExpt * Math.log(this.maxViewWidth / this.zoomBase);\n this.zoomMin = this.zoomExpt * Math.log(this.featurePanelWidth / this.maxPixelsPerBase / this.zoomBase); // FIXME hard-coded minimum.\n this.zoomSliderValue = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n var viewWidth = this.viewEnd - this.viewStart;\n var nve = this.viewStart + (viewWidth * this.featurePanelWidth) / oldFPW;\n\n this.viewEnd = nve;\n\n var wid = this.viewEnd - this.viewStart + 1;\n if (this.currentSeqMax > 0 && this.viewEnd > this.currentSeqMax) {\n this.viewEnd = this.currentSeqMax;\n this.viewStart = this.viewEnd - wid + 1;\n }\n if (this.viewStart < 1) {\n this.viewStart = 1;\n this.viewEnd = this.viewStart + wid - 1;\n }\n\n this.positionRuler();\n\n if (!skipRefresh) {\n this.spaceCheck();\n }\n this.notifyLocation();\n }\n\n if (this.fullScreen) {\n this.setFullScreenHeight();\n }\n}\n\nBrowser.prototype.setFullScreenHeight = function() {\n var rest = document.body.offsetHeight - this.browserHolder.offsetHeight;\n this.browserHolder.style.maxHeight = Math.max(300, window.innerHeight - rest - 20) + 'px'\n}\n\nBrowser.prototype.addTier = function(conf) {\n var thisB = this;\n conf = shallowCopy(conf);\n conf.disabled = false;\n\n return this.makeTier(conf).then(function (tier) {\n thisB.refreshTier(tier);\n thisB.markSelectedTiers();\n thisB.positionRuler();\n thisB.notifyTier(\"added\", tier);\n return tier;\n })\n};\n\n\nBrowser.prototype.removeTier = function(conf, force) {\n var target = -1;\n\n if (typeof conf.index !== 'undefined' && conf.index >=0 && conf.index < this.tiers.length) {\n target = conf.index;\n } else {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var ts = this.tiers[ti].dasSource;\n\n if (sourcesAreEqual(conf, ts)) {\n target = ti; break;\n }\n }\n }\n\n if (target < 0) {\n throw \"Couldn't find requested tier\";\n }\n\n var targetTier = this.tiers[target];\n this.tiers.splice(target, 1);\n\n var nst = [];\n for (var sti = 0; sti < this.selectedTiers.length; ++sti) {\n var st = this.selectedTiers[sti];\n if (st < target) {\n nst.push(st);\n } else if (st > target) {\n nst.push(st - 1);\n }\n }\n this.selectedTiers = nst;\n this.markSelectedTiers();\n\n targetTier.destroy();\n if (this.knownSpace) {\n this.knownSpace.featureCache[targetTier] = null;\n }\n\n this.reorderTiers();\n this.notifyTier(\"removed\", targetTier);\n}\n\nBrowser.prototype.removeAllTiers = function() {\n\tvar thisB = this;\n this.selectedTiers = [];\n this.markSelectedTiers();\n this.tiers.forEach(function (targetTier) {\n targetTier.destroy();\n if (thisB.knownSpace) {\n thisB.knownSpace.featureCache[targetTier] = null;\n }\n });\n this.tiers.length = 0;\n this.reorderTiers();\n this.notifyTier(\"removedAll\", null);\n}\n\nBrowser.prototype.getSequenceSource = function() {\n if (this._sequenceSource === undefined)\n this._sequenceSource = this._getSequenceSource();\n return this._sequenceSource;\n}\n\nBrowser.prototype._getSequenceSource = function() {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (this.tiers[ti].sequenceSource) {\n return this.tiers[ti].sequenceSource;\n }\n }\n\n for (var si = 0; si < this.defaultSources.length; ++si) {\n var s = this.defaultSources[si];\n if (s.provides_entrypoints || s.tier_type == 'sequence' || s.twoBitURI || s.twoBitBlob) {\n if (s.twoBitURI || s.twoBitBlob) {\n return new TwoBitSequenceSource(s);\n } else if (s.ensemblURI) {\n return new EnsemblSequenceSource(s);\n } else {\n return new DASSequenceSource(s);\n }\n }\n }\n}\n\nBrowser.prototype.setLocation = function(newChr, newMin, newMax, callback, soft) {\n if (typeof(newMin) !== 'number') {\n throw Error('minimum must be a number (got ' + JSON.stringify(newMin) + ')');\n }\n if (typeof(newMax) !== 'number') {\n throw Error('maximum must be a number (got ' + JSON.stringify(newMax) + ')');\n }\n\n if (newMin > newMax) {\n var oldNewMin = newMin;\n newMin = newMax;\n newMax = oldNewMin;\n } else if (newMin === newMax) {\n newMax += 1;\n }\n\n if (!callback) {\n callback = function(err) {\n if (err) {\n throw err;\n }\n }\n }\n var thisB = this;\n\n if ((!newChr || newChr == this.chr) && this.currentSeqMax > 0) {\n return this._setLocation(null, newMin, newMax, null, callback, soft);\n } else {\n var ss = this.getSequenceSource();\n if (!ss) {\n return callback('Need a sequence source');\n }\n\n var findChr = newChr || this.chr;\n ss.getSeqInfo(findChr, function(si) {\n if (!si) {\n var altChr;\n if (findChr.indexOf('chr') == 0) {\n altChr = findChr.substr(3);\n } else {\n altChr = 'chr' + findChr;\n }\n ss.getSeqInfo(altChr, function(si2) {\n if (!si2 && newChr) {\n return callback(\"Couldn't find sequence '\" + newChr + \"'\");\n } else if (!si2) {\n return thisB._setLocation(null, newMin, newMax, null, callback, soft);\n } else {\n return thisB._setLocation(altChr, newMin, newMax, si2, callback, soft);\n }\n });\n } else {\n return thisB._setLocation(newChr, newMin, newMax, si, callback, soft);\n }\n });\n }\n}\n\nBrowser.prototype._setLocation = function(newChr, newMin, newMax, newChrInfo, callback, soft) {\n var chrChanged = false;\n if (newChr) {\n if (newChr.indexOf('chr') == 0)\n newChr = newChr.substring(3);\n\n if (this.chr != newChr)\n chrChanged = true;\n this.chr = newChr;\n this.currentSeqMax = newChrInfo.length;\n }\n\n newMin = parseFloat(newMin); newMax=parseFloat(newMax);\n\n var newWidth = Math.max(10, newMax-newMin+1);\n\n if (!soft) {\n var csm = this.currentSeqMax;\n if (csm <= 0)\n csm = 1000000000000;\n if (newMin < 1) {\n newMin = 1; newMax = newMin + newWidth - 1;\n }\n if (newMax > csm) {\n newMax = csm;\n newMin = Math.max(1, newMax - newWidth + 1);\n }\n }\n\n this.viewStart = newMin;\n this.viewEnd = newMax;\n var newScale = Math.max(this.featurePanelWidth || this.offscreenInitWidth, 50) / (this.viewEnd - this.viewStart);\n var oldScale = this.scale;\n var scaleChanged = (Math.abs(newScale - oldScale)) > 0.000001;\n this.scale = newScale;\n\n var newZS, oldZS;\n oldZS = this.zoomSliderValue;\n this.zoomSliderValue = newZS = this.zoomExpt * Math.log((this.viewEnd - this.viewStart + 1) / this.zoomBase);\n\n if (scaleChanged || chrChanged) {\n for (var i = 0; i < this.tiers.length; ++i) {\n this.tiers[i].viewportHolder.style.left = '5000px';\n this.tiers[i].overlay.style.left = '5000px';\n }\n\n this.refresh();\n // var self = this;\n // this.tiers.forEach(function(tier) {self.refreshTier(tier);});\n // this.refreshTier\n\n if (this.savedZoom) {\n newZS -= this.zoomMin;\n oldZS -= this.zoomMin;\n var difToActive = newZS - oldZS;\n var difToSaved = newZS - this.savedZoom;\n if (Math.abs(difToActive) > Math.abs(difToSaved)) {\n this.isSnapZooming = !this.isSnapZooming;\n this.savedZoom = oldZS;\n }\n } else {\n this.isSnapZooming = false;\n this.savedZoom = null;\n }\n } else {\n var viewCenter = (this.viewStart + this.viewEnd)/2;\n\n for (var i = 0; i < this.tiers.length; ++i) {\n var offset = (this.viewStart - this.tiers[i].norigin)*this.scale;\n this.tiers[i].viewportHolder.style.left = '' + ((-offset|0) - 1000) + 'px';\n this.tiers[i].drawOverlay();\n }\n }\n\n this.notifyLocation();\n\n this.spaceCheck();\n if (this.instrumentActivity)\n this.activityStartTime = Date.now()|0;\n return callback();\n}\n\nBrowser.prototype.setCenterLocation = function(newChr, newCenterLoc) {\n var halfWidth = (this.viewEnd - this.viewStart)/2,\n newMin = newCenterLoc - halfWidth,\n newMax = newCenterLoc + halfWidth;\n this.setLocation(newChr, newMin, newMax);\n}\n\nBrowser.prototype.pingActivity = function() {\n if (!this.instrumentActivity || !this.activityStartTime)\n return;\n\n var activity = 0;\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (this.tiers[ti].loaderButton.style.display !== 'none')\n ++activity;\n }\n\n if (activity == 0) {\n var now = Date.now()|0;\n console.log('Loading took ' + (now-this.activityStartTime) + 'ms');\n this.activityStartTime = null;\n }\n}\n\nBrowser.prototype.addInitListener = function(handler) {\n this.initListeners.push(handler);\n}\n\nBrowser.prototype.addFeatureListener = function(handler, opts) {\n opts = opts || {};\n this.featureListeners.push(handler);\n}\n\nBrowser.prototype.removeFeatureListener = function(handler, opts) {\n var idx = arrayIndexOf(this.featureListeners, handler);\n if (idx >= 0) {\n this.featureListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyFeature = function(ev, feature, hit, tier) {\n for (var fli = 0; fli < this.featureListeners.length; ++fli) {\n try {\n if (this.featureListeners[fli](ev, feature, hit, tier))\n return;\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\nBrowser.prototype.addFeatureHoverListener = function(handler, opts) {\n opts = opts || {};\n this.featureHoverListeners.push(handler);\n}\n\nBrowser.prototype.removeFeatureHoverListener = function(handler, opts) {\n var idx = arrayIndexOf(this.featureHoverListeners, handler);\n if (idx >= 0) {\n this.featureHoverListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyFeatureHover = function(ev, feature, hit, tier) {\n for (var fli = 0; fli < this.featureHoverListeners.length; ++fli) {\n try {\n this.featureHoverListeners[fli](ev, feature, hit, tier);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\nBrowser.prototype.addViewListener = function(handler, opts) {\n opts = opts || {};\n this.viewListeners.push(handler);\n}\n\nBrowser.prototype.removeViewListener = function(handler, opts) {\n var idx = arrayIndexOf(this.viewListeners, handler);\n if (idx >= 0) {\n this.viewListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyLocation = function() {\n var nvs = Math.max(1, this.viewStart|0);\n var nve = this.viewEnd|0;\n if (this.currentSeqMax > 0 && nve > this.currentSeqMax)\n nve = this.currentSeqMax;\n\n for (var lli = 0; lli < this.viewListeners.length; ++lli) {\n try {\n this.viewListeners[lli](\n this.chr,\n nvs,\n nve,\n this.zoomSliderValue,\n {current: this.zoomSliderValue,\n alternate: (this.savedZoom+this.zoomMin) || this.zoomMin,\n isSnapZooming: this.isSnapZooming,\n min: this.zoomMin,\n max: this.zoomMax},\n this.viewStart,\n this.viewEnd);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\nBrowser.prototype.addTierListener = function(handler) {\n this.tierListeners.push(handler);\n}\n\nBrowser.prototype.removeTierListener = function(handler) {\n var idx = arrayIndexOf(this.tierListeners, handler);\n if (idx >= 0) {\n this.tierListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyTier = function(status, tier) {\n for (var tli = 0; tli < this.tierListeners.length; ++tli) {\n try {\n this.tierListeners[tli](status, tier);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\nBrowser.prototype.addRegionSelectListener = function(handler) {\n this.regionSelectListeners.push(handler);\n}\n\nBrowser.prototype.removeRegionSelectListener = function(handler) {\n var idx = arrayIndexOf(this.regionSelectListeners, handler);\n if (idx >= 0) {\n this.regionSelectListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyRegionSelect = function(chr, min, max) {\n for (var rli = 0; rli < this.regionSelectListeners.length; ++rli) {\n try {\n this.regionSelectListeners[rli](chr, min, max);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\n\nBrowser.prototype.highlightRegion = function(chr, min, max) {\n var thisB = this;\n\n if (chr == this.chr) {\n return this._highlightRegion(chr, min, max);\n }\n\n var ss = this.getSequenceSource();\n if (!ss) {\n throw 'Need a sequence source';\n }\n\n ss.getSeqInfo(chr, function(si) {\n if (!si) {\n var altChr;\n if (chr.indexOf('chr') == 0) {\n altChr = chr.substr(3);\n } else {\n altChr = 'chr' + chr;\n }\n ss.getSeqInfo(altChr, function(si2) {\n if (!si2) {\n // Fail silently.\n } else {\n return thisB._highlightRegion(altChr, min, max);\n }\n });\n } else {\n return thisB._highlightRegion(chr, min, max);\n }\n });\n}\n\nBrowser.prototype._highlightRegion = function(chr, min, max) {\n for (var hi = 0; hi < this.highlights.length; ++hi) {\n var h = this.highlights[hi];\n if (h.chr == chr && h.min == min && h.max == max)\n return;\n }\n\n this.highlights.push(new Region(chr, min, max));\n var visStart = this.viewStart - (1000/this.scale);\n var visEnd = this.viewEnd + (1000/this.scale);\n if ((chr == this.chr || chr == ('chr'+this.chr)) && min < visEnd && max > visStart) {\n this.drawOverlays();\n }\n\n this.notifyLocation();\n}\n\nBrowser.prototype.clearHighlights = function() {\n this.highlights = [];\n this.drawOverlays();\n this.notifyLocation();\n}\n\nBrowser.prototype.drawOverlays = function() {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n this.tiers[ti].drawOverlay();\n }\n}\n\nBrowser.prototype.featuresInRegion = function(chr, min, max) {\n var features = [];\n if (chr !== this.chr) {\n return [];\n }\n\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var fl = this.tiers[ti].currentFeatures || [];\n for (var fi = 0; fi < fl.length; ++fi) {\n var f = fl[fi];\n if (f.min <= max && f.max >= min) {\n features.push(f);\n }\n }\n }\n return features;\n}\n\n\nBrowser.prototype.getSelectedTier = function() {\n if (this.selectedTiers.length > 0)\n return this.selectedTiers[0];\n else\n return -1;\n}\n\nBrowser.prototype.setSelectedTier = function(t) {\n if (t == null) {\n this.selectedTiers = [];\n } else {\n this.selectedTiers = [t];\n }\n this.markSelectedTiers();\n this.notifyTierSelection();\n}\n\nBrowser.prototype.markSelectedTiers = function() {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var button = this.tiers[ti].nameButton;\n\n if (this.selectedTiers.indexOf(ti) >= 0) {\n button.classList.add('active');\n } else {\n button.classList.remove('active');\n }\n }\n if (this.selectedTiers.length > 0) {\n var browserMid = this.browserHolder.offsetTop + this.browserHolder.offsetHeight/2;\n if (browserMid > document.body.scrollTop && (browserMid + 100) < document.body.scrollTop + window.innerHeight)\n this.browserHolder.focus();\n }\n}\n\nBrowser.prototype.addTierSelectionListener = function(handler) {\n this.tierSelectionListeners.push(handler);\n}\n\nBrowser.prototype.removeTierSelectionListener = function(handler) {\n var idx = arrayIndexOf(this.tierSelectionListeners, handler);\n if (idx >= 0) {\n this.tierSelectionListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyTierSelection = function() {\n for (var fli = 0; fli < this.tierSelectionListeners.length; ++fli) {\n try {\n this.tierSelectionListeners[fli](this.selectedTiers);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n\n}\n\nBrowser.prototype.addTierSelectionWrapListener = function(f) {\n this.tierSelectionWrapListeners.push(f);\n}\n\nBrowser.prototype.removeTierSelectionWrapListener = function(handler) {\n var idx = arrayIndexOf(this.tierSelectionWrapListeners, handler);\n if (idx >= 0) {\n this.tierSelectionWrapListeners.splice(idx, 1);\n }\n}\n\nBrowser.prototype.notifyTierSelectionWrap = function(i) {\n for (var fli = 0; fli < this.tierSelectionWrapListeners.length; ++fli) {\n try {\n this.tierSelectionWrapListeners[fli](i);\n } catch (ex) {\n console.log(ex.stack);\n }\n }\n}\n\n\nBrowser.prototype.positionRuler = function() {\n var display = 'none';\n var left = '';\n var right = '';\n\n if (this.rulerLocation == 'center') {\n display = 'block';\n left = '' + ((this.featurePanelWidth/2)|0) + 'px';\n } else if (this.rulerLocation == 'left') {\n display = 'block';\n left = '0px';\n } else if (this.rulerLocation == 'right') {\n display = 'block';\n right = '0px'\n } else {\n display = 'none';\n }\n\n this.ruler.style.display = display;\n this.ruler.style.left = left;\n this.ruler.style.right = right;\n\n if(this.singleBaseHighlight) {\n this.ruler2.style.display = 'block';\n this.ruler2.style.borderWidth = '1px';\n if (this.scale < 1) {\n this.ruler2.style.width = '0px';\n this.ruler2.style.borderRightWidth = '0px'\n } else {\n this.ruler2.style.width = this.scale + 'px';\n this.ruler2.style.borderRightWidth = '1px'\n }\n // Position accompanying single base location text\n this.locSingleBase.style.visibility = 'visible';\n var centreOffset = this.featurePanelWidth/2 - this.locSingleBase.offsetWidth/2 + this.ruler2.offsetWidth/2;\n this.locSingleBase.style.left = '' + (centreOffset|0) + 'px';\n } else {\n this.locSingleBase.style.visibility = 'hidden';\n this.ruler2.style.width = '1px';\n this.ruler2.style.borderWidth = '0px';\n this.ruler2.style.display = this.rulerLocation == 'center' ? 'none' : 'block';\n }\n\n this.ruler2.style.left = '' + ((this.featurePanelWidth/2)|0) + 'px';\n\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var tier = this.tiers[ti];\n var q = tier.quantOverlay;\n\n var quant;\n if (tier.subtiers && tier.subtiers.length > 0)\n quant = tier.subtiers[0].quant;\n\n if (q) {\n q.style.display = quant ? display : 'none';\n q.style.left = left;\n q.style.right = right;\n }\n }\n}\n\nBrowser.prototype.featureDoubleClick = function(hit, rx, ry) {\n if (!hit || hit.length == 0)\n return;\n\n var f = hit[hit.length - 1];\n\n if (!f.min || !f.max) {\n return;\n }\n\n var fstart = (((f.min|0) - (this.viewStart|0)) * this.scale);\n var fwidth = (((f.max - f.min) + 1) * this.scale);\n\n var newMid = (((f.min|0) + (f.max|0)))/2;\n if (fwidth > 10) {\n var frac = (1.0 * (rx - fstart)) / fwidth;\n if (frac < 0.3) {\n newMid = (f.min|0);\n } else if (frac > 0.7) {\n newMid = (f.max|0) + 1;\n }\n }\n\n var width = this.viewEnd - this.viewStart;\n this.setLocation(null, newMid - (width/2), newMid + (width/2));\n}\n\nBrowser.prototype.zoomForScale = function(scale) {\n var ssScale;\n if (scale > this.highZoomThreshold) {\n ssScale = 'high';\n } else if (scale > this.mediumZoomThreshold) {\n ssScale = 'medium';\n } else {\n ssScale = 'low';\n }\n return ssScale;\n}\n\nBrowser.prototype.zoomForCurrentScale = function() {\n return this.zoomForScale(this.scale);\n}\n\nBrowser.prototype.updateHeight = function() {\n var tierTotal = 0;\n for (var ti = 0; ti < this.tiers.length; ++ti)\n tierTotal += (this.tiers[ti].currentHeight || 30);\n this.ruler.style.height = '' + tierTotal + 'px';\n this.ruler2.style.height = '' + tierTotal + 'px';\n this.browserHolder.style.display = 'block';\n this.browserHolder.style.display = '-webkit-flex';\n this.browserHolder.style.display = 'flex';\n // this.svgHolder.style.maxHeight = '' + Math.max(tierTotal, 500) + 'px';\n}\n\nBrowser.prototype.scrollArrowKey = function(ev, dir) {\n if (this.reverseKeyScrolling)\n dir = -dir;\n\n if (ev.ctrlKey || ev.metaKey) {\n var fedge = false;\n if(ev.shiftKey){\n fedge = true;\n }\n\n this.leap(dir, fedge);\n } else if (this.scale > 1) {\n // per-base scrolling mode, tries to perfectly center.\n var mid = (this.viewStart + this.viewEnd)/2\n var err = mid - Math.round(mid);\n var n = 1;\n if (ev.shiftKey)\n n *= 10;\n if (dir > 0) {\n n = -n;\n n -= err;\n if (err > 0)\n n += 1;\n } else {\n n -= err;\n if (err < 0)\n n -= 1;\n }\n this.setLocation(null, this.viewStart + n, this.viewEnd + n);\n } else {\n this.move(ev.shiftKey ? 100*dir : 25*dir);\n }\n}\n\nBrowser.prototype.leap = function(dir, fedge) {\n var thisB = this;\n var pos=((thisB.viewStart + thisB.viewEnd + 1)/2)|0;\n if (dir > 0 && thisB.viewStart <= 1) {\n pos -= 100000000;\n } else if (dir < 0 && thisB.viewEnd >= thisB.currentSeqMax) {\n pos += 100000000;\n }\n\n var st = thisB.getSelectedTier();\n if (st < 0) return;\n var tier = thisB.tiers[st];\n\n if (tier && ((tier.featureSource && this.sourceAdapterIsCapable(tier.featureSource, 'quantLeap') && typeof(tier.quantLeapThreshold) == 'number')\n || (tier.featureSource && this.sourceAdapterIsCapable(tier.featureSource, 'leap')))) {\n tier.findNextFeature(\n thisB.chr,\n pos,\n -dir,\n fedge,\n function(nxt) {\n if (nxt) {\n var nmin = nxt.min;\n var nmax = nxt.max;\n if (fedge) {\n if (dir > 0) {\n if (nmin>pos+1) {\n nmax=nmin;\n } else {\n nmax++;\n nmin=nmax\n }\n } else {\n if (nmax= 0; --gi) {\n var g = glyphs[gi];\n if (!g.notSelectable && g.min() <= rx && g.max() >= rx) {\n if (g.minY) {\n if (ry < g.minY() || ry > g.maxY())\n continue;\n }\n\n if (g.feature) {\n matches.push(g.feature);\n } else if (g.group) {\n matches.push(g.group);\n }\n\n if (g.glyphs) {\n return glyphLookup(g.glyphs, rx, ry, matches);\n } else if (g.glyph) {\n return glyphLookup([g.glyph], rx, ry, matches);\n } else {\n return matches;\n }\n }\n }\n return matches;\n}\n\nBrowser.prototype.nameForCoordSystem = function(cs) {\n var primary = null, ucsc = null;\n if (this.assemblyNamePrimary) {\n primary = '' + cs.auth;\n if (typeof(cs.version) !== 'undefined')\n primary += cs.version;\n }\n if (this.assemblyNameUcsc) {\n ucsc = cs.ucscName;\n }\n if (primary != null && ucsc != null)\n return primary + '/' + ucsc;\n else\n return primary || ucsc || 'unknown';\n}\n\nBrowser.prototype.makeLoader = function(size) {\n size = size || 16;\n var retina = window.devicePixelRatio > 1;\n if (size < 20) {\n return makeElement('img', null, {src: this.resolveURL('$$img/spinner_' + (retina ? 16 : 32) + '.gif'), width: '16', height: '16'});\n } else {\n return makeElement('img', null, {src: this.resolveURL('$$img/spinner_' + (retina ? 24 : 48) + '.gif'), width: '24', height: '24'});\n }\n}\n\nBrowser.prototype.canFetchPlainHTTP = function() {\n var self = this;\n if (!this._plainHTTPPromise) {\n var worker = this.getWorker();\n if (worker) {\n this._plainHTTPPromise = new Promise(function(resolve, reject) {\n worker.postCommand(\n {command: 'textxhr',\n uri: self.httpCanaryURL},\n function(result, err) {\n if (result) {\n resolve(true);\n } else {\n resolve(false);\n }\n });\n });\n } else {\n this._plainHTTPPromise = new Promise(function(resolve, reject) {\n textXHR(\n self.httpCanaryURL,\n function(result, err) {\n if (result) {\n resolve(true);\n } else {\n resolve(false);\n }\n },\n {timeout: 2000}\n );\n });\n }\n }\n return this._plainHTTPPromise;\n}\n\nBrowser.prototype.getWorker = function() {\n if (!this.useFetchWorkers || !this.fetchWorkers || this.fetchWorkers.length==0)\n return null;\n\n if (this.nextWorker >= this.fetchWorkers.length)\n this.nextWorker = 0;\n return this.fetchWorkers[this.nextWorker++];\n}\n\nBrowser.prototype.registerResolver = function(resolver) {\n var id = 'res' + (++this.resolverSeed);\n this.resolvers[id] = resolver;\n return id;\n}\n\nfunction FetchWorker(browser, worker) {\n var thisB = this;\n this.tagSeed = 0;\n this.callbacks = {};\n this.browser = browser;\n this.worker = worker;\n\n this.worker.onmessage = function(ev) {\n var data = ev.data;\n\n if (!data.cmd) {\n var cb = thisB.callbacks[data.tag];\n if (cb) {\n cb(data.result, data.error);\n delete thisB.callbacks[data.tag];\n }\n } else if (data.cmd == 'resolve') {\n var resolver = thisB.browser.resolvers[data.resolver];\n if (resolver) {\n resolver(data.url).then(function(url) {\n thisB.worker.postMessage({\n tag: data.tag,\n url: url\n });\n }).catch(function(err){\n console.log(err);\n thisB.worker.postMessage({\n tag: data.tag,\n err: err.toString()\n });\n });\n } else {\n console.log('No resolver ' + data.resolver);\n }\n } else {\n console.log('Bad worker callback ' + data.cmd);\n }\n };\n}\n\nfunction makeFetchWorker(browser) {\n var wurl = browser.resolveURL(browser.workerPath);\n if (wurl.indexOf('//') == 0) {\n var proto = window.location.protocol;\n if (proto == 'https:')\n wurl = 'https:' + wurl;\n else\n wurl = 'http:' + wurl;\n }\n\n var wscript = 'importScripts(\"' + wurl + '?version=' + VERSION + '\");';\n var wblob = new Blob([wscript], {type: 'application/javascript'});\n\n\n return new Promise(function(resolve, reject) {\n var worker = new Worker(URL.createObjectURL(wblob));\n\n worker.onmessage = function(ev) {\n if (ev.data.tag === 'init') {\n console.log('Worker initialized');\n resolve(new FetchWorker(browser, worker))\n }\n\n }\n\n worker.onerror = function(ev) {\n reject(ev.message);\n }\n });\n}\n\nFetchWorker.prototype.postCommand = function(cmd, callback, transfer) {\n var tag = 'x' + (++this.tagSeed);\n cmd.tag = tag;\n this.callbacks[tag] = callback;\n this.worker.postMessage(cmd, transfer);\n}\n\nFetchWorker.prototype.terminate = function() {\n this.worker.terminate();\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n Browser: Browser\n };\n\n // Required because they add stuff to Browser.prototype\n require('./browser-ui');\n require('./track-adder');\n require('./feature-popup');\n require('./tier-actions');\n require('./domui');\n require('./search');\n\n var sa = require('./sourceadapters');\n var TwoBitSequenceSource = sa.TwoBitSequenceSource;\n var EnsemblSequenceSource = sa.EnsemblSequenceSource;\n var DASSequenceSource = sa.DASSequenceSource;\n\n var KnownSpace = require('./kspace').KnownSpace;\n\n var DASRegistry = require('./das').DASRegistry;\n}\n\nfunction SourceCache() {\n this.sourcesByURI = {}\n}\n\nSourceCache.prototype.get = function(conf) {\n var scb = this.sourcesByURI[sourceDataURI(conf)];\n if (scb) {\n for (var si = 0; si < scb.configs.length; ++si) {\n if (sourcesAreEqualModuloStyle(scb.configs[si], conf)) {\n return scb.sources[si];\n }\n }\n }\n}\n\nSourceCache.prototype.put = function(conf, source) {\n var uri = sourceDataURI(conf);\n var scb = this.sourcesByURI[uri];\n if (!scb) {\n scb = {configs: [], sources: []};\n this.sourcesByURI[uri] = scb;\n }\n scb.configs.push(conf);\n scb.sources.push(source);\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// chainset.js: liftover support\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var das = require('./das');\n var DASSource = das.DASSource;\n var DASSegment = das.DASSegment;\n\n var utils = require('./utils');\n var pusho = utils.pusho;\n var shallowCopy = utils.shallowCopy;\n\n var parseCigar = require('./cigar').parseCigar;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n\n var bbi = require('./bigwig');\n var makeBwg = bbi.makeBwg;\n\n var Promise = require('es6-promise').Promise;\n}\n\nfunction Chainset(conf, srcTag, destTag, coords) {\n if (typeof(conf) == 'string') {\n this.uri = conf;\n this.srcTag = srcTag;\n this.destTag = destTag;\n this.coords = coords;\n } else {\n this.uri = conf.uri;\n this.srcTag = conf.srcTag;\n this.destTag = conf.destTag;\n this.coords = shallowCopy(conf.coords);\n this.type = conf.type;\n this.credentials = conf.credentials;\n }\n\n this.chainsBySrc = {};\n this.chainsByDest = {};\n this.postFetchQueues = {};\n this.fetchedTiles = {};\n this.granularity = 1000000; // size in bases of tile to fetch\n\n if (this.type == 'bigbed') {\n this.chainFetcher = new BBIChainFetcher(this.uri, this.credentials);\n } else if (this.type == 'alias') {\n this.chainFetcher = new AliasChainFetcher(conf);\n } else {\n this.chainFetcher = new DASChainFetcher(this.uri, this.srcTag, this.destTag);\n }\n};\n\nChainset.prototype.exportConfig = function() {\n return {\n uri: this.uri,\n srcTag: this.srcTag,\n destTag: this.destTag,\n coords: this.coords,\n type: this.type,\n credentials: this.credentials\n };\n}\n\nChainset.prototype.mapPoint = function(chr, pos) {\n var chains = this.chainsBySrc[chr] || [];\n for (var ci = 0; ci < chains.length; ++ci) {\n var c = chains[ci];\n if (pos >= c.srcMin && pos <= c.srcMax) {\n var cpos;\n if (c.srcOri == '-') {\n cpos = c.srcMax - pos;\n } else {\n cpos = pos - c.srcMin;\n }\n var blocks = c.blocks;\n for (var bi = 0; bi < blocks.length; ++bi) {\n var b = blocks[bi];\n var bSrc = b[0];\n var bDest = b[1];\n var bSize = b[2];\n if (cpos >= bSrc && cpos <= (bSrc + bSize)) {\n var apos = cpos - bSrc;\n\n var dpos;\n if (c.destOri == '-') {\n dpos = c.destMax - bDest - apos;\n } else {\n dpos = apos + bDest + c.destMin;\n }\n return {seq: c.destChr, pos: dpos, flipped: (c.srcOri != c.destOri)}\n }\n }\n }\n }\n return null;\n}\n\nChainset.prototype.mapSegment = function(chr, min, max) {\n var chains = this.chainsBySrc[chr] || [];\n var mappings = [];\n for (var ci = 0; ci < chains.length; ++ci) {\n var c = chains[ci];\n if (max >= c.srcMin && min <= c.srcMax) {\n var cmin, cmax;\n if (c.srcOri == '-') {\n cmin = c.srcMax - max;\n cmax = c.srcMax - min;\n } else {\n cmin = min - c.srcMin;\n cmax = max - c.srcMin;\n }\n var blocks = c.blocks;\n for (var bi = 0; bi < blocks.length; ++bi) {\n var b = blocks[bi];\n var bSrc = b[0];\n var bDest = b[1];\n var bSize = b[2];\n if (cmax >= bSrc && cmin <= (bSrc + bSize)) {\n var m = {\n segment: c.destChr,\n flipped: (c.srcOri == '-') ^ (c.destOri == '-')};\n\n if (c.destOri == '-') {\n if (cmin >= bSrc) {\n m.max = c.destMax - bDest - cmin + bSrc;\n } else {\n m.max = c.destMax - bDest;\n m.partialMax = bSrc - cmin;\n }\n if (cmax <= (bSrc + bSize)) {\n m.min = c.destMax - bDest - cmax + bSrc;\n } else {\n m.min = c.destMax - bDest - bSize;\n m.partialMin = cmax - bSrc - bSize;\n }\n } else {\n if (cmin >= bSrc) {\n m.min = c.destMin + bDest + cmin - bSrc;\n } else {\n m.min = c.destMin + bDest;\n m.partialMin = bSrc - cmin;\n }\n if (cmax <= (bSrc + bSize)) {\n m.max = c.destMin + bDest + cmax - bSrc;\n } else {\n m.max = c.destMin + bDest + bSize;\n m.partialMax = cmax - bSrc - bSize;\n }\n }\n mappings.push(m);\n }\n }\n }\n }\n return mappings;\n}\n\nChainset.prototype.unmapPoint = function(chr, pos) {\n var chains = this.chainsByDest[chr] || [];\n for (var ci = 0; ci < chains.length; ++ci) {\n var c = chains[ci];\n if (pos >= c.destMin && pos <= c.destMax) {\n var cpos;\n if (c.srcOri == '-') {\n cpos = c.destMax - pos;\n } else {\n cpos = pos - c.destMin;\n } \n \n var blocks = c.blocks;\n for (var bi = 0; bi < blocks.length; ++bi) {\n var b = blocks[bi];\n var bSrc = b[0];\n var bDest = b[1];\n var bSize = b[2];\n\n if (cpos >= bDest && cpos <= (bDest + bSize)) {\n var apos = cpos - bDest;\n\n var dpos = apos + bSrc + c.srcMin;\n var dpos;\n if (c.destOri == '-') {\n dpos = c.srcMax - bSrc - apos;\n } else {\n dpos = apos + bSrc + c.srcMin;\n }\n return {seq: c.srcChr, pos: dpos, flipped: (c.srcOri != c.destOri)}\n }\n }\n // return null;\n }\n }\n return null;\n}\n\nChainset.prototype.sourceBlocksForRange = function(chr, min, max, callback) {\n var STATE_PENDING = 1;\n var STATE_FETCHED = 2;\n\n var thisCS = this;\n var minTile = (min/this.granularity)|0;\n var maxTile = (max/this.granularity)|0;\n\n var needsNewOrPending = false;\n var needsNewFetch = false;\n for (var t = minTile; t <= maxTile; ++t) {\n var tn = chr + '_' + t;\n if (this.fetchedTiles[tn] != STATE_FETCHED) {\n needsNewOrPending = true;\n if (this.fetchedTiles[tn] != STATE_PENDING) {\n this.fetchedTiles[tn] = STATE_PENDING;\n needsNewFetch = true;\n }\n }\n }\n\n if (needsNewOrPending) {\n if (!this.postFetchQueues[chr]) {\n this.chainFetcher.fetchChains(\n chr, \n minTile * this.granularity, \n (maxTile+1) * this.granularity - 1)\n .then(function(chains) {\n if (!thisCS.chainsByDest)\n thisCS.chainsByDest[chr] = [];\n for (var ci = 0; ci < chains.length; ++ci) {\n var chain = chains[ci];\n\n {\n var cbs = thisCS.chainsBySrc[chain.srcChr];\n if (!cbs) {\n thisCS.chainsBySrc[chain.srcChr] = [chain];\n } else {\n var present = false;\n for (var oci = 0; oci < cbs.length; ++oci) {\n var oc = cbs[oci];\n if (oc.srcMin == chain.srcMin && oc.srcMax == chain.srcMax) {\n present = true;\n break;\n }\n }\n if (!present)\n cbs.push(chain);\n }\n }\n\n {\n var cbd = thisCS.chainsByDest[chain.destChr];\n if (!cbd) {\n thisCS.chainsByDest[chain.destChr] = [chain];\n } else {\n var present = false;\n for (var oci = 0; oci < cbd.length; ++oci) {\n var oc = cbd[oci];\n if (oc.destMin == chain.destMin && oc.destMax == chain.destMax) {\n present = true;\n break;\n }\n }\n if (!present)\n cbd.push(chain);\n }\n }\n }\n for (var t = minTile; t <= maxTile; ++t) {\n var tn = chr + '_' + t;\n thisCS.fetchedTiles[tn] = STATE_FETCHED;\n }\n if (thisCS.postFetchQueues[chr]) {\n var pfq = thisCS.postFetchQueues[chr];\n for (var i = 0; i < pfq.length; ++i) {\n pfq[i]();\n }\n thisCS.postFetchQueues[chr] = null;\n }\n }).catch(function (err) {\n console.log(err);\n }); \n }\n\n pusho(this.postFetchQueues, chr, function() {\n // Will either succeed if the tiles that are needed have already been fetched,\n // or queue up a new fetch.\n\n thisCS.sourceBlocksForRange(chr, min, max, callback);\n });\n } else {\n var srcBlocks = [];\n var chains = this.chainsByDest[chr] || [];\n for (var ci = 0; ci < chains.length; ++ci) {\n var c = chains[ci];\n if (min <= c.destMax && max >= c.destMin) {\n var cmin, cmax;\n if (c.srcOri == '-') {\n cmin = c.destMax - max;\n cmax = c.destMax - min;\n } else {\n cmin = min - c.destMin;\n cmax = max - c.destMin;\n }\n\n var blocks = c.blocks;\n for (var bi = 0; bi < blocks.length; ++bi) {\n var b = blocks[bi];\n var bSrc = b[0];\n var bDest = b[1];\n var bSize = b[2];\n\n if (cmax >= bDest && cmin <= (bDest + bSize)) {\n var amin = Math.max(cmin, bDest) - bDest;\n var amax = Math.min(cmax, bDest + bSize) - bDest;\n\n if (c.destOri == '-') {\n srcBlocks.push(new DASSegment(c.srcChr, c.srcMax - bSrc - amax, c.srcMax - bSrc - amin));\n } else {\n srcBlocks.push(new DASSegment(c.srcChr, c.srcMin + amin + bSrc, c.srcMin + amax + bSrc));\n }\n }\n }\n }\n }\n callback(srcBlocks);\n }\n}\n\nfunction DASChainFetcher(uri, srcTag, destTag) {\n this.source = new DASSource(uri);\n this.srcTag = srcTag;\n this.destTag =destTag;\n}\n\nDASChainFetcher.prototype.fetchChains = function(chr, _min, _max) {\n var thisCS = this;\n\n return new Promise(function(resolve, reject) {\n thisCS.source.alignments(chr, {}, function(aligns) {\n var chains = [];\n\n for (var ai = 0; ai < aligns.length; ++ai) {\n var aln = aligns[ai];\n for (var bi = 0; bi < aln.blocks.length; ++bi) {\n var block = aln.blocks[bi];\n var srcSeg, destSeg;\n for (var si = 0; si < block.segments.length; ++si) {\n var seg = block.segments[si];\n var obj = aln.objects[seg.object];\n if (obj.dbSource === thisCS.srcTag) {\n srcSeg = seg;\n } else if (obj.dbSource === thisCS.destTag) {\n destSeg = seg;\n }\n }\n if (srcSeg && destSeg) {\n var chain = {\n srcChr: aln.objects[srcSeg.object].accession,\n srcMin: srcSeg.min|0,\n srcMax: srcSeg.max|0,\n srcOri: srcSeg.strand,\n destChr: aln.objects[destSeg.object].accession,\n destMin: destSeg.min|0,\n destMax: destSeg.max|0,\n destOri: destSeg.strand,\n blocks: []\n }\n\n var srcops = parseCigar(srcSeg.cigar), destops = parseCigar(destSeg.cigar);\n\n var srcOffset = 0, destOffset = 0;\n var srci = 0, desti = 0;\n while (srci < srcops.length && desti < destops.length) {\n if (srcops[srci].op == 'M' && destops[desti].op == 'M') {\n var blockLen = Math.min(srcops[srci].cnt, destops[desti].cnt);\n chain.blocks.push([srcOffset, destOffset, blockLen]);\n if (srcops[srci].cnt == blockLen) {\n ++srci;\n } else {\n srcops[srci].cnt -= blockLen;\n }\n if (destops[desti].cnt == blockLen) {\n ++desti;\n } else {\n destops[desti] -= blockLen;\n }\n srcOffset += blockLen;\n destOffset += blockLen;\n } else if (srcops[srci].op == 'I') {\n destOffset += srcops[srci++].cnt;\n } else if (destops[desti].op == 'I') {\n srcOffset += destops[desti++].cnt;\n }\n }\n\n chains.push(chain);\n }\n }\n }\n resolve(chains);\n });\n });\n}\n\nfunction BBIChainFetcher(uri, credentials) {\n var self = this;\n this.uri = uri;\n this.credentials = credentials;\n\n this.bwg = new Promise(function(resolve, reject) {\n makeBwg(new URLFetchable(self.uri, {credentials: self.credentials, \n resolver: self.resolver}), \n function(bwg, err) {\n if (bwg) {\n resolve(bwg);\n } else {\n reject(err);\n }\n });\n });\n\n this.bwg.then(function(bwg, err) {\n if (err)\n console.log(err);\n });\n}\n\nfunction pi(x) {\n return parseInt(x);\n}\n\nfunction cleanChr(c) {\n if (c.indexOf('chr') == 0)\n return c.substr(3);\n else\n return c;\n}\n\nfunction bbiFeatureToChain(feature) {\n var chain = {\n srcChr: cleanChr(feature.srcChrom),\n srcMin: parseInt(feature.srcStart),\n srcMax: parseInt(feature.srcEnd),\n srcOri: feature.srcOri,\n destChr: cleanChr(feature.segment),\n destMin: feature.min - 1, // Convert back from bigbed parser\n destMax: feature.max,\n destOri: feature.ori,\n blocks: []\n };\n var srcStarts = feature.srcStarts.split(',').map(pi);\n var destStarts = feature.destStarts.split(',').map(pi);\n var blockLengths = feature.blockLens.split(',').map(pi);\n for (var bi = 0; bi < srcStarts.length; ++bi) {\n chain.blocks.push([srcStarts[bi], destStarts[bi], blockLengths[bi]]);\n }\n\n return chain;\n}\n\nBBIChainFetcher.prototype.fetchChains = function(chr, min, max) {\n return this.bwg.then(function(bwg, err) {\n if (!bwg)\n throw Error(\"No BWG\");\n\n return new Promise(function(resolve, reject) {\n bwg.getUnzoomedView().readWigData(chr, min, max, function(feats) {\n resolve(feats.map(bbiFeatureToChain));\n });\n });\n });\n};\n\nfunction AliasChainFetcher(conf) {\n this.conf = conf;\n this.forwardAliases = {};\n var sa = conf.sequenceAliases || [];\n for (var ai = 0; ai < sa.length; ++ai) {\n var al = sa[ai];\n if (al.length < 2)\n continue;\n\n var fa = [];\n for (var i = 0; i < al.length - 1; ++i)\n fa.push(al[i]);\n this.forwardAliases[al[al.length - 1]] = fa;\n }\n}\n\nAliasChainFetcher.prototype.fetchChains = function(chr, min, max) {\n var resp = [];\n var fa = this.forwardAliases[chr] || [];\n for (var i = 0; i < fa.length; ++i) {\n resp.push(\n {\n srcChr: fa[i],\n srcMin: 1,\n srcMax: 1000000000,\n srcOri: '+',\n destChr: chr,\n destMin: 1,\n destMax: 1000000000,\n destOri: '+',\n blocks: [[1, 1, 1000000000]]\n });\n }\n\n return Promise.resolve(resp);\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n Chainset: Chainset\n };\n}\n","\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// chainset.js: liftover support\n//\n\nvar CIGAR_REGEXP = new RegExp('([0-9]*)([MIDS])', 'g');\n\nfunction parseCigar(cigar)\n{\n var cigops = [];\n var match;\n while ((match = CIGAR_REGEXP.exec(cigar)) != null) {\n var count = match[1];\n if (count.length == 0) {\n count = 1;\n }\n cigops.push({cnt: count|0, op: match[2]});\n }\n return cigops;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n parseCigar: parseCigar\n };\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// color.js\n//\n\n\"use strict\";\n\nfunction DColour(red, green, blue, name) {\n this.red = red|0;\n this.green = green|0;\n this.blue = blue|0;\n if (name) {\n this.name = name;\n }\n}\n\nDColour.prototype.toSvgString = function() {\n if (!this.name) {\n this.name = \"rgb(\" + this.red + \",\" + this.green + \",\" + this.blue + \")\";\n }\n\n return this.name;\n}\n\nfunction hex2(x) {\n var y = '00' + x.toString(16);\n return y.substring(y.length - 2);\n}\n\nDColour.prototype.toHexString = function() {\n return '#' + hex2(this.red) + hex2(this.green) + hex2(this.blue);\n}\n\nvar palette = {\n red: new DColour(255, 0, 0, 'red'),\n green: new DColour(0, 255, 0, 'green'),\n blue: new DColour(0, 0, 255, 'blue'),\n yellow: new DColour(255, 255, 0, 'yellow'),\n white: new DColour(255, 255, 255, 'white'),\n black: new DColour(0, 0, 0, 'black'),\n gray: new DColour(180, 180, 180, 'gray'),\n grey: new DColour(180, 180, 180, 'grey'),\n lightskyblue: new DColour(135, 206, 250, 'lightskyblue'),\n lightsalmon: new DColour(255, 160, 122, 'lightsalmon'),\n hotpink: new DColour(255, 105, 180, 'hotpink')\n};\n\nvar COLOR_RE = new RegExp('^#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$');\nvar CSS_COLOR_RE = /rgb\\(([0-9]+),([0-9]+),([0-9]+)\\)/\n\nfunction dasColourForName(name) {\n var c = palette[name];\n if (!c) {\n var match = COLOR_RE.exec(name);\n if (match) {\n c = new DColour(('0x' + match[1])|0, ('0x' + match[2])|0, ('0x' + match[3])|0, name);\n palette[name] = c;\n } else {\n \t match = CSS_COLOR_RE.exec(name);\n \t if (match) {\n \t\tc = new DColour(match[1]|0, match[2]|0, match[3]|0, name);\n \t\tpalette[name] = c;\n\t } else {\n\t\t console.log(\"couldn't handle color: \" + name);\n\t\t c = palette.black;\n\t\t palette[name] = c;\n\t }\n }\n }\n return c;\n}\n\nfunction makeColourSteps(steps, stops, colours) {\n var dcolours = [];\n for (var ci = 0; ci < colours.length; ++ci) {\n dcolours.push(dasColourForName(colours[ci]));\n }\n\n var grad = [];\n STEP_LOOP:\n for (var si = 0; si < steps; ++si) {\n var rs = (1.0 * si) / (steps-1);\n var score = stops[0] + (stops[stops.length -1] - stops[0]) * rs;\n for (var i = 0; i < stops.length - 1; ++i) {\n if (score >= stops[i] && score <= stops[i+1]) {\n var frac = (score - stops[i]) / (stops[i+1] - stops[i]);\n var ca = dcolours[i];\n var cb = dcolours[i+1];\n\n var fill = new DColour(\n ((ca.red * (1.0 - frac)) + (cb.red * frac))|0,\n ((ca.green * (1.0 - frac)) + (cb.green * frac))|0,\n ((ca.blue * (1.0 - frac)) + (cb.blue * frac))|0\n ).toSvgString();\n grad.push(fill);\n\n continue STEP_LOOP;\n }\n }\n throw 'Bad step';\n }\n\n return grad;\n}\n\nfunction makeGradient(steps, color1, color2, color3) {\n if (color3) {\n return makeColourSteps(steps, [0, 0.5, 1], [color1, color2, color3]);\n } else {\n return makeColourSteps(steps, [0, 1], [color1, color2]);\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n makeColourSteps: makeColourSteps,\n makeGradient: makeGradient,\n dasColourForName: dasColourForName\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// das.js: queries and low-level data model.\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n var pusho = utils.pusho;\n\n var color = require('./color');\n var makeColourSteps = color.makeColourSteps;\n}\n\nvar dasLibErrorHandler = function(errMsg) {\n alert(errMsg);\n}\nvar dasLibRequestQueue = new Array();\n\nfunction DASSegment(name, start, end, description) {\n this.name = name;\n this.start = start;\n this.end = end;\n this.description = description;\n}\nDASSegment.prototype.toString = function() {\n return this.name + ':' + this.start + '..' + this.end;\n};\nDASSegment.prototype.isBounded = function() {\n return this.start && this.end;\n}\nDASSegment.prototype.toDASQuery = function() {\n var q = 'segment=' + this.name;\n if (this.start && this.end) {\n q += (':' + this.start + ',' + this.end);\n }\n return q;\n}\n\n\nfunction DASSource(a1, a2) {\n var options;\n if (typeof a1 == 'string') {\n this.uri = a1;\n options = a2 || {};\n } else {\n options = a1 || {};\n }\n for (var k in options) {\n this[k] = options[k];\n }\n\n if (!this.coords) {\n this.coords = [];\n }\n if (!this.props) {\n this.props = {};\n }\n\n this.dasBaseURI = this.uri;\n if (this.dasBaseURI && this.dasBaseURI.substr(this.uri.length - 1) != '/') {\n this.dasBaseURI = this.dasBaseURI + '/';\n }\n}\n\nDASSource.prototype.getURI = function(uri) {\n if (this.resolver) {\n return this.resolver(uri).then(function (urlOrObj) {\n if (typeof urlOrObj === 'string') {\n return urlOrObj;\n } else {\n return urlOrObj.url;\n }\n });\n } else {\n return Promise.resolve(uri);\n }\n}\n\nfunction DASCoords() {\n}\n\nfunction coordsMatch(c1, c2) {\n return c1.taxon == c2.taxon && c1.auth == c2.auth && c1.version == c2.version;\n}\n\n//\n// DAS 1.6 entry_points command\n//\n\nDASSource.prototype.entryPoints = function(callback) {\n var dasURI = this.dasBaseURI + 'entry_points';\n this.doCrossDomainRequest(dasURI, function(responseXML) {\n if (!responseXML) {\n return callback([]);\n }\n\n var entryPoints = new Array();\n \n var segs = responseXML.getElementsByTagName('SEGMENT');\n for (var i = 0; i < segs.length; ++i) {\n var seg = segs[i];\n var segId = seg.getAttribute('id');\n \n var segSize = seg.getAttribute('size');\n var segMin, segMax;\n if (segSize) {\n segMin = 1; segMax = segSize|0;\n } else {\n segMin = seg.getAttribute('start');\n if (segMin) {\n segMin |= 0;\n }\n segMax = seg.getAttribute('stop');\n if (segMax) {\n segMax |= 0;\n }\n }\n var segDesc = null;\n if (seg.firstChild) {\n segDesc = seg.firstChild.nodeValue;\n }\n entryPoints.push(new DASSegment(segId, segMin, segMax, segDesc));\n } \n callback(entryPoints);\n }); \n}\n\n//\n// DAS 1.6 sequence command\n// Do we need an option to fall back to the dna command?\n//\n\nfunction DASSequence(name, start, end, alpha, seq) {\n this.name = name;\n this.start = start;\n this.end = end;\n this.alphabet = alpha;\n this.seq = seq;\n}\n\nDASSource.prototype.sequence = function(segment, callback) {\n var dasURI = this.dasBaseURI + 'sequence?' + segment.toDASQuery();\n this.doCrossDomainRequest(dasURI, function(responseXML) {\n if (!responseXML) {\n callback([]);\n return;\n } else {\n var seqs = new Array();\n \n var segs = responseXML.getElementsByTagName('SEQUENCE');\n for (var i = 0; i < segs.length; ++i) {\n var seg = segs[i];\n var segId = seg.getAttribute('id');\n var segMin = seg.getAttribute('start');\n var segMax = seg.getAttribute('stop');\n var segAlpha = 'DNA';\n var segSeq = null;\n if (seg.firstChild) {\n var rawSeq = seg.firstChild.nodeValue;\n segSeq = '';\n var idx = 0;\n while (true) {\n var space = rawSeq.indexOf('\\n', idx);\n if (space >= 0) {\n segSeq += rawSeq.substring(idx, space).toUpperCase();\n idx = space + 1;\n } else {\n segSeq += rawSeq.substring(idx).toUpperCase();\n break;\n }\n }\n }\n seqs.push(new DASSequence(segId, segMin, segMax, segAlpha, segSeq));\n }\n \n callback(seqs);\n }\n });\n}\n\n//\n// DAS 1.6 features command\n//\n\nfunction DASFeature() {\n}\n\nfunction DASGroup(id) {\n if (id)\n this.id = id;\n}\n\nfunction DASLink(desc, uri) {\n this.desc = desc;\n this.uri = uri;\n}\n\nDASSource.prototype.features = function(segment, options, callback) {\n options = options || {};\n var thisB = this;\n\n var dasURI;\n if (this.features_uri) {\n dasURI = this.features_uri;\n } else {\n var filters = [];\n\n if (segment) {\n filters.push(segment.toDASQuery());\n } else if (options.group) {\n var g = options.group;\n if (typeof g == 'string') {\n filters.push('group_id=' + g);\n } else {\n for (var gi = 0; gi < g.length; ++gi) {\n filters.push('group_id=' + g[gi]);\n }\n }\n }\n\n if (options.adjacent) {\n var adj = options.adjacent;\n if (typeof adj == 'string') {\n adj = [adj];\n }\n for (var ai = 0; ai < adj.length; ++ai) {\n filters.push('adjacent=' + adj[ai]);\n }\n }\n\n if (options.type) {\n if (typeof options.type == 'string') {\n filters.push('type=' + options.type);\n } else {\n for (var ti = 0; ti < options.type.length; ++ti) {\n filters.push('type=' + options.type[ti]);\n }\n }\n }\n \n if (options.maxbins) {\n filters.push('maxbins=' + options.maxbins);\n }\n \n if (filters.length > 0) {\n dasURI = this.dasBaseURI + 'features?' + filters.join(';');\n } else {\n callback([], 'No filters specified');\n }\n } \n \n\n this.doCrossDomainRequest(dasURI, function(responseXML, req) {\n if (!responseXML) {\n var msg;\n if (req.status == 0) {\n msg = 'server may not support CORS';\n } else {\n msg = 'status=' + req.status;\n }\n callback([], 'Failed request: ' + msg);\n return;\n }\n/* if (req) {\n var caps = req.getResponseHeader('X-DAS-Capabilties');\n if (caps) {\n alert(caps);\n }\n } */\n\n var features = new Array();\n var segmentMap = {};\n\n var segs = responseXML.getElementsByTagName('SEGMENT');\n for (var si = 0; si < segs.length; ++si) {\n var segmentXML = segs[si];\n var segmentID = segmentXML.getAttribute('id');\n segmentMap[segmentID] = {\n min: segmentXML.getAttribute('start'),\n max: segmentXML.getAttribute('stop')\n };\n \n var featureXMLs = segmentXML.getElementsByTagName('FEATURE');\n for (var i = 0; i < featureXMLs.length; ++i) {\n var feature = featureXMLs[i];\n var dasFeature = new DASFeature();\n \n dasFeature.segment = segmentID;\n dasFeature.id = feature.getAttribute('id');\n dasFeature.label = feature.getAttribute('label');\n\n\n/*\n var childNodes = feature.childNodes;\n for (var c = 0; c < childNodes.length; ++c) {\n var cn = childNodes[c];\n if (cn.nodeType == Node.ELEMENT_NODE) {\n var key = cn.tagName;\n //var val = null;\n //if (cn.firstChild) {\n // val = cn.firstChild.nodeValue;\n //}\n dasFeature[key] = 'x';\n }\n } */\n\n\n var spos = elementValue(feature, \"START\");\n var epos = elementValue(feature, \"END\");\n if ((spos|0) > (epos|0)) {\n dasFeature.min = epos|0;\n dasFeature.max = spos|0;\n } else {\n dasFeature.min = spos|0;\n dasFeature.max = epos|0;\n }\n {\n var tec = feature.getElementsByTagName('TYPE');\n if (tec.length > 0) {\n var te = tec[0];\n if (te.firstChild) {\n dasFeature.type = te.firstChild.nodeValue;\n }\n dasFeature.typeId = te.getAttribute('id');\n dasFeature.typeCv = te.getAttribute('cvId');\n }\n }\n dasFeature.type = elementValue(feature, \"TYPE\");\n if (!dasFeature.type && dasFeature.typeId) {\n dasFeature.type = dasFeature.typeId; // FIXME?\n }\n \n dasFeature.method = elementValue(feature, \"METHOD\");\n {\n var ori = elementValue(feature, \"ORIENTATION\");\n if (!ori) {\n ori = '0';\n }\n dasFeature.orientation = ori;\n }\n dasFeature.score = elementValue(feature, \"SCORE\");\n dasFeature.links = dasLinksOf(feature);\n dasFeature.notes = dasNotesOf(feature);\n \n var groups = feature.getElementsByTagName(\"GROUP\");\n for (var gi = 0; gi < groups.length; ++gi) {\n var groupXML = groups[gi];\n var dasGroup = new DASGroup();\n dasGroup.type = groupXML.getAttribute('type');\n dasGroup.id = groupXML.getAttribute('id');\n dasGroup.links = dasLinksOf(groupXML);\n dasGroup.notes = dasNotesOf(groupXML);\n if (!dasFeature.groups) {\n dasFeature.groups = new Array(dasGroup);\n } else {\n dasFeature.groups.push(dasGroup);\n }\n }\n\n // Magic notes. Check with TAD before changing this.\n if (dasFeature.notes) {\n for (var ni = 0; ni < dasFeature.notes.length; ++ni) {\n var n = dasFeature.notes[ni];\n if (n.indexOf('Genename=') == 0) {\n var gg = new DASGroup();\n gg.type='gene';\n gg.id = n.substring(9);\n if (!dasFeature.groups) {\n dasFeature.groups = new Array(gg);\n } else {\n dasFeature.groups.push(gg);\n }\n }\n }\n }\n \n {\n var pec = feature.getElementsByTagName('PART');\n if (pec.length > 0) {\n var parts = [];\n for (var pi = 0; pi < pec.length; ++pi) {\n parts.push(pec[pi].getAttribute('id'));\n }\n dasFeature.parts = parts;\n }\n }\n {\n var pec = feature.getElementsByTagName('PARENT');\n if (pec.length > 0) {\n var parents = [];\n for (var pi = 0; pi < pec.length; ++pi) {\n parents.push(pec[pi].getAttribute('id'));\n }\n dasFeature.parents = parents;\n }\n }\n \n features.push(dasFeature);\n }\n }\n \n callback(features, undefined, segmentMap);\n },\n function (err) {\n callback([], err);\n });\n}\n\nfunction DASAlignment(type) {\n this.type = type;\n this.objects = {};\n this.blocks = [];\n}\n\nDASSource.prototype.alignments = function(segment, options, callback) {\n var dasURI = this.dasBaseURI + 'alignment?query=' + segment;\n this.doCrossDomainRequest(dasURI, function(responseXML) {\n if (!responseXML) {\n callback([], 'Failed request ' + dasURI);\n return;\n }\n\n var alignments = [];\n var aliXMLs = responseXML.getElementsByTagName('alignment');\n for (var ai = 0; ai < aliXMLs.length; ++ai) {\n var aliXML = aliXMLs[ai];\n var ali = new DASAlignment(aliXML.getAttribute('alignType'));\n var objXMLs = aliXML.getElementsByTagName('alignObject');\n for (var oi = 0; oi < objXMLs.length; ++oi) {\n var objXML = objXMLs[oi];\n var obj = {\n id: objXML.getAttribute('intObjectId'),\n accession: objXML.getAttribute('dbAccessionId'),\n version: objXML.getAttribute('objectVersion'),\n dbSource: objXML.getAttribute('dbSource'),\n dbVersion: objXML.getAttribute('dbVersion')\n };\n ali.objects[obj.id] = obj;\n }\n \n var blockXMLs = aliXML.getElementsByTagName('block');\n for (var bi = 0; bi < blockXMLs.length; ++bi) {\n var blockXML = blockXMLs[bi];\n var block = {\n order: blockXML.getAttribute('blockOrder'),\n segments: []\n };\n var segXMLs = blockXML.getElementsByTagName('segment');\n for (var si = 0; si < segXMLs.length; ++si) {\n var segXML = segXMLs[si];\n var seg = {\n object: segXML.getAttribute('intObjectId'),\n min: segXML.getAttribute('start'),\n max: segXML.getAttribute('end'),\n strand: segXML.getAttribute('strand'),\n cigar: elementValue(segXML, 'cigar')\n };\n block.segments.push(seg);\n }\n ali.blocks.push(block);\n } \n \n alignments.push(ali);\n }\n callback(alignments);\n });\n}\n\n\nfunction DASStylesheet() {\n this.styles = [];\n}\n\nDASStylesheet.prototype.pushStyle = function(filters, zoom, style) {\n if (!filters) {\n filters = {type: 'default'};\n }\n var styleHolder = shallowCopy(filters);\n if (zoom) {\n styleHolder.zoom = zoom;\n }\n styleHolder.style = style;\n this.styles.push(styleHolder);\n}\n\nfunction DASStyle() {\n}\n\nfunction parseGradient(grad) {\n var steps = grad.getAttribute('steps');\n if (steps) {\n steps = steps|0;\n } else {\n steps = 50;\n }\n\n var stops = [];\n var colors = [];\n var se = grad.getElementsByTagName('STOP');\n for (var si = 0; si < se.length; ++si) {\n var stop = se[si];\n stops.push(1.0 * stop.getAttribute('score'));\n colors.push(stop.firstChild.nodeValue);\n }\n\n return makeColourSteps(steps, stops, colors);\n}\n\nDASSource.prototype.stylesheet = function(successCB, failureCB) {\n var dasURI, creds = this.credentials;\n if (this.stylesheet_uri) {\n dasURI = this.stylesheet_uri;\n creds = false;\n } else {\n dasURI = this.dasBaseURI + 'stylesheet';\n }\n\n this.getURI(dasURI).then(function(dasURI) {\n doCrossDomainRequest(dasURI, function(responseXML) {\n if (!responseXML) {\n if (failureCB) {\n failureCB();\n } \n return;\n }\n var stylesheet = new DASStylesheet();\n var typeXMLs = responseXML.getElementsByTagName('TYPE');\n for (var i = 0; i < typeXMLs.length; ++i) {\n var typeStyle = typeXMLs[i];\n \n var filter = {};\n filter.type = typeStyle.getAttribute('id'); // Am I right in thinking that this makes DASSTYLE XML invalid? Ugh.\n filter.label = typeStyle.getAttribute('label');\n filter.method = typeStyle.getAttribute('method');\n var glyphXMLs = typeStyle.getElementsByTagName('GLYPH');\n for (var gi = 0; gi < glyphXMLs.length; ++gi) {\n var glyphXML = glyphXMLs[gi];\n var zoom = glyphXML.getAttribute('zoom');\n var glyph = childElementOf(glyphXML);\n var style = new DASStyle();\n style.glyph = glyph.localName;\n var child = glyph.firstChild;\n \n while (child) {\n if (child.nodeType == Node.ELEMENT_NODE) {\n if (child.localName == 'BGGRAD') {\n style[child.localName] = parseGradient(child);\n } else { \n style[child.localName] = child.firstChild.nodeValue;\n }\n }\n child = child.nextSibling;\n }\n stylesheet.pushStyle(filter, zoom, style);\n }\n }\n successCB(stylesheet);\n }, creds);\n }).catch(function(err) {\n console.log(err);\n failureCB();\n });\n}\n\n//\n// sources command\n// \n\nfunction DASRegistry(uri, opts)\n{\n opts = opts || {};\n this.uri = uri;\n this.opts = opts; \n}\n\nDASRegistry.prototype.sources = function(callback, failure, opts)\n{\n if (!opts) {\n opts = {};\n }\n\n var filters = [];\n if (opts.taxon) {\n filters.push('organism=' + opts.taxon);\n }\n if (opts.auth) {\n filters.push('authority=' + opts.auth);\n }\n if (opts.version) {\n filters.push('version=' + opts.version);\n }\n var quri = this.uri;\n if (filters.length > 0) {\n quri = quri + '?' + filters.join('&'); // '&' as a separator to hack around dasregistry.org bug.\n }\n\n doCrossDomainRequest(quri, function(responseXML) {\n if (!responseXML && failure) {\n failure();\n return;\n }\n\n var sources = []; \n var sourceXMLs = responseXML.getElementsByTagName('SOURCE');\n for (var si = 0; si < sourceXMLs.length; ++si) {\n var sourceXML = sourceXMLs[si];\n var versionXMLs = sourceXML.getElementsByTagName('VERSION');\n if (versionXMLs.length < 1) {\n continue;\n }\n var versionXML = versionXMLs[0];\n\n var coordXMLs = versionXML.getElementsByTagName('COORDINATES');\n var coords = [];\n for (var ci = 0; ci < coordXMLs.length; ++ci) {\n var coordXML = coordXMLs[ci];\n var coord = new DASCoords();\n coord.auth = coordXML.getAttribute('authority');\n coord.taxon = coordXML.getAttribute('taxid');\n coord.version = coordXML.getAttribute('version');\n coords.push(coord);\n }\n \n var caps = [];\n var capXMLs = versionXML.getElementsByTagName('CAPABILITY');\n var uri;\n for (var ci = 0; ci < capXMLs.length; ++ci) {\n var capXML = capXMLs[ci];\n \n caps.push(capXML.getAttribute('type'));\n\n if (capXML.getAttribute('type') == 'das1:features') {\n var fep = capXML.getAttribute('query_uri');\n uri = fep.substring(0, fep.length - ('features'.length));\n }\n }\n\n var props = {};\n var propXMLs = versionXML.getElementsByTagName('PROP');\n for (var pi = 0; pi < propXMLs.length; ++pi) {\n pusho(props, propXMLs[pi].getAttribute('name'), propXMLs[pi].getAttribute('value'));\n }\n \n if (uri) {\n var source = new DASSource(uri, {\n source_uri: sourceXML.getAttribute('uri'),\n name: sourceXML.getAttribute('title'),\n desc: sourceXML.getAttribute('description'),\n coords: coords,\n props: props,\n capabilities: caps\n });\n sources.push(source);\n }\n }\n \n callback(sources);\n });\n}\n\n\n//\n// Utility functions\n//\n\nfunction elementValue(element, tag)\n{\n var children = element.getElementsByTagName(tag);\n if (children.length > 0 && children[0].firstChild) {\n var c = children[0];\n if (c.childNodes.length == 1) {\n return c.firstChild.nodeValue;\n } else {\n var s = '';\n for (var ni = 0; ni < c.childNodes.length; ++ni) {\n s += c.childNodes[ni].nodeValue;\n }\n return s;\n }\n\n } else {\n return null;\n }\n}\n\nfunction childElementOf(element)\n{\n if (element.hasChildNodes()) {\n var child = element.firstChild;\n do {\n if (child.nodeType == Node.ELEMENT_NODE) {\n return child;\n } \n child = child.nextSibling;\n } while (child != null);\n }\n return null;\n}\n\n\nfunction dasLinksOf(element)\n{\n var links = new Array();\n var maybeLinkChilden = element.getElementsByTagName('LINK');\n for (var ci = 0; ci < maybeLinkChilden.length; ++ci) {\n var linkXML = maybeLinkChilden[ci];\n if (linkXML.parentNode == element) {\n links.push(new DASLink(linkXML.firstChild ? linkXML.firstChild.nodeValue : 'Unknown', linkXML.getAttribute('href')));\n }\n }\n \n return links;\n}\n\nfunction dasNotesOf(element)\n{\n var notes = [];\n var maybeNotes = element.getElementsByTagName('NOTE');\n for (var ni = 0; ni < maybeNotes.length; ++ni) {\n if (maybeNotes[ni].firstChild) {\n notes.push(maybeNotes[ni].firstChild.nodeValue);\n }\n }\n return notes;\n}\n\nfunction doCrossDomainRequest(url, handler, credentials, custAuth) {\n // TODO: explicit error handlers?\n\n if (window.XDomainRequest) {\n var req = new XDomainRequest();\n req.onload = function() {\n var dom = new ActiveXObject(\"Microsoft.XMLDOM\");\n dom.async = false;\n dom.loadXML(req.responseText);\n handler(dom);\n }\n req.open(\"get\", url);\n req.send();\n } else {\n try {\n var req = new XMLHttpRequest();\n var timeout = setTimeout(\n function() {\n console.log('timing out ' + url);\n req.abort();\n handler(null, req);\n },\n 5000\n );\n\n req.ontimeout = function() {\n console.log('timeout on ' + url);\n };\n\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n clearTimeout(timeout);\n if (req.status >= 200 || req.status == 0) {\n handler(req.responseXML, req);\n }\n }\n };\n req.open(\"get\", url, true);\n // IE10/11 fix: The timeout property may be set only in the time interval between a call to the open method\n // and the first call to the send method.\n req.timeout = 5000;\n if (credentials) {\n req.withCredentials = true;\n }\n if (custAuth) {\n req.setRequestHeader('X-DAS-Authorisation', custAuth);\n }\n req.overrideMimeType('text/xml');\n req.setRequestHeader('Accept', 'application/xml,*/*');\n req.send();\n } catch (e) {\n handler(null, req, e);\n }\n }\n}\n\nDASSource.prototype.doCrossDomainRequest = function(url, handler, errHandler) {\n var custAuth;\n if (this.xUser) {\n custAuth = 'Basic ' + btoa(this.xUser + ':' + this.xPass);\n }\n\n try {\n return doCrossDomainRequest(url, handler, this.credentials, custAuth);\n } catch (err) {\n if (errHandler) {\n errHandler(err);\n } else {\n throw err;\n }\n }\n}\n\nfunction isDasBooleanTrue(s) {\n s = ('' + s).toLowerCase();\n return s==='yes' || s==='true';\n}\n\nfunction isDasBooleanNotFalse(s) {\n if (!s)\n return false;\n\n s = ('' + s).toLowerCase();\n return s!=='no' || s!=='false';\n}\n\nfunction copyStylesheet(ss) {\n var nss = shallowCopy(ss);\n nss.styles = [];\n for (var si = 0; si < ss.styles.length; ++si) {\n var sh = nss.styles[si] = shallowCopy(ss.styles[si]);\n sh._methodRE = sh._labelRE = sh._typeRE = undefined;\n sh.style = shallowCopy(sh.style);\n sh.style.id = undefined;\n sh.style._gradient = undefined;\n }\n return nss;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n DASGroup: DASGroup,\n DASFeature: DASFeature,\n DASStylesheet: DASStylesheet,\n DASStyle: DASStyle,\n DASSource: DASSource,\n DASSegment: DASSegment,\n DASRegistry: DASRegistry,\n DASSequence: DASSequence,\n DASLink: DASLink,\n\n isDasBooleanTrue: isDasBooleanTrue,\n isDasBooleanNotFalse: isDasBooleanNotFalse,\n copyStylesheet: copyStylesheet,\n coordsMatch: coordsMatch\n };\n}\n","/* jshint esversion: 6 */\n\"use strict\";\n\nimport { SubTier } from \"./feature-draw.js\";\n\nimport { drawSeqTier } from \"./sequence-draw.js\";\n\n\nimport { Range, union } from \"./spans.js\";\n\nimport { shallowCopy, pusho } from \"./utils.js\";\n\n\nimport * as Glyphs from \"./glyphs.js\";\n\nimport { isDasBooleanTrue,\n isDasBooleanNotFalse,\n DASFeature } from \"./das.js\";\n\nimport { makeGradient } from \"./color.js\";\n\nimport { parseCigar } from \"./cigar.js\";\n\nimport { formatQuantLabel } from \"./numformats\";\n\nimport * as R from \"ramda\";\n\n// The only functions that must be exported by a renderer are renderTier\n// and drawTier, the rest are exported for use in other renderers.\nexport { renderTier,\n drawTier,\n prepareSubtiers,\n prepareViewport,\n paint,\n drawUnmapped,\n clearViewport,\n createQuantOverlay,\n paintQuant\n };\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\nfunction drawTier(tier) {\n let canvas = tier.viewport.getContext(\"2d\");\n let retina = tier.browser.retina && window.devicePixelRatio > 1;\n\n if (tier.sequenceSource) {\n let sequence = tier.currentSequence;\n drawSeqTier(tier, sequence);\n } else if (tier.currentFeatures) {\n prepareSubtiers(tier, canvas);\n } else {\n console.log(\"No sequence or features in tier!\");\n }\n\n if (tier.subtiers) {\n let vOffset = R.defaultTo(0, tier.dasSource.vOffset);\n\n prepareViewport(tier, canvas, retina, true, vOffset); // NB calls canvas.save\n paint(tier, canvas, vOffset);\n canvas.restore();\n }\n\n tier.drawOverlay();\n tier.paintQuant();\n\n if (typeof(tier.dasSource.drawCallback) === \"function\") {\n tier.dasSource.drawCallback(canvas, tier);\n }\n\n tier.originHaxx = 0;\n tier.browser.arrangeTiers();\n}\n\nfunction glyphsForGroup(canvas, features, y, groupElement, tier) {\n let gstyle = tier.styleForFeature(groupElement);\n let label;\n let labelWanted = false;\n\n let glyphs = [];\n let strand = null;\n\n features.forEach(f => {\n if (f.orientation && strand === null) {\n strand = f.orientation;\n }\n\n if (!label && f.label) {\n label = f.label;\n }\n\n let style = tier.styleForFeature(f);\n if (style && !f.parts) {\n if (isDasBooleanTrue(style.LABEL))\n labelWanted = true;\n\n let glyph = glyphForFeature(canvas, f, y, style, tier, null, true);\n if (glyph)\n glyphs.push(glyph);\n }\n });\n\n if (glyphs.length === 0)\n return null;\n\n let connector = 'flat';\n if (gstyle && gstyle.glyph === 'LINE') {\n // Stick with flat...\n } else {\n if (tier.dasSource.collapseSuperGroups && !tier.bumped) {\n if (strand === '+' || strand === '-') {\n connector = 'collapsed' + strand;\n }\n } else {\n if (strand === '+' || strand === '-') {\n connector = 'hat' + strand;\n }\n }\n }\n\n let labelText = null;\n if ((label && labelWanted) ||\n (gstyle && (isDasBooleanTrue(gstyle.LABEL) ||\n isDasBooleanTrue(gstyle.LABELS)))) { // HACK, LABELS should work.\n labelText = groupElement.label || label;\n }\n\n glyphs.sort((g1, g2) => (g1.zindex || 0) - (g2.zindex || 0));\n\n let groupGlyph = new Glyphs.GroupGlyph(glyphs, connector);\n if (labelText) {\n if (strand === '+') {\n labelText = '>' + labelText;\n } else if (strand === '-') {\n labelText = '<' + labelText;\n }\n groupGlyph = new Glyphs.LabelledGlyph(canvas, groupGlyph, labelText, false);\n }\n groupGlyph.bump = true;\n return groupGlyph;\n}\n\nfunction glyphForFeature(canvas, feature, y, style, tier, forceHeight, noLabel) {\n let scale = tier.browser.scale;\n let origin = tier.browser.viewStart;\n let glyphType = style.glyph || 'BOX';\n\n let min = feature.min;\n let max = feature.max;\n let strand = feature.orientation;\n let score = feature.score;\n let label = feature.label || feature.id;\n\n // Hide glyphs that are smaller than a pixel in width.\n if (tier.dasSource.hideSubpixelGlyphs && (max - min) * scale < 1) return null;\n\n let minPos = (min - origin) * scale;\n let rawMaxPos = ((max - origin + 1) * scale);\n let maxPos = Math.max(rawMaxPos, minPos + 1);\n\n forceHeight = forceHeight * 1.0;\n let height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n height = height * 1.0;\n let bump = style.BUMP && isDasBooleanTrue(style.BUMP);\n\n let glyph;\n let quant;\n\n // Create the glyph\n if (glyphType === 'CROSS' ||\n glyphType === 'EX' ||\n glyphType === 'TRIANGLE' ||\n glyphType === 'DOT' ||\n glyphType === 'SQUARE' ||\n glyphType === 'STAR' ||\n glyphType === 'PLIMSOLL') {\n const glyphHolder = featureToCrossLikeGlyph(canvas, tier, feature, y,\n glyphType, style, forceHeight, noLabel);\n if (glyphHolder) { \n [glyph, quant] = glyphHolder;\n }\n } else if (glyphType === 'HISTOGRAM' || glyphType === 'GRADIENT' && score !== 'undefined') {\n [glyph, quant] = featureToGradientLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight);\n\n } else if (glyphType === 'HIDDEN') {\n glyph = new Glyphs.PaddedGlyph(null, minPos, maxPos);\n noLabel = true;\n\n } else if (glyphType === 'ARROW') {\n let color = style.FGCOLOR || 'purple';\n let parallel = isDasBooleanTrue(style.PARALLEL);\n let sw = isDasBooleanTrue(style.SOUTHWEST);\n let ne = isDasBooleanTrue(style.NORTHEAST);\n glyph = new Glyphs.ArrowGlyph(minPos, maxPos, height, color, parallel, sw, ne);\n\n } else if (glyphType === 'ANCHORED_ARROW') {\n let stroke = style.FGCOLOR || 'none';\n let fill = style.BGCOLOR || 'green';\n glyph = new Glyphs.AArrowGlyph(minPos, maxPos, height, fill, stroke, strand);\n glyph.bump = true;\n\n } else if (glyphType === 'SPAN') {\n let stroke = style.FGCOLOR || 'black';\n glyph = new Glyphs.SpanGlyph(minPos, maxPos, height, stroke);\n\n } else if (glyphType === 'LINE') {\n let stroke = style.FGCOLOR || 'black';\n let lineStyle = style.STYLE || 'solid';\n glyph = new Glyphs.LineGlyph(minPos, maxPos, height, lineStyle, strand, stroke);\n\n } else if (glyphType === 'PRIMERS') {\n let stroke = style.FGCOLOR || 'black';\n let fill = style.BGCOLOR || 'red';\n glyph = new Glyphs.PrimersGlyph(minPos, maxPos, height, fill, stroke);\n\n } else if (glyphType === 'TEXT') {\n let string = style.STRING || 'text';\n let fill = style.FGCOLOR || 'black';\n glyph = new Glyphs.TextGlyph(canvas, minPos, maxPos, height, fill, string);\n\n } else if (glyphType === 'TOOMANY') {\n let stroke = style.FGCOLOR || 'gray';\n let fill = style.BGCOLOR || 'orange';\n glyph = new Glyphs.TooManyGlyph(minPos, maxPos, height, fill, stroke);\n\n } else if (glyphType === 'POINT') {\n [glyph, quant] = featureToPointGlyph(tier, feature, style);\n\n } else if (glyphType === '__SEQUENCE') {\n glyph = sequenceGlyph(canvas, tier, feature, style, forceHeight);\n\n } else if (glyphType === '__INSERTION') {\n let insertionLabels = true;\n if (style.__INSERTIONS !== undefined)\n insertionLabels = isDasBooleanNotFalse(style.__INSERTIONS)\n glyph = new Glyphs.TriangleGlyph(minPos, 5, 'S', 5, tier.browser.baseColors['I']);\n if (insertionLabels)\n glyph = new Glyphs.LabelledGlyph(canvas, glyph, feature.insertion || feature.altAlleles[0], false, 'center', 'above', '7px sans-serif');\n\n if ((maxPos - minPos) > 1) {\n let stroke = style.FGCOLOR || 'red';\n let fill = style.BGCOLOR || style.COLOR1 || 'green';\n let bg = new Glyphs.BoxGlyph(minPos, 5, (maxPos - minPos), height, fill, stroke);\n glyph = new Glyphs.GroupGlyph([bg, glyph]);\n }\n\n } else if (glyphType === '__NONE') {\n return null;\n\n } else if (glyphType === 'BOX') {\n let stroke = style.FGCOLOR || null;\n let fill = style.BGCOLOR || style.COLOR1 || 'green';\n if (style.BGITEM && feature.itemRgb)\n fill = feature.itemRgb;\n let scale = (maxPos - minPos) / (max - min);\n if (feature.type == 'translation' &&\n (feature.method == 'protein_coding' || feature.readframeExplicit) &&\n (!feature.tags || feature.tags.indexOf('cds_start_NF') < 0 || feature.readframeExplicit) &&\n (!tier.dasSource.collapseSuperGroups || tier.bumped) &&\n scale >= 0.5) {\n let refSeq = getRefSeq(tier, min, max);\n glyph = new Glyphs.AminoAcidGlyph(minPos,\n maxPos,\n height,\n fill,\n refSeq,\n feature.orientation,\n feature.readframe);\n } else {\n glyph = new Glyphs.BoxGlyph(minPos, 0, (maxPos - minPos),\n height, fill, stroke);\n }\n }\n\n if (!glyph)\n return;\n \n if ((isDasBooleanTrue(style.LABEL) || feature.forceLabel) &&\n label && !noLabel) {\n glyph = new Glyphs.LabelledGlyph(canvas, glyph, label, false);\n }\n\n if (bump) {\n glyph.bump = true;\n }\n\n glyph.feature = feature;\n\n if (isDasBooleanTrue(style[\"HIDEAXISLABEL\"]))\n quant = null;\n\n if (quant) {\n glyph.quant = quant;\n }\n\n if (style.ZINDEX) {\n glyph.zindex = style.ZINDEX | 0;\n }\n\n return glyph;\n}\n\n\nfunction groupFeatures(tier, canvas, y) {\n let glyphs = [];\n let gbsFeatures = {};\n let gbsStyles = {};\n let stackedFeatures = [];\n\n R.map(features => {\n features.forEach(feature => {\n let style = tier.styleForFeature(feature);\n\n if (feature.parts || !style)\n return;\n\n if (style.glyph === 'LINEPLOT') {\n pusho(gbsFeatures, style.id, feature);\n gbsStyles[style.id] = style;\n } else if (style.glyph === 'STACKED') {\n stackedFeatures.push(feature);\n } else {\n let glyph = glyphForFeature(canvas, feature, y, style, tier);\n if (glyph)\n glyphs.push(glyph);\n }\n });\n }, tier.ungroupedFeatures);\n\n if (stackedFeatures.length > 0) {\n glyphs = glyphs.concat(makeStackedBars(stackedFeatures, tier));\n }\n \n for (let gbs in gbsFeatures) {\n let gf = gbsFeatures[gbs];\n let style = gbsStyles[gbs];\n if (style.glyph === 'LINEPLOT') {\n let lineGraphGlyphs = makeLinePlot(gf, style, tier, y);\n lineGraphGlyphs.forEach(g => glyphs.push(g));\n }\n }\n\n return glyphs;\n}\n\nfunction glyphifyGroups(tier, canvas, glyphs, y) {\n let groupIds = Object.keys(tier.groupedFeatures);\n let groupGlyphs = {};\n\n groupIds.sort((g1, g2) =>\n tier.groupedFeatures[g2][0].score - tier.groupedFeatures[g1][0].score);\n\n\n groupIds.forEach(gId => {\n let glyphs = glyphsForGroup(canvas, tier.groupedFeatures[gId], y, tier.groups[gId], tier,\n (tier.dasSource.collapseSuperGroups && !tier.bumped) ?\n 'collapsed_gene' : 'tent');\n\n if (glyphs) {\n glyphs.group = tier.groups[gId];\n groupGlyphs[gId] = glyphs;\n }\n });\n\n return groupGlyphs;\n}\n\nfunction bumpSubtiers(tier, glyphs, grid, gridOffset, gridSpacing) {\n let subtierMax =\n tier.subtierMax ||\n tier.dasSource.subtierMax ||\n tier.browser.defaultSubtierMax;\n\n let subtiersExceeded = false;\n\n let unbumpedST = new SubTier();\n let bumpedSTs = [];\n\n // We want to add each glyph to either the subtier\n // containing unbumped subtiers, or to the first bumped subtier.\n glyphs.forEach(glyph => {\n // if the glyph is to be bumped...\n if (glyph.bump &&\n (tier.bumped ||\n tier.dasSource.collapseSuperGroups)) {\n\n let glyphTier = bumpedSTs.find(st => st.hasSpaceFor(glyph));\n\n if (glyphTier) {\n glyphTier.add(glyph);\n } else if (bumpedSTs.length >= subtierMax) {\n subtiersExceeded = true;\n } else {\n let subtier = new SubTier();\n subtier.add(glyph);\n bumpedSTs.push(subtier);\n }\n } else {\n unbumpedST.add(glyph);\n }\n });\n\n if (unbumpedST.glyphs.length > 0) {\n bumpedSTs = [unbumpedST].concat(bumpedSTs);\n }\n\n // Simple hack to make the horizontal grid in bumped subtiers (e.g. lineplots)\n // optional and configurable.\n if (grid) {\n bumpedSTs.forEach(subtier => {\n if (subtier.quant) {\n subtier.glyphs.unshift(new Glyphs.GridGlyph(subtier.height, gridOffset, gridSpacing));\n }\n });\n }\n\n bumpedSTs.forEach(subtier => {\n subtier.glyphs.sort((g1, g2) => (g1.zindex || 0) - (g2.zindex || 0));\n });\n\n return [bumpedSTs, subtiersExceeded];\n}\n\n// The whole tier is translated downward on its canvas by y pixels\nfunction prepareSubtiers(tier, canvas, y=0, grid=true) {\n\n let MIN_PADDING = 3;\n tier.padding = typeof(tier.dasSource.padding) === 'number' ?\n tier.dasSource.padding : MIN_PADDING;\n\n tier.scaleVertical = typeof(tier.dasSource.scaleVertical) === 'boolean' ?\n tier.dasSource.scaleVertical : false;\n\n let glyphs = groupFeatures(tier, canvas, y);\n\n // Merge supergroups\n if (tier.dasSource.collapseSuperGroups && !tier.bumped) {\n for (let sgId in tier.superGroups) {\n let sgGroup = tier.superGroups[sgId];\n tier.groups[sgId] = shallowCopy(tier.groups[sgId]);\n let group = tier.groups[sgId];\n group.isSuperGroup = true;\n let featuresByType = {};\n\n let sgMin = 10000000000, sgMax = -10000000000;\n let sgSeg = null;\n\n sgGroup.forEach((g, i) => {\n let groupedFeature = tier.groupedFeatures[sgGroup[i]];\n if (!groupedFeature)\n return;\n\n groupedFeature.forEach(feature => {\n pusho(featuresByType, feature.type, feature);\n sgMin = Math.min(feature.min, sgMin);\n sgMax = Math.max(feature.max, sgMax);\n if (feature.segment && !sgSeg)\n sgSeg = feature.segment;\n });\n\n if (group && !group.links || group.links.length === 0) {\n group.links = tier.groups[sgGroup[0]].links;\n }\n\n delete tier.groupedFeatures[sgGroup[i]];\n\n });\n\n tier.groups[sgId].max = sgMax;\n tier.groups[sgId].min = sgMin;\n tier.groups[sgId].segment = sgSeg;\n\n R.map(features => {\n\n let template = features[0];\n let loc = null;\n\n features.forEach(feature => {\n let fl = new Range(feature.min, feature.max);\n loc = loc ? union(loc, fl) : fl;\n });\n\n let mergedRanges = loc.ranges();\n\n mergedRanges.forEach(range => {\n let posCoverage = ((range.max() | 0) - (range.min() | 0) + 1) * sgGroup.length;\n let actCoverage = 0;\n\n features.forEach(feature => {\n let fmin = feature.min || 0;\n let fmax = feature.max || 0;\n if (fmin <= range.max() && fmax >= range.min()) {\n\n actCoverage += (Math.min(fmax, range.max()) -\n Math.max(fmin, range.min()) + 1);\n }\n });\n\n let newFeature = new DASFeature();\n for (let key in template) {\n newFeature[key] = template[key];\n }\n\n newFeature.min = range.min();\n newFeature.max = range.max();\n if (newFeature.label && sgGroup.length > 1) {\n newFeature.label += ' (' + sgGroup.length + ' vars)';\n }\n\n newFeature.visualWeight = ((1.0 * actCoverage) / posCoverage);\n\n pusho(tier.groupedFeatures, sgId, newFeature);\n });\n }, featuresByType);\n\n delete tier.superGroups[sgId]; // Do we want this?\n }\n }\n\n // Glyphify groups.\n let groupGlyphs = glyphifyGroups(tier, canvas, glyphs, y);\n\n R.map(superGroup => {\n let sgGlyphs = [];\n let sgMin = 10000000000;\n let sgMax = -10000000000;\n\n superGroup.forEach(glyphs => {\n let gGlyphs = groupGlyphs[glyphs];\n if (gGlyphs) {\n sgGlyphs.push(gGlyphs);\n sgMin = Math.min(sgMin, gGlyphs.min());\n sgMax = Math.max(sgMax, gGlyphs.max());\n }\n });\n\n sgGlyphs.forEach(glyph => {\n glyphs.push(new Glyphs.PaddedGlyph(glyph, sgMin, sgMax));\n });\n }, tier.superGroups);\n\n R.map(glyph => glyphs.push(glyph), groupGlyphs);\n\n let [subtiers, subtiersExceeded] = bumpSubtiers(tier, glyphs, grid, y);\n\n tier.glyphCacheOrigin = tier.browser.viewStart;\n\n if (subtiersExceeded)\n tier.updateStatus('Bumping limit exceeded, use the track editor to see more features');\n else\n tier.updateStatus();\n\n tier.subtiers = subtiers;\n}\n\n// Fills out areas that haven't been fetched as gray blocks\nfunction drawUnmapped(tier, canvas, padding) {\n let drawStart = tier.browser.viewStart - 1000.0/tier.browser.scale;\n let drawEnd = tier.browser.viewEnd + 1000.0/tier.browser.scale;\n let unmappedBlocks = [];\n if (tier.knownCoverage) {\n let knownRanges = tier.knownCoverage.ranges();\n knownRanges.forEach((range, index) => {\n if (index === 0) {\n if (range.min() > drawStart)\n unmappedBlocks.push({min: drawStart, max: range.min() - 1});\n } else {\n unmappedBlocks.push({min: knownRanges[index-1].max() + 1, max: range.min() - 1});\n }\n\n if (index == knownRanges.length - 1 && range.max() < drawEnd) {\n unmappedBlocks.push({min: range.max() + 1, max: drawEnd});\n }\n });\n }\n if (unmappedBlocks.length > 0) {\n canvas.fillStyle = 'gray';\n unmappedBlocks.forEach(block => {\n let min = (block.min - tier.browser.viewStart) * tier.browser.scale + 1000;\n let max = (block.max - tier.browser.viewStart) * tier.browser.scale + 1000;\n canvas.fillRect(min, 0, max - min, padding);\n });\n }\n}\n\nfunction clearViewport(canvas, width, height) {\n canvas.clearRect(0, 0, width, height);\n}\n\n// Make the viewport & canvas the correct size for the tier\nfunction prepareViewport(tier, canvas, retina, clear=true, vOffset=0) {\n let desiredWidth = tier.browser.featurePanelWidth + 2000;\n if (retina) {\n desiredWidth *= 2;\n }\n\n let fpw = tier.viewport.width|0;\n if (fpw < desiredWidth - 50) {\n tier.viewport.width = fpw = desiredWidth;\n }\n\n let lh = tier.padding + vOffset;\n\n tier.subtiers.forEach(s => lh += s.height + tier.padding);\n\n lh += 6;\n lh = Math.max(lh, tier.browser.minTierHeight);\n\n let canvasHeight = lh;\n if (retina) {\n canvasHeight *= 2;\n }\n\n if (canvasHeight != tier.viewport.height) {\n tier.viewport.height = canvasHeight;\n }\n\n tier.viewportHolder.style.left = '-1000px';\n tier.viewport.style.width = retina ? ('' + (fpw/2) + 'px') : ('' + fpw + 'px');\n tier.viewport.style.height = '' + lh + 'px';\n tier.layoutHeight = Math.max(lh, tier.browser.minTierHeight);\n\n tier.updateHeight();\n tier.norigin = tier.browser.viewStart;\n\n canvas.save();\n if (retina) {\n canvas.scale(2, 2);\n }\n\n if (clear) {\n clearViewport(canvas, fpw, canvasHeight);\n }\n\n drawUnmapped(tier, canvas, lh);\n\n}\n\nfunction paint(tier, canvas, vOffset=0) {\n let overlayLabelCanvas = new Glyphs.OverlayLabelCanvas();\n let offset = ((tier.glyphCacheOrigin - tier.browser.viewStart)*tier.browser.scale)+1000;\n canvas.translate(offset, vOffset + tier.padding);\n overlayLabelCanvas.translate(0, tier.padding);\n\n tier.paintToContext(canvas, overlayLabelCanvas, offset);\n\n if (overlayLabelCanvas.glyphs.length > 0)\n tier.overlayLabelCanvas = overlayLabelCanvas;\n else\n tier.overlayLabelCanvas = null;\n\n canvas.restore();\n}\n\nfunction getScoreMinMax(tier, style) {\n let smin = tier.quantMin(style);\n let smax = tier.quantMax(style);\n\n if (!smax) {\n if (smin < 0) {\n smax = 0;\n } else {\n smax = 10;\n }\n }\n if (!smin) {\n smin = 0;\n }\n return [smin, smax];\n}\n\nfunction relScoreOrigin(score, smin, smax) {\n let relScore = ((1.0 * score) - smin) / (smax-smin);\n let relOrigin = (-1.0 * smin) / (smax - smin);\n\n return [relScore, relOrigin];\n}\n\nfunction getRefSeq(tier, min, max) {\n let refSeq = null;\n if (tier.currentSequence) {\n let csStart = tier.currentSequence.start|0;\n let csEnd = tier.currentSequence.end|0;\n if (csStart <= max && csEnd >= min) {\n let sfMin = Math.max(min, csStart);\n let sfMax = Math.min(max, csEnd);\n\n refSeq = tier.currentSequence.seq.substr(sfMin - csStart, sfMax - sfMin + 1);\n while (min < sfMin) {\n refSeq = 'N' + refSeq;\n sfMin--;\n }\n while (max > sfMax) {\n refSeq = refSeq + 'N';\n sfMax++;\n }\n }\n }\n return refSeq;\n}\n\nfunction featureToCrossLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight, noLabel) {\n let scale = tier.browser.scale;\n let origin = tier.browser.viewStart;\n\n let score = feature.score;\n let label = feature.label || feature.id;\n\n let minPos = (feature.min - origin) * scale;\n let maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n let height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n let requiredHeight = height;\n\n let glyph = null;\n let quant = null;\n\n let stroke = style.FGCOLOR || 'black';\n let fill = style.BGCOLOR || 'none';\n let outline = style.STROKECOLOR;\n\n if (style.BGITEM && feature.itemRgb) {\n stroke = feature.itemRgb;\n\n } else if (isDasBooleanTrue(style.COLOR_BY_SCORE2)) {\n let grad = style.BGGRAD || style._gradient;\n if (!grad) {\n grad = makeGradient(50, style.COLOR1, style.COLOR2, style.COLOR3);\n style._gradient = grad;\n }\n\n let score2 = feature.score2;\n if (score2 !== undefined || !stroke) {\n score2 = score2 || 0;\n\n let smin2 = style.MIN2 ? (1.0 * style.MIN2) : 0.0;\n let smax2 = style.MAX2 ? (1.0 * style.MAX2) : 1.0;\n let relScore2 = ((1.0 * score2) - smin2) / (smax2-smin2);\n\n let step = (relScore2*grad.length) | 0;\n R.clamp(0, step, grad.length - 1);\n stroke = grad[step];\n }\n }\n\n let size = style.SIZE || height;\n if (style.RSIZE) {\n size = (1.0 * style.RSIZE) * height;\n }\n\n if (style.STROKETHRESHOLD) {\n if (size < (1.0 * style.STROKETHRESHOLD))\n outline = null;\n }\n\n let mid = (minPos + maxPos)/2;\n\n if (glyphType === 'EX') {\n glyph = new Glyphs.ExGlyph(mid, size, stroke);\n\n } else if (glyphType === 'TRIANGLE') {\n let dir = style.DIRECTION || 'N';\n let width = style.LINEWIDTH || size;\n glyph = new Glyphs.TriangleGlyph(mid, size, dir, width, stroke, outline);\n\n } else if (glyphType === 'DOT') {\n glyph = new Glyphs.DotGlyph(mid, size, stroke, outline);\n\n } else if (glyphType === 'PLIMSOLL') {\n glyph = new Glyphs.PlimsollGlyph(mid, size, 0.2 * size, stroke, outline);\n\n } else if (glyphType === 'SQUARE') {\n glyph = new Glyphs.BoxGlyph(mid - size/2, 0, size, size, stroke, outline);\n\n } else if (glyphType === 'STAR') {\n let points = style.POINTS || 5;\n glyph = new Glyphs.StarGlyph(mid, size/2, points, stroke, outline);\n\n } else {\n glyph = new Glyphs.CrossGlyph(mid, size, stroke);\n\n }\n\n if (fill && fill !== 'none' && (maxPos - minPos) > 5) {\n let boxGlyph = new Glyphs.BoxGlyph(minPos, 0, (maxPos - minPos), size, fill);\n glyph = new Glyphs.GroupGlyph([boxGlyph, glyph]);\n }\n\n if (isDasBooleanTrue(style.SCATTER)) {\n let [smin, smax] = getScoreMinMax(tier, style);\n\n let [relScore, relOrigin] = relScoreOrigin(score, smin, smax);\n\n if (relScore < 0.0 || relScore > 1.0) {\n // Glyph is out of bounds.\n // Should we allow for \"partially showing\" glyphs?\n\n return null;\n } else {\n let originShift = x => (x - relOrigin) * requiredHeight;\n height = Math.max(1, originShift(relScore));\n y = y + originShift(1);\n\n if (relScore >= relOrigin)\n y = y - height;\n\n quant = {min: smin, max: smax};\n\n let heightFudge = 0;\n let featureLabel = R.defaultTo(style.LABEL, feature.forceLabel);\n\n if (isDasBooleanNotFalse(featureLabel) && label && !noLabel) {\n glyph = new Glyphs.LabelledGlyph(canvas, glyph, label, true, null,\n featureLabel == 'above' ? 'above' : 'below');\n if (featureLabel === 'above') {\n heightFudge = glyph.textHeight + 2;\n }\n noLabel = true;\n }\n glyph = new Glyphs.TranslatedGlyph(glyph, 0, y - (size / 2) - heightFudge, requiredHeight);\n }\n }\n\n return [glyph, quant];\n}\n\nfunction featureToGradientLikeGlyph(canvas, tier, feature, y, glyphType, style, forceHeight) {\n let scale = tier.browser.scale;\n let origin = tier.browser.viewStart;\n\n let score = feature.score;\n\n let minPos = (feature.min - origin) * scale;\n let maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n let height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n let requiredHeight = height * 1.0;\n\n let glyph = null;\n let quant = null;\n\n let centerOnAxis = isDasBooleanTrue(style[\"AXISCENTER\"]);\n\n\n let [smin, smax] = getScoreMinMax(tier, style);\n\n // AUTOMIN & AUTOMAX respectively set the lower and upper bounds\n if (isDasBooleanTrue(style.AUTOMIN)) {\n smin = tier.currentFeaturesMinScore*0.95;\n console.log(\"smin:\\t\" + smin);\n }\n if (isDasBooleanTrue(style.AUTOMAX)) {\n smax = tier.currentFeaturesMaxScore*1.05;\n console.log(\"smax:\\t\" + smax);\n }\n\n if ((1.0 * score) < (1.0 * smin)) {\n score = smin;\n }\n if ((1.0 * score) > (1.0 * smax)) {\n score = smax;\n }\n\n // Shift smin/smax in case we want to center the histogram\n // on the horizontal axis\n if (centerOnAxis) {\n let tmin = tier.quantMin(style);\n let tmax = tier.quantMax(style);\n\n if (isDasBooleanTrue(style.AUTOMIN)) {\n tmin = tier.currentFeaturesMinScore*0.95;\n }\n if (isDasBooleanTrue(style.AUTOMAX)) {\n tmax = tier.currentFeaturesMaxScore*1.05;\n }\n\n smin = tmin - ((tmax - tmin) / 2);\n smax = tmax - ((tmax - tmin) / 2);\n }\n\n let [relScore, relOrigin] = relScoreOrigin(score, smin, smax);\n\n if (glyphType === 'HISTOGRAM') {\n let originShift = x => x - Math.max(0, relOrigin);\n height = Math.abs(originShift(relScore)) * requiredHeight;\n y = y + originShift(1.0) * requiredHeight;\n\n if (relScore >= relOrigin)\n y -= height;\n\n if (centerOnAxis)\n y += height / 2;\n\n if (isDasBooleanTrue(style[\"HIDEAXISLABEL\"]))\n quant = null;\n else\n quant = {min: smin, max: smax};\n }\n\n let stroke = style.FGCOLOR || null;\n let fill = style.BGCOLOR || style.COLOR1 || 'green';\n if (style.BGITEM && feature.itemRgb)\n fill = feature.itemRgb;\n let alpha = style.ALPHA ? (1.0 * style.ALPHA) : null;\n\n if (style.BGGRAD) {\n let grad = style.BGGRAD;\n let step = (relScore*grad.length)|0;\n step = R.clamp(0, step, grad.length - 1);\n fill = grad[step];\n }\n\n if (style.COLOR2) {\n let grad = style._gradient;\n if (!grad) {\n grad = makeGradient(50, style.COLOR1, style.COLOR2, style.COLOR3);\n style._gradient = grad;\n }\n\n let step = (relScore*grad.length) | 0;\n step = R.clamp(0, step, grad.length - 1);\n fill = grad[step];\n }\n\n let tempGlyph = new Glyphs.BoxGlyph(minPos, y, (maxPos - minPos), height, fill, stroke, alpha);\n glyph = new Glyphs.TranslatedGlyph(tempGlyph, 0, 0, requiredHeight);\n\n return [glyph, quant];\n}\n\nfunction featureToPointGlyph(tier, feature, style) {\n let scale = tier.browser.scale;\n let origin = tier.browser.viewStart;\n\n let score = feature.score;\n\n let minPos = (feature.min - origin) * scale;\n let maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n let height = tier.forceHeight || style.HEIGHT || 30;\n\n let glyph = null;\n let quant = null;\n\n let [smin, smax] = getScoreMinMax(tier, style);\n let yscale = ((1.0 * height) / (smax - smin));\n let relScore = ((1.0 * score) - smin) / (smax-smin);\n let sc = ((score - (1.0*smin)) * yscale)|0;\n quant = {min: smin, max: smax};\n\n let fill = style.FGCOLOR || style.COLOR1 || 'black';\n if (style.COLOR2) {\n let grad = style._gradient;\n if (!grad) {\n grad = makeGradient(50, style.COLOR1, style.COLOR2, style.COLOR3);\n style._gradient = grad;\n }\n\n let step = (relScore*grad.length)|0;\n step = R.clamp(0, step, grad.length - 1);\n fill = grad[step];\n }\n\n glyph = new Glyphs.PointGlyph((minPos + maxPos)/2, height-sc, height, fill);\n\n return [glyph, quant];\n}\n\nfunction sequenceGlyph(canvas, tier, feature, style, forceHeight) {\n let scale = tier.browser.scale;\n let origin = tier.browser.viewStart;\n\n let min = feature.min;\n let max = feature.max;\n let minPos = (feature.min - origin) * scale;\n let maxPos = Math.max((feature.max - origin + 1) * scale, minPos + 1);\n\n let height = (tier.forceHeight || style.HEIGHT || forceHeight || 12) * 1.0;\n\n let glyph = null;\n\n let rawseq = feature.seq;\n let seq = rawseq;\n let rawquals = feature.quals;\n let quals = rawquals;\n let insertionLabels = isDasBooleanTrue(style.__INSERTIONS);\n\n let indels = [];\n if (feature.cigar) {\n let ops = parseCigar(feature.cigar);\n seq = '';\n quals = '';\n let cursor = 0;\n\n ops.forEach(co => {\n if (co.op === 'M') {\n seq += rawseq.substr(cursor, co.cnt);\n quals += rawquals.substr(cursor, co.cnt);\n cursor += co.cnt;\n } else if (co.op === 'D') {\n seq += \"-\".repeat(co.cnt);\n quals += \"Z\".repeat(co.cnt);\n } else if (co.op === 'I') {\n let inseq = rawseq.substr(cursor, co.cnt);\n let ig = new Glyphs.TranslatedGlyph(\n new Glyphs.TriangleGlyph(minPos + (seq.length*scale), 6, 'S', 5, tier.browser.baseColors['I']),\n 0, -2, 0\n );\n if (insertionLabels)\n ig = new Glyphs.LabelledGlyph(canvas, ig, inseq, false, 'center', 'above', '7px sans-serif');\n ig.feature = {label: 'Insertion: ' + inseq, type: 'insertion', method: 'insertion'};\n indels.push(ig);\n\n cursor += co.cnt;\n } else if (co.op === 'S') {\n cursor += co.cnt;\n } else {\n console.log('unknown cigop' + co.op);\n }\n });\n }\n\n let refSeq = getRefSeq(tier, min, max);\n if (seq && refSeq &&\n (style.__SEQCOLOR === 'mismatch' ||\n style.__SEQCOLOR === 'mismatch-all')) {\n let mismatchSeq = [];\n let match = feature.orientation === '-' ? ',' : '.';\n for (let i = 0; i < seq.length; ++i) {\n mismatchSeq.push(seq[i] == refSeq[i] ? match : seq[i]);\n }\n seq = mismatchSeq.join('');\n }\n\n let strandColor = feature.orientation === '-' ?\n style._minusColor || 'lightskyblue'\n : style._plusColor || 'lightsalmon';\n\n if (style.__disableQuals)\n quals = false;\n\n glyph = new Glyphs.SequenceGlyph(\n tier.browser.baseColors,\n strandColor,\n minPos,\n maxPos,\n height,\n seq,\n refSeq,\n style.__SEQCOLOR,\n quals,\n !isDasBooleanTrue(style.__CLEARBG),\n tier.scaleVertical\n );\n\n if (insertionLabels)\n glyph = new Glyphs.TranslatedGlyph(glyph, 0, 7);\n\n if (indels.length > 0) {\n indels.splice(0, 0, glyph);\n glyph = new Glyphs.GroupGlyph(indels);\n }\n\n return glyph;\n}\n\nfunction makeLinePlot(features, style, tier, yshift) {\n yshift = yshift || 0;\n\n let origin = tier.browser.viewStart, scale = tier.browser.scale;\n let height = tier.forceHeight || style.HEIGHT || 30;\n let min = tier.quantMin(style);\n let max = tier.quantMax(style);\n\n // AUTOMIN & AUTOMAX respectively set the lower and upper bounds\n if (isDasBooleanTrue(style.AUTOMIN)) {\n // add some basically arbitrary padding\n min = tier.currentFeaturesMinScore*0.95;\n }\n if (isDasBooleanTrue(style.AUTOMAX)) {\n max = tier.currentFeaturesMaxScore*1.05;\n }\n\n let yscale = ((1.0 * height) / (max - min));\n let color = style.FGCOLOR || style.COLOR1 || 'black';\n\n let prevSign = 1;\n let curSign = null;\n\n let curGlyphPoints = [];\n let glyphSequences = [];\n\n let prevPoint = null;\n\n features.forEach(f => {\n let px = ((((f.min|0) + (f.max|0)) / 2) - origin) * scale;\n let sc = ((f.score - (1.0*min)) * yscale)|0;\n\n // Additive tracks are always above the x-axis, and are colored\n // depending on whether the score is positive or negative.\n if (isDasBooleanTrue(style.ADDITIVE)) {\n curSign = f.score < 0 ? -1 : 1;\n\n if (curSign !== prevSign) {\n glyphSequences.push({\n points: curGlyphPoints,\n color: prevSign === 1 ?\n style.POSCOLOR\n : style.NEGCOLOR\n });\n curGlyphPoints = [];\n // Need to add the previous point to this sequence,\n // otherwise there is a gap in the resulting plot\n curGlyphPoints.push(prevPoint);\n }\n prevSign = curSign;\n } else {\n curSign = 1;\n }\n\n let py = (height - (sc * curSign)) + yshift;\n prevPoint = {x: px, y: py};\n curGlyphPoints.push(prevPoint);\n });\n\n\n // Need to add the final sequence of points as well.\n if (isDasBooleanTrue(style.ADDITIVE)) {\n color = curSign === 1 ? style.POSCOLOR : style.NEGCOLOR;\n }\n glyphSequences.push({\n points: curGlyphPoints,\n color: color\n });\n\n\n let lggs = glyphSequences.map(gs => {\n let lgg = new Glyphs.LineGraphGlyph(gs.points, gs.color, height);\n lgg.quant = {min, max};\n\n if (style.ZINDEX)\n lgg.zindex = style.ZINDEX|0;\n\n return lgg;\n });\n\n return lggs;\n}\n\nfunction makeStackedBars(features, tier) {\n let glyphs = [];\n\n let posStacks = [],\n negStacks = [];\n\n const scale = tier.browser.scale, origin = tier.browser.viewStart;\n for (var fi = 0; fi < features.length; ++fi) {\n const feature = features[fi];\n const style = tier.styleForFeature(feature);\n let score = feature.score * 1.0;\n\n let height = tier.forceHeight || style.HEIGHT || 12;\n const requiredHeight = height = 1.0 * height;\n\n const min = feature.min;\n const max = feature.max;\n\n const minPos = (min - origin) * scale;\n const rawMaxPos = ((max - origin + 1) * scale);\n const maxPos = Math.max(rawMaxPos, minPos + 1);\n\n // This should somewhat match the 'HISTOGRAM' path.\n\n var smin = tier.quantMin(style);\n var smax = tier.quantMax(style);\n\n if (!smax) {\n if (smin < 0) {\n smax = 0;\n } else {\n smax = 10;\n }\n } else {\n smax = smax * 1.0;\n }\n\n if (!smin) {\n smin = 0;\n } else {\n smin = smin * 1.0;\n }\n\n var stackOrigin;\n if (score >= 0) {\n stackOrigin = posStacks[min] || 0;\n posStacks[min] = stackOrigin + score;\n } else {\n stackOrigin = negStacks[min] || 0;\n negStacks[min] = stackOrigin + score;\n }\n\n if (stackOrigin > smax || stackOrigin < smin) {\n // Stack has extended outside of range.\n continue;\n }\n\n if (stackOrigin + score < smin) {\n score = smin - stackOrigin;\n }\n if (stackOrigin + score > smax) {\n score = smax - stackOrigin;\n }\n\n var relScoreEnd = (score + stackOrigin - smin) / (smax - smin);\n var relScoreStart = (stackOrigin - smin) / (smax - smin)\n var relScoreMax = Math.max(relScoreStart, relScoreEnd);\n var relScoreMin = Math.min(relScoreStart, relScoreEnd);\n\n height = (relScoreMax - relScoreMin) * requiredHeight;\n var y = (1.0 - relScoreMax) * requiredHeight;\n\n let stroke = style.FGCOLOR || null;\n let fill = style.BGCOLOR || style.COLOR1 || 'green';\n if (style.BGITEM && feature.itemRgb)\n fill = feature.itemRgb;\n const alpha = style.ALPHA ? (1.0 * style.ALPHA) : null;\n\n let gg = new Glyphs.BoxGlyph(minPos, y, (maxPos - minPos), height, fill, stroke, alpha);\n gg = new Glyphs.TranslatedGlyph(gg, 0, 0, requiredHeight);\n gg.feature = feature;\n gg.quant = {\n min: smin, max: smax\n };\n if (style.ZINDEX) {\n gg.zindex = style.ZINDEX | 0;\n }\n glyphs.push(gg);\n\n }\n return glyphs;\n}\n\n// height is subtier height\nfunction createQuantOverlay(tier, height, retina=false) {\n let width = 50;\n\n tier.quantOverlay.height = height;\n tier.quantOverlay.width = retina ? width*2 : width;\n tier.quantOverlay.style.height = '' + (retina ? height/2 : height) + 'px';\n tier.quantOverlay.style.width = '' + width + 'px';\n tier.quantOverlay.style.display = 'block';\n\n let canvas = tier.quantOverlay.getContext('2d');\n\n if (retina) {\n canvas.scale(2, 2);\n }\n\n return canvas;\n}\n\nfunction paintQuant(canvas, tier, quant, tics) {\n canvas.save();\n\n let h = tier.quantOverlay.height;\n let w = 100;\n\n let ticSpacing = (h + tier.padding*2) / tics;\n let ticInterval = (quant.max - quant.min) / tics;\n\n canvas.fillStyle = 'white';\n canvas.globalAlpha = 0.6;\n if (tier.browser.rulerLocation == 'right') {\n canvas.fillRect(w-30, 0, 30, h + tier.padding*2);\n } else {\n canvas.fillRect(0, 0, 30, h + tier.padding*2);\n }\n canvas.globalAlpha = 1.0;\n\n canvas.strokeStyle = 'black';\n canvas.lineWidth = 1;\n canvas.beginPath();\n if (tier.browser.rulerLocation == 'right') {\n canvas.moveTo(w - 8, tier.padding);\n canvas.lineTo(w, tier.padding);\n canvas.lineTo(w, h + tier.padding);\n canvas.lineTo(w - 8, h + tier.padding);\n\n for (let t = 1; t < tics-1; t++) {\n let ty = t*ticSpacing;\n canvas.moveTo(w, ty);\n canvas.lineTo(w - 5, ty);\n }\n } else {\n canvas.moveTo(8, tier.padding);\n canvas.lineTo(0, tier.padding);\n canvas.lineTo(0, h + tier.padding);\n canvas.lineTo(8, h + tier.padding);\n\n for (let t = 1; t < tics-1; t++) {\n let ty = t*ticSpacing;\n canvas.moveTo(0, ty);\n canvas.lineTo(5, ty);\n }\n }\n canvas.stroke();\n\n canvas.fillStyle = 'black';\n\n if (tier.browser.rulerLocation == 'right') {\n canvas.textAlign = 'right';\n canvas.fillText(formatQuantLabel(quant.max), w-9, 8);\n canvas.fillText(formatQuantLabel(quant.min), w-9, h + tier.padding);\n\n for (let t = 1; t < tics-1; t++) {\n let ty = t*ticSpacing;\n canvas.fillText(formatQuantLabel((1.0*quant.max) - (t*ticInterval)), w - 9, ty + 3);\n }\n } else {\n canvas.textAlign = 'left';\n canvas.fillText(formatQuantLabel(quant.max), 9, 8);\n canvas.fillText(formatQuantLabel(quant.min), 9, h + tier.padding);\n\n for (let t = 1; t < tics-1; t++) {\n let ty = t*ticSpacing;\n canvas.fillText(formatQuantLabel((1.0*quant.max) - (t*ticInterval)), 9, ty + 3);\n }\n }\n\n canvas.restore();\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// domui.js: SVG UI components\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n}\n\nBrowser.prototype.removeAllPopups = function() {\n removeChildren(this.hPopupHolder);\n removeChildren(this.popupHolder);\n}\n\nBrowser.prototype.makeTooltip = function(ele, text)\n{\n var isin = false;\n var thisB = this;\n var timer = null;\n var outlistener;\n outlistener = function(ev) {\n isin = false;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n ele.removeEventListener('mouseout', outlistener, false);\n };\n\n var setup = function(ev) {\n var mx = ev.clientX + window.scrollX, my = ev.clientY + window.scrollY;\n if (!timer) {\n timer = setTimeout(function() {\n var ttt;\n if (typeof(text) === 'function') {\n ttt = text();\n } else {\n ttt = text;\n }\n\n var popup = makeElement('div',\n [makeElement('div', null, {className: 'tooltip-arrow'}),\n makeElement('div', ttt, {className: 'tooltip-inner'})], \n {className: 'tooltip bottom in'}, {\n display: 'block',\n top: '' + (my + 20) + 'px',\n left: '' + Math.max(mx - 30, 20) + 'px'\n });\n thisB.hPopupHolder.appendChild(popup);\n var moveHandler;\n moveHandler = function(ev) {\n try {\n thisB.hPopupHolder.removeChild(popup);\n } catch (e) {\n // May have been removed by other code which clears the popup layer.\n }\n window.removeEventListener('mousemove', moveHandler, false);\n if (isin) {\n if (ele.offsetParent == null) {\n } else {\n setup(ev);\n }\n }\n }\n window.addEventListener('mousemove', moveHandler, false);\n timer = null;\n }, 1000);\n }\n };\n\n ele.addEventListener('mouseover', function(ev) {\n isin = true\n ele.addEventListener('mouseout', outlistener, false);\n setup(ev);\n }, false);\n ele.addEventListener('DOMNodeRemovedFromDocument', function(ev) {\n isin = false;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }, false);\n}\n\nBrowser.prototype.popit = function(ev, name, ele, opts)\n{\n var thisB = this;\n if (!opts) \n opts = {};\n if (!ev) \n ev = {};\n\n var width = opts.width || 200;\n\n var mx, my;\n\n if (ev.clientX) {\n var mx = ev.clientX, my = ev.clientY;\n } else {\n mx = 500; my= 50;\n }\n mx += document.documentElement.scrollLeft || document.body.scrollLeft;\n my += document.documentElement.scrollTop || document.body.scrollTop;\n var winWidth = window.innerWidth;\n\n var top = my;\n var left = Math.min(mx - (width/2) - 4, (winWidth - width - 30));\n\n var popup = makeElement('div');\n popup.className = 'popover fade ' + (ev.clientX ? 'bottom ' : '') + 'in';\n popup.style.display = 'block';\n popup.style.position = 'absolute';\n popup.style.top = '' + top + 'px';\n popup.style.left = '' + left + 'px';\n popup.style.width = width + 'px';\n if (width > 276) {\n // HACK Bootstrappification...\n popup.style.maxWidth = width + 'px';\n }\n\n popup.appendChild(makeElement('div', null, {className: 'arrow'}));\n\n if (name) {\n var closeButton = makeElement('button', '', {className: 'close'});\n closeButton.innerHTML = '×'\n\n closeButton.addEventListener('mouseover', function(ev) {\n closeButton.style.color = 'red';\n }, false);\n closeButton.addEventListener('mouseout', function(ev) {\n closeButton.style.color = 'black';\n }, false);\n closeButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n thisB.removeAllPopups();\n }, false);\n var tbar = makeElement('h4', [makeElement('span', name, null, {maxWidth: '200px'}), closeButton], {/*className: 'popover-title' */}, {paddingLeft: '10px', paddingRight: '10px'});\n\n var dragOX, dragOY;\n var moveHandler, upHandler;\n moveHandler = function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n left = left + (ev.clientX - dragOX);\n if (left < 8) {\n left = 8;\n } if (left > (winWidth - width - 32)) {\n left = (winWidth - width - 26);\n }\n top = top + (ev.clientY - dragOY);\n top = Math.max(10, top);\n popup.style.top = '' + top + 'px';\n popup.style.left = '' + Math.min(left, (winWidth - width - 10)) + 'px';\n dragOX = ev.clientX; dragOY = ev.clientY;\n }\n upHandler = function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n window.removeEventListener('mousemove', moveHandler, false);\n window.removeEventListener('mouseup', upHandler, false);\n }\n tbar.addEventListener('mousedown', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n dragOX = ev.clientX; dragOY = ev.clientY;\n window.addEventListener('mousemove', moveHandler, false);\n window.addEventListener('mouseup', upHandler, false);\n }, false);\n \n\n popup.appendChild(tbar);\n }\n\n popup.appendChild(makeElement('div', ele, {className: 'popover-content'}, {\n padding: '0px'\n }));\n this.hPopupHolder.appendChild(popup);\n\n var popupHandle = {\n node: popup,\n displayed: true\n };\n popup.addEventListener('DOMNodeRemoved', function(ev) {\n if (ev.target == popup) {\n popupHandle.displayed = false;\n }\n }, false);\n return popupHandle;\n}\n\nfunction makeTreeTableSection(title, content, visible) {\n var ttButton = makeElement('i');\n function update() {\n if (visible) {\n ttButton.className = 'fa fa-caret-down';\n content.style.display = 'table';\n } else {\n ttButton.className = 'fa fa-caret-right';\n content.style.display = 'none';\n }\n }\n update();\n\n ttButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n visible = !visible;\n update();\n }, false);\n\n var heading = makeElement('h6', [ttButton, ' ', title], {}, {display: 'block', background: 'gray', color: 'white', width: '100%', padding: '5px 2px', margin: '0px'});\n return makeElement('div', [heading, content], {});\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n makeTreeTableSection: makeTreeTableSection\n };\n}\n","/* jshint esversion: 6 */\n\"use strict\";\n\nimport * as DefaultRenderer from \"./default-renderer\";\n\nexport { renderTier, drawTier };\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\nfunction drawTier(tier) {\n let canvas = tier.viewport.getContext(\"2d\");\n let retina = tier.browser.retina && window.devicePixelRatio > 1;\n if (retina) {\n canvas.scale(2, 2);\n }\n\n let features = tier.currentFeatures;\n let sequence = tier.currentSequence;\n if (tier.sequenceSource) {\n DefaultRenderer.drawSeqTier(tier, sequence);\n } else if (features) {\n DefaultRenderer.prepareSubtiers(tier, canvas);\n } else {\n console.log(\"No sequence or features in tier!\");\n }\n\n if (tier.subtiers) {\n DefaultRenderer.prepareViewport(tier, canvas, retina, true);\n }\n\n tier.drawOverlay();\n tier.paintQuant();\n\n if (typeof(tier.dasSource.drawCallback) === \"function\") {\n tier.dasSource.drawCallback(canvas, tier);\n }\n\n tier.originHaxx = 0;\n tier.browser.arrangeTiers();\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// encode.js: interface for ENCODE DCC services\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var Promise = require('es6-promise').Promise;\n}\n\nfunction lookupEncodeURI(uri, json) {\n if (uri.indexOf('?') < 0)\n uri = uri + '?soft=true';\n\n return new Promise(function(accept, reject) {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status >= 300) {\n reject('Error code ' + req.status);\n } else {\n var resp = JSON.parse(req.response);\n accept(json ? resp : resp.location);\n }\n }\n };\n \n req.open('GET', uri, true);\n req.setRequestHeader('Accept', 'application/json');\n req.responseType = 'text';\n req.send();\n });\n}\n\nfunction EncodeURLHolder(url) {\n this.rawurl = url;\n}\n\nEncodeURLHolder.prototype.getURLPromise = function() {\n if (this.urlPromise && this.urlPromiseValidity > Date.now()) {\n return this.urlPromise;\n } else {\n this.urlPromise = lookupEncodeURI(this.rawurl, true).then(function(resp) {\n return resp.location;\n });\n this.urlPromiseValidity = Date.now() + (12 * 3600 * 1000);\n return this.urlPromise;\n }\n}\n\nfunction EncodeFetchable(url, start, end, opts) {\n if (!opts) {\n if (typeof start === 'object') {\n opts = start;\n start = undefined;\n } else {\n opts = {};\n }\n }\n\n this.url = (typeof url === 'string' ? new EncodeURLHolder(url) : url);\n this.start = start || 0;\n if (end) {\n this.end = end;\n }\n this.opts = opts;\n}\n\n\n\nEncodeFetchable.prototype.slice = function(s, l) {\n if (s < 0) {\n throw 'Bad slice ' + s;\n }\n\n var ns = this.start, ne = this.end;\n if (ns && s) {\n ns = ns + s;\n } else {\n ns = s || ns;\n }\n if (l && ns) {\n ne = ns + l - 1;\n } else {\n ne = ne || l - 1;\n }\n return new EncodeFetchable(this.url, ns, ne, this.opts);\n}\n\nEncodeFetchable.prototype.fetchAsText = function(callback) {\n var self = this;\n var req = new XMLHttpRequest();\n var length;\n self.url.getURLPromise().then(function(url) {\n req.open('GET', url, true);\n\n if (self.end) {\n if (self.end - self.start > 100000000) {\n throw 'Monster fetch!';\n }\n req.setRequestHeader('Range', 'bytes=' + self.start + '-' + self.end);\n length = self.end - self.start + 1;\n }\n\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status == 200 || req.status == 206) {\n return callback(req.responseText);\n } else {\n return callback(null);\n }\n }\n };\n if (self.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n }).catch(function(err) {\n console.log(err);\n return callback(null);\n });\n}\n\nEncodeFetchable.prototype.salted = function() {\n return this;\n}\n\nEncodeFetchable.prototype.fetch = function(callback, attempt, truncatedLength) {\n var self = this;\n\n attempt = attempt || 1;\n if (attempt > 3) {\n return callback(null);\n }\n\n self.url.getURLPromise().then(function (url) {\n var req = new XMLHttpRequest();\n var length;\n req.open('GET', url, true);\n req.overrideMimeType('text/plain; charset=x-user-defined');\n if (self.end) {\n if (self.end - self.start > 100000000) {\n throw 'Monster fetch!';\n }\n req.setRequestHeader('Range', 'bytes=' + self.start + '-' + self.end);\n length = self.end - self.start + 1;\n }\n req.responseType = 'arraybuffer';\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status == 200 || req.status == 206) {\n if (req.response) {\n var bl = req.response.byteLength;\n if (length && length != bl && (!truncatedLength || bl != truncatedLength)) {\n return self.fetch(callback, attempt + 1, bl);\n } else {\n return callback(req.response);\n }\n } else if (req.mozResponseArrayBuffer) {\n return callback(req.mozResponseArrayBuffer);\n } else {\n var r = req.responseText;\n if (length && length != r.length && (!truncatedLength || r.length != truncatedLength)) {\n return self.fetch(callback, attempt + 1, r.length);\n } else {\n return callback(bstringToBuffer(req.responseText));\n }\n }\n } else {\n return self.fetch(callback, attempt + 1);\n }\n }\n };\n if (self.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n }).catch(function(err) {\n console.log(err);\n });\n}\n\nfunction bstringToBuffer(result) {\n if (!result) {\n return null;\n }\n\n var ba = new Uint8Array(result.length);\n for (var i = 0; i < ba.length; ++i) {\n ba[i] = result.charCodeAt(i);\n }\n return ba.buffer;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n lookupEncodeURI: lookupEncodeURI,\n EncodeFetchable: EncodeFetchable\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// ensembljson.js -- query the Ensembl REST API.\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n}\n\nfunction EnsemblFeatureSource(source) {\n FeatureSourceBase.call(this);\n this.source = source;\n this.base = source.uri || '//rest.ensembl.org';\n if (this.base.indexOf('//') === 0) {\n var proto = window.location.protocol;\n if (proto == 'http:' || proto == 'https:') {\n // Protocol-relative URLs okay.\n } else {\n this.base = 'http:' + this.base;\n }\n }\n this.species = source.species || 'human';\n\n if (typeof source.type === 'string') {\n this.type = [source.type];\n } else {\n this.type = source.type || ['regulatory'];\n }\n}\n\nEnsemblFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\nEnsemblFeatureSource.prototype.constructor = EnsemblFeatureSource;\n\nEnsemblFeatureSource.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n\n var tsStyle = new DASStyle();\n tsStyle.glyph = '__NONE';\n if (this.type.indexOf('exon') >= 0)\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n if (this.type.indexOf('exon') >= 0 || this.type.indexOf('transcript') >= 0)\n stylesheet.pushStyle({type: 'gene'}, null, tsStyle);\n\n var cdsStyle = new DASStyle();\n cdsStyle.glyph = 'BOX';\n cdsStyle.FGCOLOR = 'black';\n cdsStyle.BGCOLOR = 'red'\n cdsStyle.HEIGHT = 8;\n cdsStyle.BUMP = true;\n cdsStyle.LABEL = true;\n cdsStyle.ZINDEX = 10;\n stylesheet.pushStyle({type: 'cds'}, null, cdsStyle);\n\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'SQUARE';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n // varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({type: 'variation', method: '.+_UTR_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TRIANGLE';\n varStyle.DIRECTION = 'S';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n // varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({type: 'variation', method: 'missense_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TRIANGLE';\n varStyle.DIRECTION = 'N';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n // varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({type: 'variation', method: 'splice_.+_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'STAR';\n varStyle.POINTS = 6;\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n // varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({type: 'variation', method: 'regulatory_region_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n // varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'rgb(50,80,255)';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({type: 'variation'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'SQUARE';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({type: 'indel', method: '.+_UTR_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TRIANGLE';\n varStyle.DIRECTION = 'S';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({type: 'indel', method: 'missense_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TRIANGLE';\n varStyle.DIRECTION = 'N';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({type: 'indel', method: 'splice_.+_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'STAR';\n varStyle.POINTS = 6;\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({type: 'indel', method: 'regulatory_region_variant'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.BGCOLOR = '#888888';\n varStyle.FGCOLOR = 'red';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({type: 'indel'}, null, varStyle);\n }\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'orange'\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n return callback(stylesheet);\n}\n\n\nEnsemblFeatureSource.prototype.getScales = function() {\n return [];\n}\n\nEnsemblFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n var url = this.base + '/overlap/region/' + this.species + '/' + chr + ':' + min + '-' + max;\n\n var filters = [];\n for (var ti = 0; ti < this.type.length; ++ti) {\n filters.push('feature=' + this.type[ti]);\n }\n filters.push('content-type=application/json');\n url = url + '?' + filters.join(';');\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n \tif (req.readyState == 4) {\n thisB.busy--;\n thisB.notifyActivity();\n\n \t if (req.status >= 300) {\n var err = 'Error code ' + req.status;\n try {\n var jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } catch (ex) {};\n\n \t\t callback(err, null);\n \t } else {\n \t\tvar jf = JSON.parse(req.response);\n \t\tvar features = [];\n \t\tfor (var fi = 0; fi < jf.length; ++fi) {\n \t\t var j = jf[fi];\n\n \t\t var notes = [];\n \t\t var f = new DASFeature();\n \t\t f.segment = chr;\n \t\t f.min = j['start'] | 0;\n \t\t f.max = j['end'] | 0;\n \t\t f.type = j.feature_type || 'unknown';\n \t\t f.id = j.ID;\n\n if (j.Parent) {\n var grp = new DASGroup();\n grp.id = j.Parent;\n f.groups = [grp];\n }\n\n if (j.strand) {\n if (j.strand < 0)\n f.orientation = '-';\n else if (j.strand > 0)\n f.orientation = '+';\n }\n\n if (j.consequence_type)\n f.method = j.consequence_type;\n\n if (j.alt_alleles) {\n notes.push('Alleles=' + j.alt_alleles.join('/'));\n if (j.alt_alleles.length > 1) {\n if (j.alt_alleles[1].length != j.alt_alleles[0].length || j.alt_alleles[1] == '-') {\n f.type = 'indel';\n }\n }\n }\n\n if (notes.length > 0) {\n f.notes = notes;\n }\n \t\t features.push(f);\n \t\t}\n \t\tcallback(null, features);\n \t }\n \t}\n\t\n };\n \n thisB.busy++;\n thisB.notifyActivity();\n\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n}\n\nEnsemblFeatureSource.prototype.capabilities = function() {\n const caps = {};\n if (this.type && this.type.indexOf('transcript') >= 0) {\n caps.search = ['gene'];\n }\n return caps;\n}\n\nEnsemblFeatureSource.prototype.search = function(query, callback) {\n const url = `${this.base}/lookup/symbol/${this.species}/${query}?content-type=application/json`;\n const req = new XMLHttpRequest();\n req.onreadystatechange = () => {\n if (req.readyState == 4)\n if (req.status >= 300 || req.status < 200) {\n let err = 'Error code ' + req.status;\n try {\n var jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } catch (ex) {};\n\n if (req.status == 400) // E! returns an error if the lookup fails. Who knows?\n return callback([]);\n else\n return callback(null, err);\n } else {\n const resp = JSON.parse(req.response);\n const result = [];\n\n if (resp && resp.seq_region_name) {\n result.push({\n segment: resp.seq_region_name,\n min: resp.start,\n max: resp.end\n });\n }\n \n return callback(result);\n }\n };\n\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n}\n\ndalliance_registerSourceAdapterFactory('ensembl', function(source) {\n return {features: new EnsemblFeatureSource(source)};\n});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-config.js\n//\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n\n var sha1 = require('./sha1');\n var hex_sha1 = sha1.hex_sha1;\n\n var das = require('./das');\n var copyStylesheet = das.copyStylesheet;\n}\n\nBrowser.prototype.exportFullConfig = function(opts) {\n opts = opts || {};\n\n var config = {\n chr: this.chr,\n viewStart: this.viewStart|0,\n viewEnd: this.viewEnd|0,\n cookieKey: 'dalliance_' + hex_sha1(Date.now()),\n\n coordSystem: this.coordSystem,\n\n sources: this.exportSourceConfig(),\n\n chains: this.exportChains()\n };\n\n if (this.prefix)\n config.prefix = this.prefix;\n\n return config;\n}\n\nBrowser.prototype.exportChains = function() {\n var cc = {};\n var cs = this.chains || {};\n for (var k in cs) {\n cc[k] = cs[k].exportConfig();\n }\n return cc;\n}\n\nBrowser.prototype.exportSourceConfig = function(opts) {\n opts = opts || {};\n\n var sourceConfig = [];\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var tier = this.tiers[ti];\n var source = shallowCopy(tier.dasSource);\n\n if (source.noPersist)\n continue;\n\n source.coords = undefined;\n source.props = undefined;\n if (!source.disabled)\n source.disabled = undefined;\n\n if (tier.config.stylesheet) {\n source.style = copyStylesheet(tier.config.stylesheet).styles;\n source.stylesheet_uri = undefined;\n } else if (source.style) {\n source.style = copyStylesheet({styles: source.style}).styles;\n }\n\n if (typeof(tier.config.name) === 'string') {\n source.name = tier.config.name;\n }\n\n if (tier.config.height !== undefined) {\n source.forceHeight = tier.config.height;\n }\n if (tier.config.forceMin !== undefined) {\n source.forceMin = tier.config.forceMin;\n }\n if (tier.config.forceMinDynamic)\n source.forceMinDynamic = tier.config.forceMinDynamic;\n if (tier.config.forceMax !== undefined) {\n source.forceMax = tier.config.forceMax;\n }\n if (tier.config.bumped !== undefined) {\n source.bumped = tier.config.bumped;\n }\n if (tier.config.forceMaxDynamic)\n source.forceMaxDynamic = tier.config.forceMaxDynamic;\n\n sourceConfig.push(source);\n }\n\n return sourceConfig;\n}\n\nBrowser.prototype.exportPageTemplate = function(opts) {\n opts = opts || {};\n var template = '\\n' +\n ' \\n' +\n ' \\n' +\n ' \\n' + \n ' \\n' +\n ' \\n' +\n '
Dalliance goes here
\\n' +\n ' \\n' +\n '\\n';\n\n return template;\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-image.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var g = require('./glyphs');\n var OverlayLabelCanvas = g.OverlayLabelCanvas;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n var formatLongInt = nf.formatLongInt;\n\n var VERSION = require('./version');\n\n var drawSeqTierGC = require('./sequence-draw').drawSeqTierGC;\n}\n\nfunction fillTextRightJustified(g, text, x, y) {\n g.fillText(text, x - g.measureText(text).width, y);\n}\n\nBrowser.prototype.exportImage = function(opts) {\n opts = opts || {};\n\n var fpw = opts.width || this.featurePanelWidth;\n var padding = 3;\n var ypos = 0;\n if (opts.banner || opts.region) {\n ypos = 40;\n }\n\n var backupFPW = this.featurePanelWidth;\n var backupScale = this.scale;\n this.featurePanelWidth = fpw;\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n \n var totHeight = ypos;\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (ti > 0)\n totHeight += padding;\n var tier = this.tiers[ti];\n\n tier.backupSubtiers = tier.subtiers;\n tier.backupOriginHaxx = tier.originHaxx;\n tier.backupLayoutHeight = tier.layoutHeight;\n\n if (tier.subtiers) {\n const renderer = this.getTierRenderer(tier);\n if (renderer && renderer.prepareSubtiers) {\n renderer.prepareSubtiers(tier, tier.viewport.getContext('2d'));\n }\n\n if (tier.subtiers) {\n var lh = tier.padding;\n for (var s = 0; s < tier.subtiers.length; ++s) {\n lh = lh + tier.subtiers[s].height + tier.padding;\n }\n lh += 6\n tier.layoutHeight = Math.max(lh, this.minTierHeight);\n }\n }\n\n if (tier.layoutHeight !== undefined)\n totHeight += tier.layoutHeight;\n }\n var mult = opts.resolutionMultiplier || 1.0;\n var margin = 200;\n\n var cw = ((fpw + margin) * mult)|0;\n var ch = (totHeight * mult)|0;\n var c = makeElement('canvas', null, {width: cw, height: ch});\n var g = c.getContext('2d');\n g.fillStyle = 'white';\n g.fillRect(0, 0, cw, ch);\n\n g.scale(mult, mult);\n\n if (opts.region) {\n g.save();\n g.fillStyle = 'black';\n g.font = '12pt sans-serif';\n g.fillText(\n this.chr + ':' + formatLongInt(this.viewStart) + '..' + formatLongInt(this.viewEnd),\n margin + 100,\n 28\n );\n g.restore();\n }\n\n if (opts.banner) {\n g.save();\n g.fillStyle = 'black';\n g.font = '12pt sans-serif';\n fillTextRightJustified(g, 'Graphics from Biodalliance ' + VERSION, margin + fpw - 100, 28);\n g.restore();\n }\n\n g.font = '10px sans-serif';\n \n for (var ti = 0; ti < this.tiers.length; ++ti) {\n var tier = this.tiers[ti];\n var offset = ((tier.glyphCacheOrigin - this.viewStart)*this.scale);\n\n var oc = new OverlayLabelCanvas();\n g.save(); // 1\n g.translate(0, ypos);\n\n g.save(); // 2\n g.beginPath();\n g.moveTo(margin, 0);\n g.lineTo(margin + fpw, 0);\n g.lineTo(margin + fpw, tier.layoutHeight);\n g.lineTo(margin, tier.layoutHeight);\n g.closePath();\n g.clip();\n g.translate(margin, 0);\n\n g.save(); // 3\n g.translate(offset, 0);\n if (tier.subtiers) {\n tier.paintToContext(g, oc, offset + 1000);\n \n } else {\n drawSeqTierGC(tier, tier.currentSequence, g);\n }\n g.restore(); // 2\n \n g.save() // 3\n g.translate(offset, 0);\n oc.draw(g, -offset, fpw - offset);\n g.restore(); // 2\n g.restore(); // 1\n\n var hasQuant = false;\n var pos = 0;\n var subtiers = tier.subtiers || [];\n for (var sti = 0; sti < subtiers.length; ++sti) {\n var subtier = subtiers[sti];\n \n if (subtier.quant) {\n hasQuant = true;\n var q = subtier.quant;\n var h = subtier.height;\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + ((h/20) | 0);\n }\n var ticSpacing = h / (numTics - 1);\n var ticInterval = (q.max - q.min) / (numTics - 1);\n\n g.beginPath();\n g.moveTo(margin + 5, pos);\n g.lineTo(margin, pos);\n g.lineTo(margin, pos + subtier.height);\n g.lineTo(margin + 5, pos + subtier.height);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n g.moveTo(margin, pos + ty);\n g.lineTo(margin+3, pos + ty);\n }\n g.strokeStyle = 'black';\n g.strokeWidth = 2;\n g.stroke();\n\n g.fillStyle = 'black';\n fillTextRightJustified(g, formatQuantLabel(q.max), margin - 3, pos + 7);\n fillTextRightJustified(g, formatQuantLabel(q.min), margin - 3, pos + subtier.height);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n fillTextRightJustified(g, formatQuantLabel((1.0*q.max) - (t*ticInterval)), margin - 3, pos + ty + 3);\n }\n }\n\n pos += subtier.height + padding;\n }\n\n var labelName;\n if (typeof tier.config.name === 'string')\n labelName = tier.config.name;\n else\n labelName = tier.dasSource.name;\n var labelWidth = g.measureText(labelName).width;\n g.fillStyle = 'black';\n g.fillText(labelName, margin - (hasQuant ? 28 : 12) - labelWidth, (tier.layoutHeight + 3) / 2);\n\n g.restore(); // 0\n\n ypos += tier.layoutHeight + padding;\n\n tier.subtiers = tier.backupSubtiers;\n tier.originHaxx = tier.backupOriginHaxx;\n tier.layoutHeight = tier.backupLayoutHeight;\n }\n\n if (opts.highlights) {\n g.save();\n\n g.beginPath();\n g.moveTo(margin, 0);\n g.lineTo(margin + fpw, 0);\n g.lineTo(margin + fpw, ypos);\n g.lineTo(margin, ypos);\n g.closePath();\n g.clip();\n\n g.translate(margin + offset, 0);\n var origin = this.viewStart;\n var visStart = this.viewStart;\n var visEnd = this.viewEnd;\n\n for (var hi = 0; hi < this.highlights.length; ++hi) {\n var h = this.highlights[hi];\n if (((h.chr === this.chr) || (h.chr === ('chr' + this.chr))) && h.min < visEnd && h.max > visStart) {\n g.globalAlpha = this.defaultHighlightAlpha;\n g.fillStyle = this.defaultHighlightFill;\n g.fillRect((h.min - origin) * this.scale,\n 0,\n (h.max - h.min) * this.scale,\n ypos);\n }\n } \n g.restore();\n }\n\n var rulerPos = -1; \n if (opts.ruler == 'center') {\n rulerPos = margin + ((this.viewEnd - this.viewStart + 1)*this.scale) / 2;\n } else if (opts.ruler == 'left') {\n rulerPos = margin;\n } else if (opts.ruler == 'right') {\n rulerPos = margin + ((this.viewEnd - this.viewStart + 1)*this.scale);\n }\n if (rulerPos >= 0) {\n g.strokeStyle = 'blue';\n g.beginPath();\n g.moveTo(rulerPos, 0);\n g.lineTo(rulerPos, ypos);\n g.stroke();\n }\n\n this.featurePanelWidth = backupFPW;\n this.scale = backupScale;\n\n return c.toDataURL('image/png');\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// export-ui.js\n//\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n}\n\nBrowser.prototype.openExportPanel = function() {\n var b = this;\n if (this.uiMode === 'export') {\n this.hideToolPanel();\n this.setUiMode('none');\n } else {\n var exportForm = makeElement('div', null, {className: 'export-form'});\n var exportSelect = makeElement('select');\n exportSelect.appendChild(makeElement('option', 'SVG', {value: 'svg'}));\n exportSelect.appendChild(makeElement('option', 'Image', {value: 'png'}));\n exportSelect.appendChild(makeElement('option', 'Dalliance config', {value: 'config'}));\n exportSelect.appendChild(makeElement('option', 'Dalliance sources', {value: 'sources'}));\n exportSelect.appendChild(makeElement('option', 'Dalliance page', {value: 'page'}));\n exportSelect.value = 'svg';\n\n exportSelect.addEventListener('change', function(ev) {\n removeChildren(exportContent);\n setupEOT();\n }, false);\n exportForm.appendChild(makeElement('p', ['Export as: ', exportSelect]));\n\n var exportHighlightsToggle = makeElement('input', null, {type: 'checkbox', checked: this.exportHighlights});\n exportHighlightsToggle.addEventListener('change', function(ev) {\n b.exportHighlights = exportHighlightsToggle.checked;\n b.storeStatus();\n }, false);\n var exportRulerToggle = makeElement('input', null, {type: 'checkbox', checked: this.exportRuler});\n exportRulerToggle.addEventListener('change', function(ev) {\n b.exportRuler = exportRulerToggle.checked;\n b.storeStatus();\n }, false);\n var exportRegionToggle = makeElement('input', null, {type: 'checkbox', checked: this.exportRegion});\n exportRegionToggle.addEventListener('change', function(ev) {\n b.exportRegion = exportRegionToggle.checked;\n b.storeStatus();\n }, false);\n var exportBannerToggle = makeElement('input', null, {type: 'checkbox', checked: this.exportBanner});\n exportBannerToggle.addEventListener('change', function(ev) {\n b.exportBanner = exportBannerToggle.checked;\n b.storeStatus();\n }, false);\n var exportScale = makeElement('input', null, {type: 'text', value: '1.0'});\n var exportWidth = makeElement('input', null, {type: 'text', value: '800'});\n\n var exportButton = makeElement('button', 'Export', {className: 'btn btn-primary'});\n exportButton.addEventListener('click', function(ev) {\n removeChildren(exportContent);\n\n var blobURL;\n var note, type, name;\n if (exportSelect.value === 'svg') {\n blobURL = URL.createObjectURL(b.makeSVG({highlights: exportHighlightsToggle.checked,\n banner: b.exportBanner,\n region: b.exportRegion,\n ruler: exportRulerToggle.checked ? b.rulerLocation : 'none',\n width: parseInt(exportWidth.value) || 800}));\n note = 'SVG';\n type = 'image/svg';\n name = 'dalliance-view.svg';\n } else if (exportSelect.value === 'png') {\n var mult = parseFloat(exportScale.value);\n if (mult < 0.1 || mult > 10) {\n alert('bad scale ' + mult);\n return;\n }\n\n blobURL = b.exportImage({highlights: exportHighlightsToggle.checked,\n banner: b.exportBanner,\n region: b.exportRegion,\n ruler: exportRulerToggle.checked ? b.rulerLocation : 'none',\n resolutionMultiplier: mult,\n width: parseInt(exportWidth.value) || 800});\n note = 'Image';\n type = 'image/png';\n name = 'dalliance-view.png';\n } else if (exportSelect.value === 'config') {\n var config = JSON.stringify(b.exportFullConfig(), null, 2);\n var blob = new Blob([config], {type: 'text/plain'});\n blobURL = URL.createObjectURL(blob);\n note = 'Configuration';\n type = 'text/plain';\n name = 'dalliance-config.json';\n } else if (exportSelect.value === 'sources') {\n var config = JSON.stringify(b.exportSourceConfig(), null, 2);\n var blob = new Blob([config], {type: 'text/plain'});\n blobURL = URL.createObjectURL(blob);\n note = 'Source array';\n type = 'text/plain';\n name = 'dalliance-sources.json';\n } else if (exportSelect.value === 'page') {\n var page = b.exportPageTemplate();\n var type = 'text/html';\n var blob = new Blob([page], {type: type});\n blobURL = URL.createObjectURL(blob);\n note = 'Page template';\n name = 'dalliance-view.html';\n }\n\n if (blobURL) {\n var downloadLink = makeElement('a', '[Download]', {\n href: blobURL,\n download: name,\n type: type\n });\n\n var previewLink = makeElement('a', '[Preview in browser]', {\n href: blobURL,\n type: type,\n target: '_new'\n });\n\n exportContent.appendChild(makeElement('p', ['' + note + ' created: ', downloadLink, previewLink]));\n }\n }, false);\n\n b.addViewListener(function() {\n removeChildren(exportContent);\n });\n b.addTierListener(function() {\n removeChildren(exportContent);\n });\n\n var exportContent = makeElement('p', '');\n\n var eotHighlights = makeElement('tr',\n [makeElement('th', 'Include highlights', {}, {width: '400px', textAlign: 'right'}),\n makeElement('td', exportHighlightsToggle)]);\n var eotGuideline = makeElement('tr',\n [makeElement('th', 'Include vertical guideline', {}, {textAlign: 'right'}),\n makeElement('td', exportRulerToggle)]);\n var eotScale = makeElement('tr',\n [makeElement('th', 'Scale multiplier', {}, {textAlign: 'right'}),\n makeElement('td', exportScale)]);\n var eotWidth = makeElement('tr',\n [makeElement('th', 'Width (logical px)', {}, {textAlign: 'right'}),\n makeElement('td', exportWidth)]);\n var eotRegion = makeElement('tr',\n [makeElement('th', 'Label with genomic coordinates', {}, {textAlign: 'right'}),\n makeElement('td', exportRegionToggle)]);\n var eotBanner = makeElement('tr',\n [makeElement('th', 'Include banner', {}, {textAlign: 'right'}),\n makeElement('td', exportBannerToggle)]);\n\n var exportOptsTable = makeElement('table',\n [eotHighlights,\n eotGuideline,\n eotWidth,\n eotScale,\n eotRegion], null, {width: '500px'});\n var setupEOT = function() {\n var es = exportSelect.value;\n eotHighlights.style.display = (es == 'svg' || es == 'png') ? 'table-row' : 'none';\n eotGuideline.style.display = (es == 'svg' || es == 'png') ? 'table-row' : 'none';\n eotScale.style.display = (es == 'png') ? 'table-row' : 'none';\n eotWidth.style.display = (es == 'svg' || es == 'png') ? 'table-row' : 'none';\n eotRegion.style.display = (es == 'svg' || es == 'png') ? 'table-row' : 'none';\n eotBanner.style.display = (es == 'svg' || es == 'png') ? 'table-row' : 'none';\n }\n setupEOT();\n\n exportForm.appendChild(exportOptsTable);\n exportForm.appendChild(exportButton);\n exportForm.appendChild(exportContent);\n\n if (this.uiMode !== 'none')\n this.hideToolPanel();\n this.browserHolder.insertBefore(exportForm, this.svgHolder);\n this.activeToolPanel = exportForm;\n\n this.setUiMode('export');\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// exports.js: shim to export symbols into global namespace for ease of embedding\n//\n\nrequire('babel-polyfill');\nvar browser = require('./cbrowser');\nvar chainset = require('./chainset');\nvar sa = require('./sourceadapters');\nvar utils = require('./utils');\nvar das = require('./das');\nvar sc = require('./sourcecompare');\n\nwindow.Browser = browser.Browser;\nwindow.sourcesAreEqual = sc.sourcesAreEqual;\nwindow.Chainset = chainset.Chainset; // Pre-0.12 configurations need this.\n\n// Useful for info plugins. Should be reconsidered in the future.\nwindow.makeElement = utils.makeElement;\n\n// Allow source plugins to be loaded separately.\nwindow.dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\nwindow.dalliance_registerParserFactory = sa.registerParserFactory;\nwindow.dalliance_makeParser = sa.makeParser;\n\n// DAS* objects for some plugins -- remove when plugin API changes...\n\nwindow.DASSequence = das.DASSequence;\nwindow.DASFeature = das.DASFeature;\nwindow.DASGroup = das.DASGroup;\nwindow.DASStylesheet = das.DASStylesheet;\nwindow.DASStyle = das.DASStyle;\nwindow.DASSource = das.DASSource; // Pre-0.8 configurations used this. Still some around...\n\nvar ruler = require(\"./rulers\");\nwindow.Ruler = ruler.Ruler;\nwindow.rulerDrawCallback = ruler.rulerDrawCallback;\n","//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// feature-draw.js: new feature-tier renderer\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var tier = require('./tier');\n var DasTier = tier.DasTier;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n}\n\nfunction SubTier() {\n this.glyphs = [];\n this.height = 0;\n this.quant = null;\n}\n\nSubTier.prototype.indexFor = function(glyph) {\n var gmin = glyph.min();\n var lb = 0, ub = this.glyphs.length;\n while (ub > lb) {\n var mid = ((lb + ub)/2)|0;\n if (mid >= this.glyphs.length)\n return this.glyphs.length;\n var mg = this.glyphs[mid];\n if (gmin < mg.min()) {\n ub = mid;\n } else {\n lb = mid + 1;\n }\n }\n return ub;\n}\n\nSubTier.prototype.add = function(glyph) {\n var ind = this.indexFor(glyph);\n this.glyphs.splice(ind, 0, glyph);\n this.height = Math.max(this.height, glyph.height());\n if (glyph.quant && this.quant == null) {\n this.quant = glyph.quant;\n }\n}\n\nSubTier.prototype.hasSpaceFor = function(glyph) {\n var ind = this.indexFor(glyph);\n if (ind > 0 && this.glyphs[ind-1].max() >= glyph.min())\n return false;\n if (ind < this.glyphs.length && this.glyphs[ind].min() <= glyph.max())\n return false;\n\n return true;\n}\n\nDasTier.prototype.paintToContext = function(gc, oc, offset) {\n var subtiers = this.subtiers;\n var fpw = this.viewport.width|0;\n\n gc.save();\n for (var s = 0; s < subtiers.length; ++s) {\n var quant = null;\n var glyphs = subtiers[s].glyphs;\n for (var i = 0; i < glyphs.length; ++i) {\n var glyph = glyphs[i];\n if (glyph.min() < fpw-offset && glyph.max() > -offset) {\n var glyph = glyphs[i];\n glyph.draw(gc, oc);\n if (glyph.quant) {\n quant = glyph.quant;\n }\n }\n }\n\n\tif (quant && quant.min < 0 && quant.max > 0 && this.dasSource.zeroLine) {\n\t var ry = subtiers[0].height * (quant.max / (quant.max - quant.min))\n\t gc.save();\n\t gc.strokeStyle = this.dasSource.zeroLine;\n\t gc.lineWidth = 0.5;\n\t gc.beginPath();\n\t gc.moveTo(-1000, ry);\n\t gc.lineTo(fpw + 1000, ry);\n\t gc.stroke();\n\t gc.restore();\n\t}\n\n if (this.scaleVertical) {\n var scale = this.browser.scale;\n gc.translate(0, scale + this.padding);\n oc.translate(0, scale + this.padding);\n } else {\n gc.translate(0, subtiers[s].height + this.padding);\n oc.translate(0, subtiers[s].height + this.padding);\n }\n }\n gc.restore();\n\n if (quant && this.quantLeapThreshold && this.featureSource && this.browser.sourceAdapterIsCapable(this.featureSource, 'quantLeap')) {\n var ry = subtiers[0].height * (1.0 - ((this.quantLeapThreshold - quant.min) / (quant.max - quant.min)));\n\n gc.save();\n gc.strokeStyle = 'red';\n gc.lineWidth = 0.3;\n gc.beginPath();\n gc.moveTo(-1000, ry);\n gc.lineTo(fpw + 1000, ry);\n gc.stroke();\n gc.restore();\n }\n}\n\nDasTier.prototype.paintQuant = function() {\n if (!this.quantOverlay)\n return;\n\n var retina = this.browser.retina && window.devicePixelRatio > 1;\n\n var quant;\n if (this.subtiers && this.subtiers.length > 0)\n quant = this.subtiers[0].quant;\n\n if (quant) {\n var h = this.subtiers[0].height;\n var w = 50;\n this.quantOverlay.height = this.viewport.height;\n this.quantOverlay.width = retina ? w*2 : w;\n this.quantOverlay.style.height = '' + (retina ? this.quantOverlay.height/2 : this.quantOverlay.height) + 'px';\n this.quantOverlay.style.width = '' + w + 'px';\n this.quantOverlay.style.display = 'block';\n var ctx = this.quantOverlay.getContext('2d');\n if (retina)\n ctx.scale(2, 2);\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + ((h/20) | 0);\n }\n var ticSpacing = (h + this.padding*2) / (numTics - 1);\n var ticInterval = (quant.max - quant.min) / (numTics - 1);\n\n ctx.fillStyle = 'white'\n ctx.globalAlpha = 0.6;\n if (this.browser.rulerLocation == 'right') {\n ctx.fillRect(w-30, 0, 30, h + this.padding*2);\n } else {\n ctx.fillRect(0, 0, 30, h + this.padding*2);\n }\n ctx.globalAlpha = 1.0;\n\n ctx.strokeStyle = 'black';\n ctx.lineWidth = 1;\n ctx.beginPath();\n\n if (this.browser.rulerLocation == 'right') {\n ctx.moveTo(w - 8, this.padding);\n ctx.lineTo(w, this.padding);\n ctx.lineTo(w, h + this.padding);\n ctx.lineTo(w - 8, h + this.padding);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n ctx.moveTo(w, ty);\n ctx.lineTo(w - 5, ty);\n }\n } else {\n ctx.moveTo(8, this.padding);\n ctx.lineTo(0, this.padding);\n ctx.lineTo(0, h + this.padding);\n ctx.lineTo(8, h + this.padding);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n ctx.moveTo(0, ty);\n ctx.lineTo(5, ty);\n }\n }\n ctx.stroke();\n\n ctx.fillStyle = 'black';\n\n if (this.browser.rulerLocation == 'right') {\n ctx.textAlign = 'right';\n ctx.fillText(formatQuantLabel(quant.max), w-9, 8);\n ctx.fillText(formatQuantLabel(quant.min), w-9, h + this.padding);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n ctx.fillText(formatQuantLabel((1.0*quant.max) - (t*ticInterval)), w - 9, ty + 3);\n }\n } else {\n ctx.textAlign = 'left';\n ctx.fillText(formatQuantLabel(quant.max), 9, 8);\n ctx.fillText(formatQuantLabel(quant.min), 9, h + this.padding);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n ctx.fillText(formatQuantLabel((1.0*quant.max) - (t*ticInterval)), 9, ty + 3);\n }\n }\n } else {\n this.quantOverlay.style.display = 'none';\n }\n}\n\nDasTier.prototype.styleForFeature = function(f) {\n var ssScale = this.browser.zoomForCurrentScale();\n\n if (!this.stylesheet) {\n return null;\n }\n\n var maybe = null;\n var ss = this.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n\n if (sh.orientation) {\n if (sh.orientation != f.orientation) {\n continue;\n }\n }\n\n var labelRE = sh._labelRE;\n if (!labelRE || !labelRE.test) {\n labelRE = new RegExp('^' + sh.label + '$');\n sh._labelRE = labelRE;\n }\n if (sh.label && !(labelRE.test(f.label))) {\n continue;\n }\n var methodRE = sh._methodRE;\n if (!methodRE || !methodRE.test) {\n methodRE = new RegExp('^' + sh.method + '$');\n sh._methodRE = methodRE;\n }\n if (sh.method && !(methodRE.test(f.method))) {\n continue;\n }\n if (sh.type) {\n if (sh.type == 'default') {\n if (!maybe) {\n maybe = sh.style;\n }\n continue;\n } else {\n var typeRE = sh._typeRE;\n if (!typeRE || !typeRE.test) {\n typeRE = new RegExp('^' + sh.type + '$');\n sh._typeRE = typeRE;\n }\n if (!typeRE.test(f.type))\n continue;\n }\n }\n return sh.style;\n }\n return maybe;\n}\n\nDasTier.prototype.quantMin = function(style) {\n if (this.forceMinDynamic) {\n return this.currentFeaturesMinScore || 0;\n } else if (typeof(this.forceMin) === 'number') {\n return this.forceMin;\n } else {\n const softMin = typeof(style.SOFTMIN) !== 'undefined' ? style.SOFTMIN : Number.MAX_VALUE;\n return style.MIN || Math.min(softMin, this.currentFeaturesMinScore || 0);\n }\n}\n\nDasTier.prototype.quantMax = function(style) {\n if (this.forceMaxDynamic) {\n return this.currentFeaturesMaxScore || 0;\n } else if (typeof(this.forceMax) === 'number') {\n return this.forceMax;\n } else {\n const softMax = typeof(style.SOFTMAX) !== 'undefined' ? style.SOFTMAX : Number.MIN_VALUE;\n return style.MAX || Math.max(softMax, this.currentFeaturesMaxScore || 0);\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n SubTier: SubTier\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// feature-popup.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var pick = utils.pick;\n var pushnew = utils.pushnew;\n var makeElement = utils.makeElement;\n}\n\n\nvar TAGVAL_NOTE_RE = new RegExp('^([A-Za-z_-]+)=(.+)');\n\nBrowser.prototype.addFeatureInfoPlugin = function (handler) {\n if (!this.featureInfoPlugins) {\n this.featureInfoPlugins = [];\n }\n this.featureInfoPlugins.push(handler);\n}\n\nfunction FeatureInfo(hit, feature, group) {\n var name = pick(group.type, feature.type);\n var fid = pick(group.label, feature.label, group.id, feature.id);\n if (!hit[0].molgenis && fid && fid.indexOf('__dazzle') != 0) {\n name = name + ': ' + fid;\n }\n\n this.hit = hit;\n this.feature = feature;\n this.group = group;\n this.title = hit[0].molgenis ? feature.id : name;\n this.sections = [];\n}\n\nFeatureInfo.prototype.setTitle = function (t) {\n this.title = t;\n}\n\nFeatureInfo.prototype.add = function (label, info) {\n if (typeof info === 'string') {\n info = makeElement('span', info);\n }\n this.sections.push({label: label, info: info});\n}\n\nBrowser.prototype.featurePopup = function (ev, __ignored_feature, hit, tier) {\n var hi = hit.length;\n var feature = --hi >= 0 ? hit[hi] : {};\n var group = --hi >= 0 ? hit[hi] : {};\n\n var featureInfo = new FeatureInfo(hit, feature, group);\n featureInfo.tier = tier;\n var fips = this.featureInfoPlugins || [];\n for (var fipi = 0; fipi < fips.length; ++fipi) {\n try {\n fips[fipi](feature, featureInfo);\n } catch (e) {\n console.log(e.stack || e);\n }\n }\n fips = tier.featureInfoPlugins || [];\n for (fipi = 0; fipi < fips.length; ++fipi) {\n try {\n fips[fipi](feature, featureInfo);\n } catch (e) {\n console.log(e.stack || e);\n }\n }\n\n this.removeAllPopups();\n\n var table = makeElement('table', null, {className: 'table table-striped table-condensed'});\n table.style.width = '100%';\n table.style.margin = '0px';\n\n var idx = 0;\n if (feature.method && !tier.dasSource.suppressMethod) {\n var row = makeElement('tr', [\n makeElement('th', 'Method'),\n makeElement('td', feature.method)\n ]);\n table.appendChild(row);\n ++idx;\n }\n {\n var loc;\n if (group.segment) {\n loc = group;\n } else {\n loc = feature;\n }\n var row = makeElement('tr', [\n makeElement('th', 'Location'),\n makeElement('td', loc.segment + ':' + loc.min + '-' + loc.max, {}, {minWidth: '200px'})\n ]);\n table.appendChild(row);\n ++idx;\n }\n if (feature.score !== undefined && feature.score !== null && feature.score != '-'\n && !feature.suppressScore && !tier.dasSource.suppressScore\n ) {\n var row = makeElement('tr', [\n makeElement('th', 'Score'),\n makeElement('td', '' + feature.score)\n ]);\n table.appendChild(row);\n ++idx;\n }\n {\n var links = maybeConcat(group.links, feature.links);\n if (links && links.length > 0) {\n var row = makeElement('tr', [\n makeElement('th', 'Links'),\n makeElement('td', links.map(function (l) {\n return makeElement('div', makeElement('a', l.desc, {href: l.uri, target: '_new'}));\n }))\n ]);\n table.appendChild(row);\n ++idx;\n }\n }\n {\n var notes = maybeConcat(group.notes, feature.notes);\n for (var ni = 0; ni < notes.length; ++ni) {\n var k = 'Note';\n var v = notes[ni];\n //---START MOLGENIS CUSTOM CODE---\n //params: do not rename, because this will make merging with dalliance changes harder\n //v is note\n //m is splitted note into array [key,value]\n //k is key\n //v is value\n if (hit[0].molgenis) {\n var m = v.split(\"=\");\n if (m.length === 2) {\n k = m[0];\n v = m[1];\n }\n }\n //---END MOLGENIS CUSTOM CODE---\n\n var row = makeElement('tr', [\n makeElement('th', k),\n makeElement('td', v)\n ]);\n table.appendChild(row);\n ++idx;\n }\n }\n\n for (var fisi = 0; fisi < featureInfo.sections.length; ++fisi) {\n var section = featureInfo.sections[fisi];\n table.appendChild(makeElement('tr', [\n makeElement('th', section.label),\n makeElement('td', section.info)]));\n }\n //---START MOLGENIS CUSTOM CODE---\n if(hit[0].molgenis) {\n if (feature.actions) {\n for (var index = 0; index < feature.actions.length; ++index) {\n let action = feature.actions[index]\n let actionItem = makeElement('a', action.label);\n\n actionItem.addEventListener('click', function (ev) {\n eval(action.run);\n }, false);\n\n table.appendChild(makeElement('tr', [\n makeElement('th', \"\"),\n makeElement('td', actionItem)]));\n }\n }\n }\n //---END MOLGENIS CUSTOM CODE---\n this.popit(ev, featureInfo.title || 'Feature', table, {width: 450});\n}\n\nfunction maybeConcat(a, b) {\n var l = [];\n if (a) {\n for (var i = 0; i < a.length; ++i) {\n pushnew(l, a[i]);\n }\n }\n if (b) {\n for (var i = 0; i < b.length; ++i) {\n pushnew(l, b[i]);\n }\n }\n return l;\n}\n","\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var pusho = utils.pusho;\n var pushnewo = utils.pushnewo;\n}\n\nfunction sortFeatures(tier)\n{\n var dmin = tier.browser.drawnStart, dmax = tier.browser.drawnEnd;\n var ungroupedFeatures = {};\n var groupedFeatures = {};\n var drawnGroupedFeatures = {};\n var groupMins = {}, groupMaxes = {};\n var groups = {};\n var superGroups = {};\n var groupsToSupers = {};\n var nonPositional = [];\n var minScore, maxScore;\n var fbid;\n\n var init_fbid = function() {\n fbid = {};\n for (var fi = 0; fi < tier.currentFeatures.length; ++fi) {\n var f = tier.currentFeatures[fi];\n if (f.id) {\n fbid[f.id] = f;\n }\n }\n };\n \n var superParentsOf = function(f) {\n // FIXME: should recur.\n var spids = [];\n if (f.parents) {\n for (var pi = 0; pi < f.parents.length; ++pi) {\n var pid = f.parents[pi];\n var p = fbid[pid];\n if (!p) {\n continue;\n }\n // alert(p.type + ':' + p.typeCv);\n if (p.typeCv == 'SO:0000704') {\n pushnew(spids, pid);\n }\n }\n }\n return spids;\n }\n\n for (var fi = 0; fi < tier.currentFeatures.length; ++fi) {\n var f = tier.currentFeatures[fi];\n if (f.parts) {\n continue;\n }\n\n var drawn = f.min <= dmax && f.max >= dmin;\n\n if (!f.min || !f.max) {\n nonPositional.push(f);\n continue;\n }\n\n if (f.score && f.score != '.' && f.score != '-') {\n var sc = 1.0 * f.score;\n if (!minScore || sc < minScore) {\n minScore = sc;\n }\n if (!maxScore || sc > maxScore) {\n maxScore = sc;\n }\n }\n\n var fGroups = [];\n var fSuperGroup = null;\n if (f.groups) {\n for (var gi = 0; gi < f.groups.length; ++gi) {\n var g = f.groups[gi];\n var gid = g.id;\n if (g.type == 'gene') {\n // Like a super-grouper...\n fSuperGroup = gid; \n groups[gid] = g;\n } else if (g.type == 'translation') {\n // have to ignore this to get sensible results from bj-e :-(.\n } else {\n pusho(groupedFeatures, gid, f);\n groups[gid] = g;\n fGroups.push(gid);\n\n var ogm = groupMins[gid];\n if (!ogm || f.min < ogm)\n groupMins[gid] = f.min;\n\n ogm = groupMaxes[gid];\n if (!ogm || f.max > ogm)\n groupMaxes[gid] = f.max;\n }\n }\n }\n\n if (f.parents) {\n if (!fbid) {\n init_fbid();\n }\n for (var pi = 0; pi < f.parents.length; ++pi) {\n var pid = f.parents[pi];\n var p = fbid[pid];\n if (!p) {\n // alert(\"couldn't find \" + pid);\n continue;\n }\n if (!p.parts) {\n p.parts = [f];\n }\n pushnewo(groupedFeatures, pid, p);\n pusho(groupedFeatures, pid, f);\n \n if (!groups[pid]) {\n groups[pid] = {\n type: p.type,\n id: p.id,\n label: p.label || p.id\n };\n }\n fGroups.push(pid);\n\n var ogm = groupMins[pid];\n if (!ogm || f.min < ogm)\n groupMins[pid] = f.min;\n\n ogm = groupMaxes[pid];\n if (!ogm || f.max > ogm)\n groupMaxes[pid] = f.max;\n\n var sgs = superParentsOf(p);\n if (sgs.length > 0) {\n fSuperGroup = sgs[0];\n var sp = fbid[sgs[0]];\n groups[sgs[0]] = {\n type: sp.type,\n id: sp.id,\n label: sp.label || sp.id\n };\n if (!tier.dasSource.collapseSuperGroups) {\n tier.dasSource.collapseSuperGroups = true;\n }\n }\n } \n }\n\n if (fGroups.length == 0) {\n if (drawn)\n pusho(ungroupedFeatures, f.type, f);\n } else if (fSuperGroup) {\n for (var g = 0; g < fGroups.length; ++g) {\n var gid = fGroups[g];\n pushnewo(superGroups, fSuperGroup, gid);\n groupsToSupers[gid] = fSuperGroup;\n } \n } \n }\n\n for (var gid in groupedFeatures) {\n var group = groups[gid];\n if (typeof(group.min) !== 'number') \n group.min = groupMins[gid];\n if (typeof(group.max) !== 'number') \n group.max = groupMaxes[gid];\n\n if (groupMaxes[gid] >= dmin && groupMins[gid] <= dmax)\n drawnGroupedFeatures[gid] = groupedFeatures[gid];\n }\n\n tier.ungroupedFeatures = ungroupedFeatures;\n tier.groupedFeatures = drawnGroupedFeatures;\n tier.groups = groups;\n tier.superGroups = superGroups;\n tier.groupsToSupers = groupsToSupers;\n\n if (minScore) {\n if (minScore > 0) {\n minScore = 0;\n } else if (maxScore < 0) {\n maxScore = 0;\n }\n tier.currentFeaturesMinScore = minScore;\n tier.currentFeaturesMaxScore = maxScore;\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n sortFeatures: sortFeatures\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// glyphs.js: components which know how to draw themselves\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var spans = require('./spans');\n var union = spans.union;\n var Range = spans.Range;\n\n var utils = require('./utils');\n var makeElementNS = utils.makeElementNS;\n var AMINO_ACID_TRANSLATION = utils.AMINO_ACID_TRANSLATION;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n}\n\nfunction PathGlyphBase(stroke, fill) {\n this._stroke = stroke;\n this._fill = fill;\n}\n\nPathGlyphBase.prototype.draw = function(g) {\n g.beginPath();\n this.drawPath(g);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n}\n\nPathGlyphBase.prototype.toSVG = function() {\n var g = new SVGPath();\n this.drawPath(g);\n \n return makeElementNS(\n NS_SVG, 'path',\n null,\n {d: g.toPathData(),\n fill: this._fill || 'none',\n stroke: this._stroke || 'none'});\n}\n\nPathGlyphBase.prototype.drawPath = function(g) {\n throw 'drawPath method on PathGlyphBase must be overridden';\n}\n\nfunction BoxGlyph(x, y, width, height, fill, stroke, alpha, radius) {\n this.x = x;\n this.y = y;\n this._width = width;\n this._height = height;\n this.fill = fill;\n this.stroke = stroke;\n this._alpha = alpha;\n this._radius = radius || 0;\n}\n\nBoxGlyph.prototype.draw = function(g) {\n var r = this._radius;\n\n if (r > 0) {\n g.beginPath();\n g.moveTo(this.x + r, this.y);\n g.lineTo(this.x + this._width - r, this.y);\n g.arcTo(this.x + this._width, this.y, this.x + this._width, this.y + r, r);\n g.lineTo(this.x + this._width, this.y + this._height - r);\n g.arcTo(this.x + this._width, this.y + this._height, this.x + this._width - r, this.y + this._height, r);\n g.lineTo(this.x + r, this.y + this._height);\n g.arcTo(this.x, this.y + this._height, this.x, this.y + this._height - r, r);\n g.lineTo(this.x, this.y + r);\n g.arcTo(this.x, this.y, this.x + r, this.y, r);\n g.closePath();\n\n if (this._alpha != null) {\n g.save();\n g.globalAlpha = this._alpha;\n }\n \n if (this.fill) {\n g.fillStyle = this.fill;\n g.fill();\n }\n if (this.stroke) {\n g.strokeStyle = this.stroke;\n g.lineWidth = 0.5;\n g.stroke();\n }\n\n if (this._alpha != null) {\n g.restore();\n }\n } else {\n if (this._alpha != null) {\n g.save();\n g.globalAlpha = this._alpha;\n }\n\n if (this.fill) {\n g.fillStyle = this.fill;\n g.fillRect(this.x, this.y, this._width, this._height);\n }\n\n if (this.stroke) {\n g.strokeStyle = this.stroke;\n g.lineWidth = 0.5;\n g.strokeRect(this.x, this.y, this._width, this._height)\n }\n\n if (this._alpha != null) {\n g.restore();\n }\n }\n}\n\nBoxGlyph.prototype.toSVG = function() {\n var s = makeElementNS(NS_SVG, 'rect', null,\n {x: this.x, \n y: this.y, \n width: this._width, \n height: this._height,\n stroke: this.stroke || 'none',\n strokeWidth: 0.5,\n fill: this.fill || 'none'});\n if (this._alpha != null) {\n s.setAttribute('opacity', this._alpha);\n }\n\n return s;\n}\n\nBoxGlyph.prototype.min = function() {\n return this.x;\n}\n\nBoxGlyph.prototype.max = function() {\n return this.x + this._width;\n}\n\nBoxGlyph.prototype.height = function() {\n return this.y + this._height;\n}\n\n\nfunction GroupGlyph(glyphs, connector) {\n this.glyphs = glyphs;\n this.connector = connector;\n this.h = glyphs[0].height();\n\n var covList = [];\n for (var g = 0; g < glyphs.length; ++g) {\n var gg = glyphs[g];\n covList.push(new Range(gg.min(), gg.max()));\n this.h = Math.max(this.h, gg.height());\n }\n this.coverage = union(covList);\n}\n\nGroupGlyph.prototype.drawConnectors = function(g) {\n var ranges = this.coverage.ranges();\n for (var r = 1; r < ranges.length; ++r) {\n var gl = ranges[r];\n var last = ranges[r - 1];\n if (last && gl.min() > last.max()) {\n var start = last.max();\n var end = gl.min();\n var mid = (start+end)/2\n \n if (this.connector === 'hat+') {\n g.moveTo(start, this.h/2);\n g.lineTo(mid, 0);\n g.lineTo(end, this.h/2);\n } else if (this.connector === 'hat-') {\n g.moveTo(start, this.h/2);\n g.lineTo(mid, this.h);\n g.lineTo(end, this.h/2);\n } else if (this.connector === 'collapsed+') {\n g.moveTo(start, this.h/2);\n g.lineTo(end, this.h/2);\n if (end - start > 4) {\n g.moveTo(mid - 2, (this.h/2) - 3);\n g.lineTo(mid + 2, this.h/2);\n g.lineTo(mid - 2, (this.h/2) + 3);\n }\n } else if (this.connector === 'collapsed-') {\n g.moveTo(start, this.h/2);\n g.lineTo(end, this.h/2);\n if (end - start > 4) {\n g.moveTo(mid + 2, (this.h/2) - 3);\n g.lineTo(mid - 2, this.h/2);\n g.lineTo(mid + 2, (this.h/2) + 3);\n }\n } else {\n g.moveTo(start, this.h/2);\n g.lineTo(end, this.h/2);\n }\n }\n last = gl;\n }\n}\n\nGroupGlyph.prototype.draw = function(g, oc) {\n for (var i = 0; i < this.glyphs.length; ++i) {\n var gl = this.glyphs[i];\n gl.draw(g, oc);\n }\n\n g.strokeStyle = 'black';\n g.beginPath();\n this.drawConnectors(g);\n g.stroke();\n}\n\nGroupGlyph.prototype.toSVG = function() {\n var g = makeElementNS(NS_SVG, 'g');\n for (var i = 0; i < this.glyphs.length; ++i) {\n g.appendChild(this.glyphs[i].toSVG());\n }\n\n var p = new SVGPath();\n this.drawConnectors(p);\n\n var pathData = p.toPathData();\n if (pathData.length > 0) {\n var path = makeElementNS(\n NS_SVG, 'path',\n null,\n {d: p.toPathData(),\n fill: 'none',\n stroke: 'black',\n strokeWidth: 0.5});\n g.appendChild(path);\n }\n\n return g;\n}\n\nGroupGlyph.prototype.min = function() {\n return this.coverage.min();\n}\n\nGroupGlyph.prototype.max = function() {\n return this.coverage.max();\n}\n\nGroupGlyph.prototype.height = function() {\n return this.h;\n}\n\n\nfunction LineGraphGlyph(points, color, height) {\n this.points = points;\n this.color = color;\n this._height = height || 50;\n}\n\nLineGraphGlyph.prototype.min = function() {\n return this.points[0].x;\n // return this.points[0];\n};\n\nLineGraphGlyph.prototype.max = function() {\n return this.points[this.points.length - 1].x;\n // return this.points[this.points.length - 2];\n};\n\nLineGraphGlyph.prototype.height = function() {\n return this._height;\n}\n\nLineGraphGlyph.prototype.draw = function(g) {\n g.save();\n g.strokeStyle = this.color;\n g.lineWidth = 2;\n g.beginPath();\n this.points.forEach(function(p, i) {\n if (i === 0)\n g.moveTo(p.x, p.y);\n else\n g.lineTo(p.x, p.y);\n });\n g.stroke();\n g.restore();\n}\n\nLineGraphGlyph.prototype.toSVG = function() {\n var p = new SVGPath();\n for (let i = 0; i < this.points.length; ++i) {\n var x = this.points[i].x;\n var y = this.points[i].y;\n if (i == 0) {\n p.moveTo(x, y);\n } else {\n p.lineTo(x, y);\n }\n }\n \n return makeElementNS(\n NS_SVG, 'path',\n null,\n {d: p.toPathData(),\n fill: 'none',\n stroke: this.color,\n strokeWidth: '2px'});\n}\n\nfunction LabelledGlyph(GLOBAL_GC, glyph, text, unmeasured, anchor, align, font) {\n this.glyph = glyph;\n this.text = text;\n this.anchor = anchor || 'left';\n this.align = align || 'below';\n if (font) {\n this.font = font;\n }\n if (this.font) {\n GLOBAL_GC.save();\n GLOBAL_GC.font = this.font;\n }\n var metrics = GLOBAL_GC.measureText(text);\n if (this.font) {\n GLOBAL_GC.restore();\n }\n this.textLen = metrics.width;\n this.textHeight = 5;\n this.bump = glyph.bump;\n this.measured = !unmeasured;\n}\n\nLabelledGlyph.prototype.toSVG = function() {\n var child = this.glyph.toSVG();\n var opts = {};\n \n if (this.align == 'above') {\n child = makeElementNS(NS_SVG, 'g', child, {transform: \"translate(0, \" + (this.textHeight|0 + 2) + \")\"});\n opts.y = this.textHeight;\n } else {\n opts.y = this.glyph.height() + 15;\n }\n\n if (this.font) {\n opts.fontSize = 7;\n }\n\n if ('center' == this.anchor) {\n opts.x = (this.glyph.min() + this.glyph.max() - this.textLen) / 2;\n } else {\n opts.x = this.glyph.min();\n }\n\n return makeElementNS(NS_SVG, 'g',\n [child,\n makeElementNS(NS_SVG, 'text', this.text, opts)]);\n}\n\nLabelledGlyph.prototype.min = function() {\n return this.glyph.min();\n}\n\nLabelledGlyph.prototype.max = function() {\n if (this.measured)\n return Math.max(this.glyph.max(), (1.0*this.glyph.min()) + this.textLen + 10);\n else\n return this.glyph.max();\n}\n\nLabelledGlyph.prototype.height = function() {\n var h = this.glyph.height();\n if (this.measured) {\n if (this.align == 'above') {\n h += this.textHeight + 2;\n } else {\n h += 20;\n }\n }\n return h;\n}\n\nLabelledGlyph.prototype.draw = function(g, oc) {\n if (this.align == 'above') {\n g.save();\n g.translate(0, this.textHeight + 2);\n }\n this.glyph.draw(g);\n if (this.align == 'above') {\n g.restore();\n }\n\n oc.registerGlyph(this);\n}\n\nLabelledGlyph.prototype.drawOverlay = function(g, minVisible, maxVisible) {\n g.fillStyle = 'black';\n if (this.font) {\n g.save();\n g.font = this.font;\n }\n var p;\n if ('center' == this.anchor) {\n p = (this.glyph.min() + this.glyph.max() - this.textLen) / 2;\n } else {\n p = this.glyph.min();\n if (p < minVisible) {\n p = Math.min(minVisible, this.glyph.max() - this.textLen);\n }\n }\n g.fillText(this.text, p, this.align == 'above' ? this.textHeight : this.glyph.height() + 15);\n if (this.font) {\n g.restore();\n }\n}\n\n\n\nfunction CrossGlyph(x, height, stroke) {\n this._x = x;\n this._height = height;\n this._stroke = stroke;\n}\n\nCrossGlyph.prototype.draw = function(g) {\n var hh = this._height/2;\n \n g.beginPath();\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n g.moveTo(this._x - hh, hh);\n g.lineTo(this._x + hh, hh);\n\n g.strokeStyle = this._stroke;\n g.lineWidth = 1;\n\n g.stroke();\n}\n\nCrossGlyph.prototype.toSVG = function() {\n var hh = this._height/2;\n\n var g = new SVGPath();\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n g.moveTo(this._x - hh, hh);\n g.lineTo(this._x + hh, hh);\n \n return makeElementNS(\n NS_SVG, 'path',\n null,\n {d: g.toPathData(),\n fill: 'none',\n stroke: this._stroke,\n strokeWidth: '1px'});\n}\n\nCrossGlyph.prototype.min = function() {\n return this._x - this._height/2;\n}\n\nCrossGlyph.prototype.max = function() {\n return this._x + this._height/2;\n}\n\nCrossGlyph.prototype.height = function() {\n return this._height;\n}\n\nfunction ExGlyph(x, height, stroke) {\n this._x = x;\n this._height = height;\n this._stroke = stroke;\n}\n\nExGlyph.prototype.draw = function(g) {\n var hh = this._height/2;\n \n g.beginPath();\n g.moveTo(this._x - hh, 0);\n g.lineTo(this._x + hh, this._height);\n g.moveTo(this._x - hh, this._height);\n g.lineTo(this._x + hh, 0);\n\n g.strokeStyle = this._stroke;\n g.lineWidth = 1;\n\n g.stroke();\n}\n\nExGlyph.prototype.toSVG = function() {\n var hh = this._height/2;\n\n var g = new SVGPath();\n g.moveTo(this._x - hh, 0);\n g.lineTo(this._x + hh, this._height);\n g.moveTo(this._x - hh, this._height);\n g.lineTo(this._x + hh, 0);\n \n return makeElementNS(\n NS_SVG, 'path',\n null,\n {d: g.toPathData(),\n fill: 'none',\n stroke: this._stroke,\n strokeWidth: '1px'});\n}\n\nExGlyph.prototype.min = function() {\n return this._x - this._height/2;\n}\n\nExGlyph.prototype.max = function() {\n return this._x + this._height/2;\n}\n\nExGlyph.prototype.height = function() {\n return this._height;\n}\n\n\n\nfunction TriangleGlyph(x, height, dir, width, fill, stroke) {\n PathGlyphBase.call(this, stroke, fill);\n\n this._x = x;\n this._height = height;\n this._dir = dir;\n this._width = width;\n}\n\nTriangleGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nTriangleGlyph.prototype.drawPath = function(g) {\n var hh = this._height/2;\n var hw = this._width/2;\n\n if (this._dir === 'S') {\n g.moveTo(this._x, this._height);\n g.lineTo(this._x - hw, 0);\n g.lineTo(this._x + hw, 0);\n } else if (this._dir === 'W') {\n g.moveTo(this._x + hw, hh);\n g.lineTo(this._x - hw, 0);\n g.lineTo(this._x - hw, this._height);\n } else if (this._dir === 'E') {\n g.moveTo(this._x - hw, hh);\n g.lineTo(this._x + hw, 0);\n g.lineTo(this._x + hw, this._height);\n } else {\n g.moveTo(this._x , 0);\n g.lineTo(this._x + hw, this._height);\n g.lineTo(this._x - hw, this._height);\n }\n\n g.closePath();\n}\n\nTriangleGlyph.prototype.min = function() {\n return this._x - this._height/2;\n}\n\nTriangleGlyph.prototype.max = function() {\n return this._x + this._height/2;\n}\n\nTriangleGlyph.prototype.height = function() {\n return this._height;\n}\n\n\n\n\nfunction DotGlyph(x, height, fill, stroke) {\n this._x = x;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nDotGlyph.prototype.draw = function(g) {\n var hh = this._height/2;\n g.fillStyle = this._stroke;\n g.beginPath();\n g.arc(this._x, hh, hh, 0, 6.29);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n}\n\nDotGlyph.prototype.toSVG = function() {\n var hh = this._height/2;\n return makeElementNS(\n NS_SVG, 'circle',\n null,\n {cx: this._x, cy: hh, r: hh,\n fill: this._fill || 'none',\n stroke: this._stroke || 'none',\n strokeWidth: '1px'});\n}\n\nDotGlyph.prototype.min = function() {\n return this._x - this._height/2;\n}\n\nDotGlyph.prototype.max = function() {\n return this._x + this._height/2;\n}\n\nDotGlyph.prototype.height = function() {\n return this._height;\n}\n\n\nfunction PaddedGlyph(glyph, minp, maxp) {\n this.glyph = glyph;\n this._min = minp;\n this._max = maxp;\n if (glyph) {\n this.bump = glyph.bump;\n }\n}\n\nPaddedGlyph.prototype.draw = function(g, oc) {\n if (this.glyph) \n this.glyph.draw(g, oc);\n}\n\nPaddedGlyph.prototype.toSVG = function() {\n if (this.glyph) {\n return this.glyph.toSVG();\n } else {\n return makeElementNS(NS_SVG, 'g');\n }\n}\n\nPaddedGlyph.prototype.min = function() {\n return this._min;\n}\n\nPaddedGlyph.prototype.max = function() {\n return this._max;\n}\n\nPaddedGlyph.prototype.height = function() {\n if (this.glyph) {\n return this.glyph.height();\n } else {\n return 1;\n }\n}\n\n\nfunction AArrowGlyph(min, max, height, fill, stroke, ori) {\n PathGlyphBase.call(this, stroke, fill);\n this._min = min;\n this._max = max;\n this._height = height;\n this._ori = ori;\n}\n\nAArrowGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nAArrowGlyph.prototype.min = function() {\n return this._min;\n}\n\nAArrowGlyph.prototype.max = function() {\n return this._max;\n}\n\nAArrowGlyph.prototype.height = function() {\n return this._height;\n}\n\nAArrowGlyph.prototype.drawPath = function(g) {\n var maxPos = this._max;\n var minPos = this._min;\n var height = this._height;\n var lInset = 0;\n var rInset = 0;\n var minLength = this._height + 2;\n var instep = 0.333333 * this._height;\n var y = 0;\n\n if (this._ori) {\n if (this._ori === '+') {\n rInset = 0.5 * this._height;\n } else if (this._ori === '-') {\n lInset = 0.5 * this._height;\n }\n }\n\n if (maxPos - minPos < minLength) {\n minPos = (maxPos + minPos - minLength) / 2;\n maxPos = minPos + minLength;\n }\n\n g.moveTo(minPos + lInset, y+instep);\n g.lineTo(maxPos - rInset, y+instep);\n g.lineTo(maxPos - rInset, y);\n g.lineTo(maxPos, y + this._height/2);\n g.lineTo(maxPos - rInset, y+height);\n g.lineTo(maxPos - rInset, y+instep+instep);\n g.lineTo(minPos + lInset, y+instep+instep);\n g.lineTo(minPos + lInset, y+height);\n g.lineTo(minPos, y+height/2);\n g.lineTo(minPos + lInset, y);\n g.lineTo(minPos + lInset, y+instep);\n}\n\nfunction SpanGlyph(min, max, height, stroke) {\n PathGlyphBase.call(this, stroke, null);\n this._min = min;\n this._max = max;\n this._height = height;\n}\n\nSpanGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nSpanGlyph.prototype.min = function() {return this._min};\nSpanGlyph.prototype.max = function() {return this._max};\nSpanGlyph.prototype.height = function() {return this._height};\n\nSpanGlyph.prototype.drawPath = function(g) {\n var minPos = this._min, maxPos = this._max;\n var height = this._height, hh = height/2;\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n g.moveTo(minPos, 0);\n g.lineTo(minPos, height);\n g.moveTo(maxPos, 0);\n g.lineTo(maxPos, height);\n}\n\nfunction LineGlyph(min, max, height, style, strand, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._style = style;\n this._strand = strand;\n this._stroke = stroke;\n}\n\nLineGlyph.prototype.min = function() {return this._min};\nLineGlyph.prototype.max = function() {return this._max};\nLineGlyph.prototype.height = function() {return this._height};\n\nLineGlyph.prototype.drawPath = function(g) {\n var minPos = this._min, maxPos = this._max;\n var height = this._height, hh = height/2;\n\n if (this._style === 'hat') {\n g.moveTo(minPos, hh);\n g.lineTo((minPos + maxPos)/2, this._strand === '-' ? height : 0);\n g.lineTo(maxPos, hh);\n } else {\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n }\n}\n\n\nLineGlyph.prototype.draw = function(g) {\n g.beginPath();\n this.drawPath(g);\n g.strokeStyle = this._stroke;\n if (this._style === 'dashed' && g.setLineDash) {\n g.save();\n g.setLineDash([3]);\n g.stroke();\n g.restore();\n } else {\n g.stroke();\n }\n}\n\nLineGlyph.prototype.toSVG = function() {\n var g = new SVGPath();\n this.drawPath(g);\n \n var opts = {d: g.toPathData(),\n stroke: this._stroke || 'none'};\n if (this._style === 'dashed') {\n opts['strokeDasharray'] = '3';\n }\n\n return makeElementNS(\n NS_SVG, 'path',\n null, opts\n );\n}\n\n\n\n\n\nfunction PrimersGlyph(min, max, height, fill, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nPrimersGlyph.prototype.min = function() {return this._min};\nPrimersGlyph.prototype.max = function() {return this._max};\nPrimersGlyph.prototype.height = function() {return this._height};\n\n\nPrimersGlyph.prototype.drawStemPath = function(g) {\n var minPos = this._min, maxPos = this._max;\n var height = this._height, hh = height/2;\n g.moveTo(minPos, hh);\n g.lineTo(maxPos, hh);\n}\n\nPrimersGlyph.prototype.drawTrigsPath = function(g) {\n var minPos = this._min, maxPos = this._max;\n var height = this._height, hh = height/2;\n g.moveTo(minPos, 0);\n g.lineTo(minPos + height, hh);\n g.lineTo(minPos, height);\n g.lineTo(minPos, 0);\n g.moveTo(maxPos, 0);\n g.lineTo(maxPos - height, hh);\n g.lineTo(maxPos, height);\n g.lineTo(maxPos, 0);\n}\n\n\nPrimersGlyph.prototype.draw = function(g) {\n g.beginPath();\n this.drawStemPath(g);\n g.strokeStyle = this._stroke;\n g.stroke();\n g.beginPath();\n this.drawTrigsPath(g);\n g.fillStyle = this._fill;\n g.fill();\n}\n\nPrimersGlyph.prototype.toSVG = function() {\n var s = new SVGPath();\n this.drawStemPath(s);\n var t = new SVGPath();\n this.drawTrigsPath(t);\n \n return makeElementNS(\n NS_SVG, 'g',\n [makeElementNS(\n NS_SVG, 'path',\n null,\n {d: s.toPathData(),\n stroke: this._stroke || 'none'}),\n makeElementNS(\n NS_SVG, 'path',\n null,\n {d: t.toPathData(),\n fill: this._fill || 'none'})]);\n}\n\nfunction ArrowGlyph(min, max, height, color, parallel, sw, ne) {\n PathGlyphBase.call(this, null, color);\n this._min = min;\n this._max = max;\n this._height = height;\n this._color = color;\n this._parallel = parallel;\n this._sw = sw;\n this._ne = ne;\n}\n\nArrowGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nArrowGlyph.prototype.min = function() {return this._min};\nArrowGlyph.prototype.max = function() {return this._max};\nArrowGlyph.prototype.height = function() {return this._height};\n\nArrowGlyph.prototype.drawPath = function(g) {\n var min = this._min, max = this._max, height = this._height;\n \n if (this._parallel) {\n var hh = height/2;\n var instep = 0.4 * height;\n if (this._sw) {\n g.moveTo(min + hh, height-instep);\n g.lineTo(min + hh, height);\n g.lineTo(min, hh);\n g.lineTo(min + hh, 0);\n g.lineTo(min + hh, instep);\n } else {\n g.moveTo(min, height-instep);\n g.lineTo(min, instep);\n }\n if (this._ne) {\n g.lineTo(max - hh, instep);\n g.lineTo(max - hh, 0);\n g.lineTo(max, hh);\n g.lineTo(max - hh, height);\n g.lineTo(max - hh, height - instep);\n } else {\n g.lineTo(max, instep);\n g.lineTo(max, height-instep);\n }\n g.closePath();\n } else {\n var mid = (min+max)/2;\n var instep = 0.4*(max-min);\n var th = height/3;\n\n if (this._ne) {\n g.moveTo(min + instep, th);\n g.lineTo(min, th);\n g.lineTo(mid, 0);\n g.lineTo(max, th);\n g.lineTo(max - instep, th);\n } else {\n g.moveTo(min+instep, 0);\n g.lineTo(max-instep, 0);\n }\n if (this._sw) {\n g.lineTo(max - instep, height-th);\n g.lineTo(max, height-th);\n g.lineTo(mid, height);\n g.lineTo(min, height-th)\n g.lineTo(min + instep, height-th);\n } else {\n g.lineTo(max - instep, height);\n g.lineTo(min + instep, height);\n }\n g.closePath();\n }\n}\n\n\nfunction TooManyGlyph(min, max, height, fill, stroke) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._stroke = stroke;\n}\n\nTooManyGlyph.prototype.min = function() {return this._min};\nTooManyGlyph.prototype.max = function() {return this._max};\nTooManyGlyph.prototype.height = function() {return this._height};\n\nTooManyGlyph.prototype.toSVG = function() {\n return makeElementNS(NS_SVG, 'rect', null,\n {x: this._min, \n y: 0, \n width: this._max - this._min, \n height: this._height,\n stroke: this._stroke || 'none',\n fill: this._fill || 'none'});\n}\n\nTooManyGlyph.prototype.draw = function(g) {\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fillRect(this._min, 0, this._max - this._min, this._height);\n }\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.strokeRect(this._min, 0, this._max - this._min, this._height);\n g.beginPath();\n for (var n = 2; n < this._height; n += 3) {\n g.moveTo(this._min, n);\n g.lineTo(this._max, n);\n }\n g.stroke();\n }\n}\n\nfunction TextGlyph(GLOBAL_GC, min, max, height, fill, string) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._string = string;\n this._textLen = GLOBAL_GC.measureText(string).width;\n}\n\nTextGlyph.prototype.min = function() {return this._min};\nTextGlyph.prototype.max = function() {return Math.max(this._max, this._min + this._textLen)};\nTextGlyph.prototype.height = function() {return this._height};\n\nTextGlyph.prototype.draw = function(g) {\n g.fillStyle = this._fill;\n g.fillText(this._string, this._min, this._height - 4);\n}\n\nTextGlyph.prototype.toSVG = function() {\n return makeElementNS(NS_SVG, 'text', this._string, {x: this._min, y: this._height - 4});\n};\n\nfunction aminoTileColor(aa, start, color) {\n var ALTERNATE_COLOR = {\n 'red': 'darkred',\n 'purple': 'mediumpurple',\n 'blue': 'darkblue',\n 'green': 'darkgreen'\n };\n var color2 = ALTERNATE_COLOR[color.toLowerCase()];\n var tileColors;\n if (!color2)\n tileColors = ['rgb(73, 68, 149)', 'rgb(9, 0, 103)'];\n // default to UCSC colors\n else\n tileColors = [color, color2];\n\n if (aa == '?')\n return 'black';\n else if (aa == 'M')\n return 'greenyellow';\n else if (aa == '*')\n return 'crimson';\n else\n return tileColors[start % 2];\n}\n\nfunction reverseComplement(sequence) {\n var seq_dict = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'};\n var rev_seq = sequence.split('').reverse().join('');\n var rev_compl_seq = [];\n for (var b = 0; b < rev_seq.length; ++b) {\n var base = rev_seq.substr(b, 1).toUpperCase();\n rev_compl_seq.push(base in seq_dict ? seq_dict[base] : 'N');\n }\n return rev_compl_seq.join('');\n}\n\nfunction AminoAcidGlyph(min, max, height, fill, seq, orientation, readframe) {\n this._min = min;\n this._max = max;\n this._height = height;\n this._fill = fill;\n this._seq = seq;\n this._orientation = orientation;\n this._readframe = readframe;\n}\n\nAminoAcidGlyph.prototype.min = function() {return this._min};\nAminoAcidGlyph.prototype.max = function() {return this._max};\nAminoAcidGlyph.prototype.height = function() {return this._height};\n\nAminoAcidGlyph.prototype.draw = function(gc) {\n var seq = this._seq;\n var color = this._fill;\n\n if (!seq) return;\n\n var scale = (this._max - this._min + 1) / seq.length;\n\n var prevOverhang = (3 - this._readframe) % 3;\n var nextOverhang = (seq.length - prevOverhang) % 3;\n var leftOverhang = this._orientation == '+' ? prevOverhang : nextOverhang;\n \n if (leftOverhang > 0) {\n gc.fillStyle = color;\n gc.fillRect(this._min, 0, scale * leftOverhang, this._height);\n }\n\n for (var p = leftOverhang; p < seq.length; p += 3) {\n var codon = seq.substr(p, 3).toUpperCase();\n if (this._orientation == '-')\n codon = reverseComplement(codon);\n var aa = codon in AMINO_ACID_TRANSLATION ? AMINO_ACID_TRANSLATION[codon] : '?';\n color = codon.length == 3 ? aminoTileColor(aa, p, this._fill) : this._fill;\n gc.fillStyle = color;\n gc.fillRect(this._min + p * scale, 0, scale * codon.length, this._height);\n\n if (scale >= 8 && codon.length == 3) {\n gc.fillStyle = 'white';\n gc.fillText(aa, this._min + (p+1) * scale, this._height);\n } \n }\n}\n\nAminoAcidGlyph.prototype.toSVG = function() {\n var g = makeElementNS(NS_SVG, 'g');\n var seq = this._seq;\n var color = this._fill;\n\n if (!seq)\n return g;\n\n var scale = (this._max - this._min + 1) / seq.length;\n\n var prevOverhang = (3 - this._readframe) % 3;\n var nextOverhang = (seq.length - prevOverhang) % 3;\n var leftOverhang = this._orientation == '+' ? prevOverhang : nextOverhang;\n\n if (leftOverhang > 0) {\n g.appendChild(\n makeElementNS(NS_SVG, 'rect', null, {\n x: this._min,\n y: 0,\n width: scale * leftOverhang,\n height: this._height,\n fill: color}));\n }\n for (var p = leftOverhang; p < seq.length; p += 3) {\n var codon = seq.substr(p, 3).toUpperCase();\n if (this._orientation == '-')\n codon = reverseComplement(codon);\n var aa = codon in AMINO_ACID_TRANSLATION ? AMINO_ACID_TRANSLATION[codon] : '?';\n color = codon.length == 3 ? aminoTileColor(aa, p, this._fill) : this._fill;\n g.appendChild(\n makeElementNS(NS_SVG, 'rect', null, {\n x: this._min + p * scale,\n y: 0,\n width: scale * codon.length,\n height: this._height,\n fill: color}));\n\n if (scale >= 8 && codon.length == 3) {\n g.appendChild(\n makeElementNS(NS_SVG, 'text', aa, {\n x: this._min + (p+1) * scale,\n y: this._height,\n fill: 'white'}));\n }\n }\n return g;\n};\n\nvar isRetina = typeof(window) !== 'undefined' && window.devicePixelRatio > 1;\nvar __dalliance_SequenceGlyphCache = {};\nvar altPattern = new RegExp('^[ACGT-]$');\nvar isCloseUp = function(scale) {\n return scale >= 8;\n}\n\nfunction SequenceGlyph(baseColors, strandColor, min, max, height, seq, ref, scheme, quals, fillbg, scaleVertical) {\n this.baseColors = baseColors;\n this._strandColor = strandColor;\n this._min = min;\n this._max = max;\n this._height = height;\n this._seq = seq;\n this._ref = ref;\n this._scheme = scheme;\n this._quals = quals;\n this._fillbg = fillbg;\n this._scaleVertical = scaleVertical;\n}\n\nSequenceGlyph.prototype.min = function() {return this._min};\nSequenceGlyph.prototype.max = function() {return this._max};\nSequenceGlyph.prototype.height = function() {return this._height};\n\n\nSequenceGlyph.prototype.alphaForQual = function(qual) {\n return 0.1 + 0.9*Math.max(0.0, Math.min((1.0 * qual) / 30.0, 1.0));\n}\n\nSequenceGlyph.prototype.draw = function(gc) {\n var seq = this._seq;\n var ref = this._ref;\n var mismatch = this._scheme === 'mismatch' || this._scheme === 'mismatch-all';\n var all = this._scheme === 'mismatch-all';\n \n var seqLength = seq ? seq.length : (this._max - this._min + 1);\n var scale = (this._max - this._min + 1) / seqLength;\n\n if (mismatch && !isCloseUp(scale)) {\n gc.fillStyle = this._strandColor;\n if (this._scaleVertical)\n gc.fillRect(this._min, scale, this._max - this._min, scale);\n else\n gc.fillRect(this._min, this._height/4, this._max - this._min, this._height/2);\n }\n\n \n for (var p = 0; p < seqLength; ++p) {\n var base = seq ? seq.substr(p, 1).toUpperCase() : 'N';\n \n if (!altPattern.test(base) && !isCloseUp(scale))\n continue;\n\n var color = this.baseColors[base];\n\n if (this._quals) {\n var qc = this._quals.charCodeAt(p) - 33;\n var oldAlpha = gc.globalAlpha; // NB hoisted!\n gc.globalAlpha = this.alphaForQual(qc);\n }\n\n if (!color) {\n var refBase = ref ? ref.substr(p, 1).toUpperCase() : 'N';\n if (base == 'N' || refBase == 'N')\n color = 'gray';\n else\n color = this._strandColor;\n\n if (all)\n base = refBase;\n }\n\n gc.fillStyle = color;\n\n var alt = altPattern.test(base);\n if (this._fillbg || !isCloseUp(scale) || !alt) {\n if (this._scaleVertical)\n gc.fillRect(this._min + p*scale, scale, scale, scale);\n else\n gc.fillRect(this._min + p*scale, 0, scale, this._height);\n }\n if (isCloseUp(scale) && alt) {\n var key = color + '_' + base\n var img = __dalliance_SequenceGlyphCache[key];\n if (!img) {\n img = document.createElement('canvas');\n if (isRetina) {\n img.width = 16;\n img.height = 20;\n } else {\n img.width = 8;\n img.height = 10;\n }\n var imgGc = img.getContext('2d');\n if (isRetina) {\n imgGc.scale(2, 2);\n }\n imgGc.fillStyle = this._fillbg ? 'black' : color;\n var w = imgGc.measureText(base).width;\n imgGc.fillText(base, 0.5 * (8.0 - w), 8);\n __dalliance_SequenceGlyphCache[key] = img;\n }\n var dy = this._scaleVertical ? scale : 0;\n if (isRetina)\n gc.drawImage(img, this._min + p*scale + 0.5*(scale-8), dy, 8, 10);\n else\n gc.drawImage(img, this._min + p*scale + 0.5*(scale-8), dy);\n } \n\n if (this._quals) {\n gc.globalAlpha = oldAlpha;\n }\n }\n}\n\nSequenceGlyph.prototype.toSVG = function() {\n var seq = this._seq;\n var ref = this._ref;\n var mismatch = this._scheme === 'mismatch' || this._scheme === 'mismatch-all';\n var all = this._scheme === 'mismatch-all';\n var scale = (this._max - this._min + 1) / this._seq.length;\n var g = makeElementNS(NS_SVG, 'g'); \n\n for (var p = 0; p < seq.length; ++p) {\n var base = seq ? seq.substr(p, 1).toUpperCase() : 'N';\n var color = this.baseColors[base];\n\n if (!color) {\n var refBase = ref ? ref.substr(p, 1).toUpperCase() : 'N';\n if (base == 'N' || refBase == 'N')\n color = 'gray';\n else\n color = this._strandColor;\n\n if (all)\n base = refBase;\n }\n\n var alpha = 1.0;\n if (this._quals) {\n var qc = this._quals.charCodeAt(p) - 33;\n alpha = this.alphaForQual(qc);\n }\n\n var alt = altPattern.test(base);\n if (this._fillbg || !isCloseUp(scale) || !alt) {\n g.appendChild(\n makeElementNS(NS_SVG, 'rect', null, {\n x:this._min + p*scale,\n y: 0,\n width: scale,\n height: this._height,\n fill: color,\n fillOpacity: alpha}));\n }\n\n if (isCloseUp(scale) && alt) {\n g.appendChild(\n makeElementNS(NS_SVG, 'text', base, {\n x: this._min + (0.5+p)*scale,\n y: 8,\n textAnchor: 'middle',\n fill: this._fillbg ? 'black' : color,\n fillOpacity: alpha}));\n }\n }\n\n return g;\n}\n\nfunction TranslatedGlyph(glyph, x, y, height) {\n this.glyph = glyph;\n this._height = height;\n this._x = x;\n this._y = y;\n}\n\nTranslatedGlyph.prototype.height = function() {\n if (this._height) {\n return this._height;\n } else {\n return this.glyph.height() + this._y;\n }\n}\n\nTranslatedGlyph.prototype.min = function() {\n return this.glyph.min() + this._x;\n}\n\nTranslatedGlyph.prototype.max = function() {\n return this.glyph.max() + this._x;\n}\n\nTranslatedGlyph.prototype.minY = function() {\n return this._y;\n}\n\nTranslatedGlyph.prototype.maxY = function() {\n return this._y + this.glyph.height();\n}\n\nTranslatedGlyph.prototype.draw = function(g, o) {\n g.save();\n g.translate(this._x, this._y);\n this.glyph.draw(g, o);\n g.restore();\n}\n\nTranslatedGlyph.prototype.toSVG = function() {\n var s = this.glyph.toSVG();\n s.setAttribute('transform', 'translate(' + this._x + ',' + this._y + ')');\n return s;\n}\n\nfunction PointGlyph(x, y, height, fill) {\n this._x = x;\n this._y = y;\n this._height = height;\n this._fill = fill;\n}\n\nPointGlyph.prototype.min = function() {\n return this._x - 2;\n}\n\nPointGlyph.prototype.max = function() {\n return this._x + 2;\n}\n\nPointGlyph.prototype.height = function() {\n return this._height;\n}\n\nPointGlyph.prototype.draw = function(g) {\n g.save();\n g.globalAlpha = 0.3;\n g.fillStyle = this._fill;\n g.beginPath();\n g.arc(this._x, this._y, 1.5, 0, 6.29);\n g.fill();\n g.restore();\n}\n\nPointGlyph.prototype.toSVG = function() {\n return makeElementNS(\n NS_SVG, 'circle',\n null,\n {cx: this._x, cy: this._y, r: 2,\n fill: this._fill,\n stroke: 'none'});\n}\n\n\nfunction GridGlyph(height, yOffset, spacing) {\n this._height = height || 50;\n this.yOffset = yOffset || 0;\n this.spacing = spacing || 10;\n}\n\nGridGlyph.prototype.notSelectable = true;\n\nGridGlyph.prototype.min = function() {\n return -100000;\n};\n\nGridGlyph.prototype.max = function() {\n return 100000;\n};\n\nGridGlyph.prototype.height = function() {\n return this._height;\n}\n\nGridGlyph.prototype.draw = function(g) {\n g.save();\n g.strokeStyle = 'black'\n g.lineWidth = 0.1;\n\n g.beginPath();\n for (var y = this.yOffset; y <= this._height+this.yOffset; y += this.spacing) {\n // for (var y = 0; y <= this._height; y += 10) {\n g.moveTo(-5000, y);\n g.lineTo(5000, y);\n }\n g.stroke();\n g.restore();\n}\n\nGridGlyph.prototype.toSVG = function() {\n var p = new SVGPath();\n for (var y = 0; y <= this._height; y += 10) {\n p.moveTo(-5000, y);\n p.lineTo(5000, y);\n }\n \n return makeElementNS(\n NS_SVG, 'path',\n null,\n {d: p.toPathData(),\n fill: 'none',\n stroke: 'black',\n strokeWidth: '0.1px'});\n}\n\nfunction StarGlyph(x, r, points, fill, stroke) {\n PathGlyphBase.call(this, stroke, fill);\n this._x = x;\n this._r = r;\n this._points = points;\n}\n\nStarGlyph.prototype = Object.create(PathGlyphBase.prototype);\n\nStarGlyph.prototype.min = function() {\n return this._x - this._r;\n}\n\nStarGlyph.prototype.max = function() {\n return this._x + this._r;\n}\n\nStarGlyph.prototype.height = function() {\n return 2 * this._r;\n}\n\nStarGlyph.prototype.drawPath = function(g) {\n var midX = this._x, midY = this._r, r = this._r;\n for (var p = 0; p < this._points; ++p) {\n var theta = (p * 6.28) / this._points;\n var px = midX + r*Math.sin(theta);\n var py = midY - r*Math.cos(theta);\n if (p == 0) {\n g.moveTo(px, py);\n } else {\n g.lineTo(px, py);\n }\n theta = ((p+0.5) * 6.28) / this._points;\n px = midX + 0.4*r*Math.sin(theta);\n py = midY - 0.4*r*Math.cos(theta);\n g.lineTo(px, py);\n }\n g.closePath();\n}\n\nfunction PlimsollGlyph(x, height, overhang, fill, stroke) {\n this._x = x;\n this._height = height;\n this._overhang = overhang;\n this._fill = fill;\n this._stroke = stroke;\n this._hh = height / 2;\n}\n\nPlimsollGlyph.prototype.draw = function(g) {\n var hh = this._height/2;\n g.fillStyle = this._stroke;\n g.beginPath();\n g.arc(this._x, hh, hh - this._overhang, 0, 6.29);\n g.moveTo(this._x, 0);\n g.lineTo(this._x, this._height);\n\n if (this._fill) {\n g.fillStyle = this._fill;\n g.fill();\n }\n\n if (this._stroke) {\n g.strokeStyle = this._stroke;\n g.stroke();\n }\n}\n\nPlimsollGlyph.prototype.toSVG = function() {\n var hh = this._hh;\n return makeElementNS(NS_SVG, 'g', \n [makeElementNS(NS_SVG, 'circle', null, {cx: this._x, cy: hh, r: hh - this._overhang}),\n makeElementNS(NS_SVG, 'line', null, {x1: this._x, y1: 0, x2: this._x, y2: this._height})],\n {fill: this._fill || 'none',\n stroke: this._stroke || 'none',\n strokeWidth: '1px'});\n}\n\nPlimsollGlyph.prototype.min = function() {\n return this._x - this._hh;\n}\n\nPlimsollGlyph.prototype.max = function() {\n return this._x + this._hh;\n}\n\nPlimsollGlyph.prototype.height = function() {\n return this._height;\n}\n\n\nfunction OverlayLabelCanvas() {\n this.ox = 0;\n this.oy = 0;\n this.glyphs = [];\n}\n\nOverlayLabelCanvas.prototype.translate = function(x, y) {\n this.ox += x;\n this.oy += y;\n}\n\nOverlayLabelCanvas.prototype.registerGlyph = function(g) {\n this.glyphs.push({\n x: this.ox,\n y: this.oy,\n glyph: g\n });\n}\n\n\nOverlayLabelCanvas.prototype.draw = function(g, minVisible, maxVisible) {\n for (var gi = 0; gi < this.glyphs.length; ++gi) {\n var gg = this.glyphs[gi];\n g.save();\n g.translate(gg.x, gg.y);\n gg.glyph.drawOverlay(g, minVisible, maxVisible);\n g.restore();\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n BoxGlyph: BoxGlyph,\n GroupGlyph: GroupGlyph,\n LineGraphGlyph: LineGraphGlyph,\n LabelledGlyph: LabelledGlyph,\n CrossGlyph: CrossGlyph,\n ExGlyph: ExGlyph,\n TriangleGlyph: TriangleGlyph,\n DotGlyph: DotGlyph,\n PaddedGlyph: PaddedGlyph,\n AArrowGlyph: AArrowGlyph,\n SpanGlyph: SpanGlyph,\n LineGlyph: LineGlyph,\n PrimersGlyph: PrimersGlyph,\n ArrowGlyph: ArrowGlyph,\n TooManyGlyph: TooManyGlyph,\n TextGlyph: TextGlyph,\n SequenceGlyph: SequenceGlyph,\n AminoAcidGlyph: AminoAcidGlyph,\n TranslatedGlyph: TranslatedGlyph,\n GridGlyph: GridGlyph,\n StarGlyph: StarGlyph,\n PointGlyph: PointGlyph,\n PlimsollGlyph: PlimsollGlyph,\n\n OverlayLabelCanvas: OverlayLabelCanvas\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// jbjson.js -- query JBrowse-style REST data stores\n//\n\nif (typeof(require) !== 'undefined') {\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n}\n\nfunction JBrowseStore(base, query) {\n this.base = base;\n this.query = query;\n}\n\nfunction jbori(strand) {\n if (strand > 0)\n return '+';\n else if (strand < 0)\n return '-';\n}\n\nJBrowseStore.prototype.features = function(segment, opts, callback) {\n opts = opts || {};\n\n url = this.base + '/features/' + segment.name;\n\n var filters = [];\n if (this.query) {\n\t filters.push(this.query);\n }\n if (segment.isBounded) {\n \tfilters.push('start=' + segment.start);\n \tfilters.push('end=' + segment.end);\n }\n if (filters.length > 0) {\n\t url = url + '?' + filters.join('&');\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n\tif (req.readyState == 4) {\n\t if (req.status >= 300) {\n\t\t callback(null, 'Error code ' + req.status);\n\t } else {\n\t\tvar jf = JSON.parse(req.response)['features'];\n\t\tvar features = [];\n\t\tfor (fi = 0; fi < jf.length; ++fi) {\n\t\t var j = jf[fi];\n\t\t \n\t\t var f = new DASFeature();\n\t\t f.segment = segment.name;\n\t\t f.min = (j['start'] | 0) + 1;\n\t\t f.max = j['end'] | 0;\n\t\t if (j.name) {\n\t\t\tf.label = j.name;\n\t\t }\n if (j.strand)\n f.orientation = jbori(j.strand);\n\t\t f.type = j.type || 'unknown';\n\n if (j.subfeatures && j.subfeatures.length > 0) {\n f.id = j.uniqueID;\n\n var blocks = [];\n var cds = [];\n var all = [];\n\n for (var si = 0; si < j.subfeatures.length; ++si) {\n var sj = j.subfeatures[si];\n var sf = shallowCopy(f);\n sf.min = sj.start + 1;\n sf.max = sj.end;\n sf.groups = [f];\n\n all.push(sf);\n blocks.push(new Range(sf.min, sf.max));\n if (sj.type === 'CDS')\n cds.push(sf);\n }\n \n if (cds.length > 0) {\n spans = union(blocks);\n var txGroup = shallowCopy(f);\n txGroup.type = 'transcript';\n spans.ranges().forEach(function(exon) {\n features.push({\n segment: segment.name,\n min: exon.min(),\n max: exon.max(),\n orientation: f.orientation,\n groups: [txGroup],\n type: 'transcript'\n });\n });\n\n var tlGroup = shallowCopy(f);\n cds.forEach(function(cdsExon) {\n cdsExon.type = 'translation'\n cdsExon.groups = [tlGroup];\n features.push(cdsExon);\n });\n } else {\n all.forEach(function(f) {\n features.push(f);\n });\n }\n } else {\n\t\t features.push(f);\n }\n\t\t}\n\t\tcallback(features);\n\t }\n\t}\n\t\n };\n \n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n JBrowseStore: JBrowseStore\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n//\n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// kspace.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var pusho = utils.pusho;\n\n var sa = require('./sourceadapters');\n var MappedFeatureSource = sa.MappedFeatureSource;\n var CachingFeatureSource = sa.CachingFeatureSource;\n var BWGFeatureSource = sa.BWGFeatureSource;\n var RemoteBWGFeatureSource = sa.RemoteBWGFeatureSource;\n var BAMFeatureSource = sa.BAMFeatureSource;\n var RemoteBAMFeatureSource = sa.RemoteBAMFeatureSource;\n var DummySequenceSource = sa.DummySequenceSource;\n var DummyFeatureSource = sa.DummyFeatureSource;\n\n var OverlayFeatureSource = require('./overlay').OverlayFeatureSource;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var sample = require('./sample');\n var downsample = sample.downsample;\n var getBaseCoverage = sample.getBaseCoverage;\n\n var das = require('./das');\n var DASSequence = das.DASSequence;\n\n var Promise = require('es6-promise').Promise;\n}\n\nfunction FetchPool() {\n var self = this;\n this.reqs = [];\n this.awaitedFeatures = {};\n this.requestsIssued = new Promise(function(resolve, reject) {\n self.notifyRequestsIssued = resolve;\n });\n}\n\nFetchPool.prototype.addRequest = function(xhr) {\n this.reqs.push(xhr);\n}\n\nFetchPool.prototype.abortAll = function() {\n for (var i = 0; i < this.reqs.length; ++i) {\n this.reqs[i].abort();\n }\n}\n\nfunction KSCacheBaton(chr, min, max, scale, features, status, coverage) {\n this.chr = chr;\n this.min = min;\n this.max = max;\n this.coverage = coverage;\n this.scale = scale;\n this.features = features || [];\n this.status = status;\n}\n\nKSCacheBaton.prototype.toString = function() {\n return this.chr + \":\" + this.min + \"..\" + this.max + \";scale=\" + this.scale;\n}\n\nfunction KnownSpace(tierMap, chr, min, max, scale, seqSource) {\n this.tierMap = tierMap;\n this.chr = chr;\n this.min = min;\n this.max = max;\n this.scale = scale;\n this.seqSource = seqSource || new DummySequenceSource();\n this.viewCount = 0;\n\n this.featureCache = {};\n this.latestViews = {};\n}\n\nKnownSpace.prototype.cancel = function() {\n this.cancelled = true;\n}\n\nKnownSpace.prototype.bestCacheOverlapping = function(chr, min, max) {\n var baton = this.featureCache[this.tierMap[0]];\n if (baton) {\n return baton;\n } else {\n return null;\n }\n}\n\nKnownSpace.prototype.retrieveFeatures = function(tiers, chr, min, max, scale) {\n if (scale != scale) {\n throw \"retrieveFeatures called with silly scale\";\n }\n\n if (chr != this.chr) {\n throw \"Can't extend Known Space to a new chromosome\";\n }\n if (min < 1) {\n min = 1;\n }\n\n this.min = min;\n this.max = max;\n this.scale = scale;\n\n if (this.pool) {\n this.pool.abortAll();\n }\n this.pool = new FetchPool();\n this.awaitedSeq = new Awaited();\n this.seqWasFetched = false;\n this.viewCount++;\n\n this.startFetchesForTiers(tiers);\n this.pool.notifyRequestsIssued();\n}\n\nfunction filterFeatures(features, min, max) {\n var ff = [];\n var featuresByGroup = {};\n\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (!f.min || !f.max) {\n ff.push(f);\n } else if (f.groups && f.groups.length > 0) {\n pusho(featuresByGroup, f.groups[0].id, f);\n } else if (f.min <= max && f.max >= min) {\n ff.push(f);\n }\n }\n\n for (var gid in featuresByGroup) {\n var gf = featuresByGroup[gid];\n var gmin = 100000000000, gmax = -100000000000;\n for (var fi = 0; fi < gf.length; ++fi) {\n var f = gf[fi];\n gmin = Math.min(gmin, f.min);\n gmax = Math.max(gmax, f.max);\n }\n if (gmin <= max || gmax >= min) {\n for (var fi = 0; fi < gf.length; ++fi) {\n ff.push(gf[fi]);\n }\n }\n }\n\n return ff;\n}\n\nKnownSpace.prototype.invalidate = function(tier) {\n if (!this.pool) {\n return;\n }\n\n this.featureCache[tier] = null;\n this.startFetchesForTiers([tier]);\n}\n\nKnownSpace.prototype.startFetchesForTiers = function(tiers) {\n var thisB = this;\n\n var awaitedSeq = this.awaitedSeq;\n var needSeq = false;\n\n var gex;\n\n for (var t = 0; t < tiers.length; ++t) {\n var tierRenderer = tiers[t].browser.getTierRenderer(tiers[t]);\n try {\n if (this.startFetchesFor(tiers[t], awaitedSeq)) {\n needSeq = true;\n }\n } catch (ex) {\n var tier = tiers[t];\n\n tier.currentFeatures = [];\n tier.currentSequence = null;\n console.log('Error fetching tier source');\n console.log(ex);\n gex = ex;\n console.log(ex.stack);\n tierRenderer.renderTier(ex, tier);\n tier.wasRendered();\n }\n }\n\n if (needSeq && !this.seqWasFetched) {\n this.seqWasFetched = true;\n var smin = this.min, smax = this.max;\n\n if (this.cs) {\n if (this.cs.start <= smin && this.cs.end >= smax) {\n var cachedSeq;\n if (this.cs.start == smin && this.cs.end == smax) {\n cachedSeq = this.cs;\n } else {\n cachedSeq = new DASSequence(this.cs.name, smin, smax, this.cs.alphabet,\n this.cs.seq.substring(smin - this.cs.start, smax + 1 - this.cs.start));\n }\n return awaitedSeq.provide(cachedSeq);\n }\n }\n\n this.seqSource.fetch(this.chr, smin, smax, this.pool, function(err, seq) {\n if (seq) {\n if (!thisB.cs || (smin <= thisB.cs.start && smax >= thisB.cs.end) ||\n (smin >= thisB.cs.end) || (smax <= thisB.cs.start) ||\n ((smax - smin) > (thisB.cs.end - thisB.cs.start)))\n {\n thisB.cs = seq;\n }\n awaitedSeq.provide(seq);\n } else {\n console.log('Sequence loading failed', err);\n awaitedSeq.provide(null);\n }\n });\n }\n\n if (gex)\n throw gex;\n}\n\nKnownSpace.prototype.startFetchesFor = function(tier, awaitedSeq) {\n var thisB = this;\n\n var viewID = this.viewCount;\n var source = tier.getSource() || new DummyFeatureSource();\n var needsSeq = tier.needsSequence(this.scale);\n var baton = thisB.featureCache[tier];\n var styleFilters = tier.getActiveStyleFilters(this.scale);\n var wantedTypes;\n if (styleFilters)\n wantedTypes = styleFilters.typeList();\n var chr = this.chr, min = this.min, max = this.max;\n\n\n if (wantedTypes === undefined) {\n return false;\n }\n if (baton && baton.chr === this.chr && baton.min <= min && baton.max >= max) {\n var cachedFeatures = baton.features;\n if (baton.min < min || baton.max > max) {\n cachedFeatures = filterFeatures(cachedFeatures, min, max);\n }\n\n thisB.provision(tier, baton.chr,\n intersection(baton.coverage, new Range(min, max)),\n baton.scale, wantedTypes,\n cachedFeatures, baton.status,\n needsSeq ? awaitedSeq : null);\n\n var availableScales = source.getScales();\n\n if (baton.scale <= this.scale || !availableScales) {\n return needsSeq;\n }\n }\n\n if (source.instrument)\n console.log('Starting fetch ' + viewID + ' (' + min + ', ' + max + ')');\n\n\n source.fetch(chr, min, max, this.scale, wantedTypes, this.pool, function(status, features, scale, coverage) {\n if (source.instrument)\n console.log('Finishing fetch ' + viewID);\n\n var latestViewID = thisB.latestViews[tier] || -1;\n if (thisB.cancelled || latestViewID > viewID) {\n return;\n }\n\n if (!coverage) {\n coverage = new Range(min, max);\n }\n\n if (!baton || (min < baton.min) || (max > baton.max)) { // FIXME should be merging in some cases?\n thisB.featureCache[tier] = new KSCacheBaton(chr, min, max, scale, features, status, coverage);\n }\n\n thisB.latestViews[tier] = viewID;\n thisB.provision(tier, chr, coverage, scale, wantedTypes, features, status, needsSeq ? awaitedSeq : null);\n }, styleFilters);\n return needsSeq;\n}\n\nKnownSpace.prototype.provision = function(tier, chr, coverage, actualScale, wantedTypes, features, status, awaitedSeq) {\n var tierRenderer = tier.browser.getTierRenderer(tier);\n if (status) {\n tier.setFeatures(chr, coverage, actualScale, [], null);\n if (!features) {\n var e = new Error(status);\n status = \"Error fetching data: \" + status + \"; see browser console\";\n console.log(\"Error fetching data for tier \" + tier.dasSource.name + \":\");\n console.log(tier.dasSource);\n console.log(\"Stack trace:\");\n console.log(e.stack)\n }\n tierRenderer.renderTier(status, tier);\n tier.wasRendered();\n } else {\n var mayDownsample = false;\n var needBaseComposition = false;\n var src = tier.getSource();\n while (MappedFeatureSource.prototype.isPrototypeOf(src) ||\n CachingFeatureSource.prototype.isPrototypeOf(src) ||\n OverlayFeatureSource.prototype.isPrototypeOf(src)) {\n\n if (OverlayFeatureSource.prototype.isPrototypeOf(src)) {\n src = src.sources[0];\n } else {\n src = src.source;\n }\n }\n if (BWGFeatureSource.prototype.isPrototypeOf(src) ||\n RemoteBWGFeatureSource.prototype.isPrototypeOf(src) ||\n BAMFeatureSource.prototype.isPrototypeOf(src) ||\n RemoteBAMFeatureSource.prototype.isPrototypeOf(src)) {\n\n mayDownsample = true;\n }\n\n if (!src.opts || (!src.opts.forceReduction && !src.opts.noDownsample)) {\n if (/* (actualScale < (this.scale/2) && features.length > 200) || */\n (mayDownsample && wantedTypes && wantedTypes.length == 1 && wantedTypes.indexOf('density') >= 0))\n {\n features = downsample(features, this.scale);\n }\n }\n\n if (wantedTypes && wantedTypes.length == 1 && wantedTypes.indexOf('base-coverage') >= 0)\n {\n // Base-composition coverage track\n needBaseComposition = true;\n }\n\n\n if (awaitedSeq) {\n awaitedSeq.await(function(seq) {\n if (needBaseComposition) {\n features = getBaseCoverage(features, seq, tier.browser.baseColors);\n }\n tier.setFeatures(chr, coverage, actualScale, features, seq);\n tierRenderer.renderTier(status, tier);\n tier.wasRendered()\n });\n } else {\n tier.setFeatures(chr, coverage, actualScale, features);\n tierRenderer.renderTier(status, tier);\n tier.wasRendered();\n }\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n KnownSpace: KnownSpace\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// lh3utils.js: common support for lh3's file formats\n//\n\nif (typeof(require) !== 'undefined') {\n var jszlib = require('jszlib');\n var jszlib_inflate_buffer = jszlib.inflateBuffer;\n var arrayCopy = jszlib.arrayCopy;\n}\n\nfunction Vob(b, o) {\n this.block = b;\n this.offset = o;\n}\n\nVob.prototype.toString = function() {\n return '' + this.block + ':' + this.offset;\n}\n\nfunction readVob(ba, offset, allowZero) {\n var block = ((ba[offset+6] & 0xff) * 0x100000000) + ((ba[offset+5] & 0xff) * 0x1000000) + ((ba[offset+4] & 0xff) * 0x10000) + ((ba[offset+3] & 0xff) * 0x100) + ((ba[offset+2] & 0xff));\n var bint = (ba[offset+1] << 8) | (ba[offset]);\n if (block == 0 && bint == 0 && !allowZero) {\n return null; // Should only happen in the linear index?\n } else {\n return new Vob(block, bint);\n }\n}\n\nfunction unbgzf(data, lim) {\n lim = Math.min(lim || 1, data.byteLength - 50);\n var oBlockList = [];\n var ptr = [0];\n var totalSize = 0;\n\n while (ptr[0] < lim) {\n var ba = new Uint8Array(data, ptr[0], 12); // FIXME is this enough for all credible BGZF block headers?\n var xlen = (ba[11] << 8) | (ba[10]);\n // dlog('xlen[' + (ptr[0]) +']=' + xlen);\n var unc = jszlib_inflate_buffer(data, 12 + xlen + ptr[0], Math.min(65536, data.byteLength - 12 - xlen - ptr[0]), ptr);\n ptr[0] += 8;\n totalSize += unc.byteLength;\n oBlockList.push(unc);\n }\n\n if (oBlockList.length == 1) {\n return oBlockList[0];\n } else {\n var out = new Uint8Array(totalSize);\n var cursor = 0;\n for (var i = 0; i < oBlockList.length; ++i) {\n var b = new Uint8Array(oBlockList[i]);\n arrayCopy(b, 0, out, cursor, b.length);\n cursor += b.length;\n }\n return out.buffer;\n }\n}\n\nfunction Chunk(minv, maxv) {\n this.minv = minv; this.maxv = maxv;\n}\n\n\n//\n// Binning (transliterated from SAM1.3 spec)\n//\n\n/* calculate bin given an alignment covering [beg,end) (zero-based, half-close-half-open) */\nfunction reg2bin(beg, end)\n{\n --end;\n if (beg>>14 == end>>14) return ((1<<15)-1)/7 + (beg>>14);\n if (beg>>17 == end>>17) return ((1<<12)-1)/7 + (beg>>17);\n if (beg>>20 == end>>20) return ((1<<9)-1)/7 + (beg>>20);\n if (beg>>23 == end>>23) return ((1<<6)-1)/7 + (beg>>23);\n if (beg>>26 == end>>26) return ((1<<3)-1)/7 + (beg>>26);\n return 0;\n}\n\n/* calculate the list of bins that may overlap with region [beg,end) (zero-based) */\nvar MAX_BIN = (((1<<18)-1)/7);\nfunction reg2bins(beg, end) \n{\n var i = 0, k, list = [];\n --end;\n list.push(0);\n for (k = 1 + (beg>>26); k <= 1 + (end>>26); ++k) list.push(k);\n for (k = 9 + (beg>>23); k <= 9 + (end>>23); ++k) list.push(k);\n for (k = 73 + (beg>>20); k <= 73 + (end>>20); ++k) list.push(k);\n for (k = 585 + (beg>>17); k <= 585 + (end>>17); ++k) list.push(k);\n for (k = 4681 + (beg>>14); k <= 4681 + (end>>14); ++k) list.push(k);\n return list;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n unbgzf: unbgzf,\n readVob: readVob,\n reg2bin: reg2bin,\n reg2bins: reg2bins,\n Chunk: Chunk\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// memstore.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var dalliance_makeParser = sa.makeParser;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var textXHR = utils.textXHR;\n}\n\nfunction MemStore() {\n this.featuresByChr = {};\n this.maxLength = 1;\n this.chrRing = null;\n}\n\nMemStore.prototype.addFeatures = function(features) {\n var dirty = {};\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n var chr = f.segment || f.chr;\n var fa = this.featuresByChr[chr];\n if (!fa) {\n fa = [];\n this.featuresByChr[chr] = fa;\n }\n fa.push(f);\n dirty[chr] = true;\n\n var len = f.max - f.min + 1;\n if (len > this.maxLength)\n this.maxLength = len;\n }\n\n for (chr in dirty) {\n var fa = this.featuresByChr[chr];\n fa.sort(function(f1, f2) {\n var d = f1.min - f2.min;\n if (d != 0)\n return d;\n return f1.max - f2.max;\n });\n }\n this.chrRing = null;\n}\n\nMemStore.prototype._indexFor = function(fa, p) {\n var lb = 0, ub = fa.length;\n while (ub > lb) {\n var mid = ((lb + ub)/2)|0;\n if (mid >= fa.length)\n return fa.length;\n var mg = fa[mid];\n if (p < mg.min) {\n ub = mid;\n } else {\n lb = mid + 1;\n }\n }\n return ub;\n}\n\nMemStore.prototype.fetch = function(chr, min, max) {\n var fa = this.featuresByChr[chr];\n if (!fa) {\n if (chr.indexOf('chr') == 0)\n fa = this.featuresByChr[chr.substring(3)];\n else\n fa = this.featuresByChr['chr' + chr];\n }\n if (!fa)\n return [];\n\n var mini = Math.max(0, this._indexFor(fa, min - this.maxLength - 1));\n var maxi = Math.min(fa.length - 1, this._indexFor(fa, max));\n\n var res = [];\n for (var fi = mini; fi <= maxi; ++fi) {\n var f = fa[fi];\n if (f.min <= max && f.max >= min)\n res.push(f);\n }\n return res;\n}\n\nMemStore.prototype.findNextFeature = function(chr, pos, dir) {\n if (this.chrRing == null) {\n this.chrRing = [];\n for (var chr in this.featuresByChr) {\n this.chrRing.push(chr);\n }\n this.chrRing.sort();\n }\n\n var fa = this.featuresByChr[chr];\n if (!fa) {\n if (chr.indexOf('chr') == 0) {\n chr = chr.substring(3);\n fa = this.featuresByChr[chr];\n } else {\n chr = 'chr' + chr;\n fa = this.featuresByChr[chr];\n }\n }\n if (!fa)\n return null;\n\n var i = Math.max(0, Math.min(this._indexFor(fa, pos), fa.length - 1));\n if (dir > 0) {\n while (i < fa.length) {\n var f = fa[i++];\n if (f.min > pos)\n return f;\n }\n var chrInd = this.chrRing.indexOf(chr) + 1;\n if (chrInd >= this.chrRing.length)\n chrInd = 0;\n return this.findNextFeature(this.chrRing[chrInd], 0, dir);\n } else {\n while (i >= 0) {\n var f = fa[i--];\n if (f.max < pos)\n return f;\n }\n var chrInd = this.chrRing.indexOf(chr) - 1;\n if (chrInd < 0)\n chrInd = this.chrRing.length - 1;\n return this.findNextFeature(this.chrRing[chrInd], 10000000000, dir);\n }\n}\n\nfunction MemStoreFeatureSource(source) {\n this.source = source;\n FeatureSourceBase.call(this);\n this.storeHolder = new Awaited();\n this.parser = dalliance_makeParser(source.payload);\n if (!this.parser) {\n throw \"Unsupported memstore payload: \" + source.payload;\n }\n\n var thisB = this;\n this._load(function(resp, err) {\n if (err) {\n thisB.error = err;\n thisB.storeHolder.provide(null);\n } else {\n var store = new MemStore();\n var features = [];\n var lines = resp.split('\\n');\n\n var session = thisB.parser.createSession(function(f) {features.push(f)});\n for (var li = 0; li < lines.length; ++li) {\n var line = lines[li];\n if (line.length > 0) {\n session.parse(line);\n }\n }\n session.flush();\n\n store.addFeatures(features);\n\n thisB.storeHolder.provide(store);\n }\n });\n}\n\nMemStoreFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nMemStoreFeatureSource.prototype._load = function(callback) {\n if (this.source.blob) {\n var r = new FileReader();\n r.onloadend = function() {\n return callback(r.result, r.error);\n }\n r.readAsText(this.source.blob);\n } else {\n if (this.source.credentials)\n var opts = {credentials : this.source.credentials};\n textXHR(this.source.uri, callback, opts);\n }\n}\n\nMemStoreFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, cnt) {\n var thisB = this;\n this.storeHolder.await(function(store) {\n if (store) {\n var f = store.fetch(chr, min, max);\n return cnt(null, f, 100000000);\n } else {\n return cnt(thisB.error)\n }\n });\n}\n\nMemStoreFeatureSource.prototype.getStyleSheet = function(callback) {\n if (this.parser && this.parser.getStyleSheet)\n this.parser.getStyleSheet(callback)\n}\n\nMemStoreFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.parser && this.parser.getDefaultFIPs)\n this.parser.getDefaultFIPs(callback);\n}\n\nMemStoreFeatureSource.prototype.getScales = function() {\n return 100000000;\n}\n\nMemStoreFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n var thisB = this;\n this.storeHolder.await(function(store) {\n if (store) {\n return callback(store.findNextFeature(chr, pos, dir));\n } else {\n return callback(null, thisB.error);\n }\n });\n}\n\n\nMemStoreFeatureSource.prototype.capabilities = function() {\n var caps = {leap: true};\n return caps;\n}\n\ndalliance_registerSourceAdapterFactory('memstore', function(source) {\n return {features: new MemStoreFeatureSource(source)};\n});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// Molgenisjson.js -- query the Molgenis REST API.\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n}\n\nfunction MolgenisFeatureSource(source) {\n FeatureSourceBase.call(this);\n this.source = source;\n if (source.uri) {\n this.base = source.uri;\n } else if (source.entity) {\n this.base = window.location.origin + '/api/v2/' + source.entity + '?' + Math.random();\n }else{\n throw new Error(\"Bad molgenis track configuration: please specify 'genome_attrs.chr' and 'genome_attrs.pos'\");\n }\n\n this.species = source.species || 'human';\n\n if (typeof source.type === 'string') {\n this.type = [source.type];\n } else {\n this.type = source.type || ['regulatory'];\n }\n}\n\nMolgenisFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\nMolgenisFeatureSource.prototype.constructor = MolgenisFeatureSource;\n\nMolgenisFeatureSource.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'A';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'green';\n stylesheet.pushStyle({type: 'variant', method: 'A'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'C';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'blue';\n stylesheet.pushStyle({type: 'variant', method: 'C'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'G';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'orange';\n stylesheet.pushStyle({type: 'variant', method: 'G'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = 'T';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'red';\n stylesheet.pushStyle({type: 'variant', method: 'T'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'TEXT';\n varStyle.STRING = '?';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'darkgrey';\n stylesheet.pushStyle({type: 'variant', method: 'unknown'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'DOT';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'purple';\n stylesheet.pushStyle({type: 'indel'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'STAR';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({type: 'variant', method: 'multiple'}, null, varStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'blue';\n wigStyle.BGCOLOR = 'blue'\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'red';\n wigStyle.BGCOLOR = 'red'\n wigStyle.HEIGHT = 8;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'exon', method: 'exon'}, null, wigStyle);\n }\n {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'white';\n wigStyle.BGCOLOR = 'white'\n wigStyle.HEIGHT = 8;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'exon', method: 'intron'}, null, wigStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'HISTOGRAM';\n varStyle.BGCOLOR = 'blue';\n varStyle.HEIGHT = 50;\n stylesheet.pushStyle({type: 'numeric'}, null, varStyle);\n }\n\n return callback(stylesheet);\n}\n\n\nMolgenisFeatureSource.prototype.getScales = function() {\n return [];\n}\n\nMolgenisFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n var source = this.source;\n\n if (!source.genome_attrs.chr || !source.genome_attrs.pos) {\n throw new Error(\"Bad molgenis track configuration: please specify 'genome_attrs.chr' and 'genome_attrs.pos'\");\n }\n\n var url = this.base;\n\n\n if (source.attrs) {\n var attributes = [];\n for (var index = 0; index < source.attrs.length; ++index) {\n var attr = source.attrs[index];\n var attrArray = attr.split(\":\");\n attributes.push(attrArray[0]);\n }\n if(attributes[source.genome_attrs.chr] === undefined) {\n attributes.push(source.genome_attrs.chr);\n }\n if(attributes[source.genome_attrs.pos] === undefined) {\n attributes.push(source.genome_attrs.pos);\n }\n if(attributes[source.genome_attrs.alt] === undefined) {\n if(source.genome_attrs.alt) {\n attributes.push(source.genome_attrs.alt);\n }\n }\n if(attributes[source.genome_attrs.ref] === undefined) {\n if(source.genome_attrs.ref) {\n attributes.push(source.genome_attrs.ref);\n }\n }\n if(attributes[source.genome_attrs.stop] === undefined) {\n if(source.genome_attrs.stop) {\n attributes.push(source.genome_attrs.stop);\n }\n }\n url += '&attrs=' + encodeURIComponent(attributes);\n }\n\n if (source.genome_attrs.stop) {\n url += '&q=' + encodeURIComponent(source.genome_attrs.chr) + '==' + chr + ';(' + source.genome_attrs.pos + '=ge=' + min + ';' + source.genome_attrs.pos + '=le=' + max + ',' + source.genome_attrs.stop + '=ge=' + min + ';' + source.genome_attrs.stop + '=le=' + max + ')';\n } else {\n url += '&q=' + encodeURIComponent(source.genome_attrs.chr) + '==' + chr + ';' + source.genome_attrs.pos + '=ge=' + min + ';' + source.genome_attrs.pos + '=le=' + max;\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n \tif (req.readyState == 4) {\n thisB.busy--;\n thisB.notifyActivity();\n\n \t if (req.status >= 300) {\n var err = 'Error code ' + req.status;\n try {\n var jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } catch (ex) {};\n\n \t\t callback(err, null);\n \t } else {\n \t\tvar jf = JSON.parse(req.response);\n \t\tvar items = jf.items;\n \t\tvar features = [];\n \t\tfor (var fi = 0; fi < items.length; ++fi) {\n var entity = items[fi];\n var notes = [];\n var feature = new DASFeature();\n feature.segment = chr;\n feature.min = entity[source.genome_attrs.pos] | 0;\n if(source.genome_attrs.stop)\n {\n feature.max = entity[source.genome_attrs.stop] | 0;\n }\n else{\n feature.max = entity[source.genome_attrs.pos] | 0;\n }\n\n feature.type = entity.feature_type || 'unknown';\n var identifier;\n if (source.label_attr) {\n identifier = source.label_attr;\n } else {\n identifier = \"ID\";\n }\n feature.id = entity[identifier];\n\n //add attrs to notes for use in popup\n if (source.attrs) {\n for (var index = 0; index < source.attrs.length; ++index) {\n var attr = source.attrs[index];\n var attrArray = attr.split(\":\");\n\n var label = attrArray[1];\n var value = entity[attrArray[0]];\n\n notes.push(label + '=' + value);\n }\n }\n if (source.actions) {\n feature.actions = eval(source.actions);\n feature.entity = entity;\n }\n\n if (notes.length > 0) {\n feature.notes = notes;\n }\n\n if(source.track_type === \"NUMERIC\") {\n feature.score = entity[source.score_attr];\n }\n\n setStyleProperties(entity, feature, source);\n feature.molgenis = true;\n \t\t features.push(feature);\n \t\t}\n \t\tcallback(null, features);\n \t }\n \t}\n\t\n };\n \n thisB.busy++;\n thisB.notifyActivity();\n\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send('');\n}\n\nfunction setStyleProperties(entity, feature, source) {\n\n var type = source.track_type;\n var altAttr = source.genome_attrs.alt;\n var refAttr = source.genome_attrs.ref;\n if(type === \"NUMERIC\"){\n feature.type = \"numeric\";\n return;\n }\n if(type === \"EXON\") {\n var labelAttr = source.label_attr;\n if (entity[labelAttr].search(source.exon_key) != -1) {\n feature.type = \"exon\";\n feature.method = \"exon\";\n return;\n }\n else{\n feature.type = \"exon\";\n feature.method = \"intron\";\n return;\n }\n }\n else if(altAttr && entity[altAttr] && refAttr && entity[refAttr]) {\n if (entity[altAttr].length > 1 || entity[refAttr].length > 1) {\n feature.type = \"indel\";\n return;\n }\n else if (entity[altAttr] === 'A') {\n feature.type = \"variant\";\n feature.method = \"A\";\n return;\n }\n else if (entity[altAttr] === 'T') {\n feature.type = \"variant\";\n feature.method = \"T\";\n return;\n }\n else if (entity[altAttr] === 'G') {\n feature.type = \"variant\";\n feature.method = \"G\";\n return;\n }\n else if (entity[altAttr] === 'C') {\n feature.type = \"variant\";\n feature.method = \"C\";\n return;\n }\n else if (entity[altAttr].search(',') != -1) {\n feature.type = \"variant\";\n feature.method = \"multiple\";\n return;\n }\n else {\n feature.type = \"variant\";\n feature.method = \"unknown\";\n return;\n }\n }else{\n feature.type = \"default\";\n return;\n }\n}\n\ndalliance_registerSourceAdapterFactory('molgenis', function(source) {\n return {features: new MolgenisFeatureSource(source)};\n});\n","/* jshint esversion: 6 */\n\"use strict\";\n\nimport { drawSeqTier } from \"./sequence-draw.js\";\n\nimport { GridGlyph } from \"./glyphs.js\";\n\nimport * as DefaultRenderer from \"./default-renderer\";\n\nimport * as R from \"ramda\";\n\nexport { renderTier, drawTier };\n\n\n/* Renders multiple tiers in a single track.\n Works by simply drawing several tiers to a single canvas.\n Actual rendering is done using default-renderer.es6.\n A multi-tier renderer is configured by adding the following to a tier's\n configuration:\n renderer: 'multi',\n multi: {\n multi_id: \"multi_1\",\n }\n\n All subtiers with the \"multi_1\" multi_id will be drawn to this tier's canvas.\n */\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\nfunction drawTier(multiTier) {\n let multiConfig = multiTier.dasSource.multi;\n let getSubConfig = t => t.dasSource.sub;\n\n // Padding is used for finding the correct canvas size and must be set\n if (!multiTier.padding)\n multiTier.padding = 3;\n\n let canvas = multiTier.viewport.getContext(\"2d\");\n let retina = multiTier.browser.retina && window.devicePixelRatio > 1;\n if (retina) {\n canvas.scale(2, 2);\n }\n\n // Filter out only tiers that are to be drawn in this multitier,\n // and also have fetched data.\n let tiers = multiTier.browser.tiers.\n filter(tier => typeof(getSubConfig(tier)) === \"object\" &&\n getSubConfig(tier).multi_id === multiConfig.multi_id &&\n (tier.currentFeatures || tier.currentSequence));\n\n // The shortest distance from the top of the canvas to a subtier\n let minOffset = R.pipe(\n R.map(tier => tier.dasSource.sub.offset),\n R.reduce((acc, offset) => offset < acc ? offset : acc, 0)\n )(tiers);\n\n tiers.forEach(tier => {\n if (tier.sequenceSource) {\n drawSeqTier(tier, tier.currentSequence);\n } else {\n // Shift subtiers up by the minimum offset,\n // so that there's no empty space at the top\n DefaultRenderer.prepareSubtiers(tier, canvas,\n getSubConfig(tier).offset - minOffset,\n false);\n }\n\n // Must be set for painting to work\n if (!multiTier.glyphCacheOrigin)\n multiTier.glyphCacheOrigin = tier.glyphCacheOrigin;\n });\n\n // The canvas should fit all subtiers, including offsets, but no more\n let canvasHeight = R.pipe(\n R.map(tier =>\n R.map(subtier => subtier.height + getSubConfig(tier).offset,\n tier.subtiers)),\n R.flatten,\n R.reduce((acc, h) => h > acc ? h : acc, -Infinity),\n R.add(-minOffset)\n )(tiers);\n\n prepareViewport(multiTier, canvas, retina, canvasHeight, true);\n\n tiers.sort((t1, t2) => getSubConfig(t1).z > getSubConfig(t2).z);\n\n // TODO: make it add the glyph on to the first available tier;\n // crashes if last tier is empty...\n if (multiConfig.grid && tiers && tiers[tiers.length-1] && tiers[tiers.length-1].subtiers[0]) {\n let grid = new GridGlyph(canvasHeight,\n multiConfig.grid_offset,\n multiConfig.grid_spacing);\n // pretty hacky way of adding the grid, but it works (mostly)\n tiers[tiers.length-1].subtiers[0].glyphs.unshift(grid);\n }\n\n tiers.forEach(tier => {\n // Need to save and restore canvas to make sure that the subtiers are\n // drawn on top of one another, if not shifted...\n canvas.save();\n DefaultRenderer.paint(tier, canvas, retina, true);\n canvas.restore();\n });\n\n multiTier.drawOverlay();\n\n if (multiConfig.quant) {\n let quantCanvas = DefaultRenderer.createQuantOverlay(multiTier, canvasHeight+multiTier.padding*2, retina);\n DefaultRenderer.paintQuant(quantCanvas, multiTier, multiConfig.quant, 10);\n }\n\n if (typeof(multiTier.dasSource.drawCallback) === \"function\") {\n multiTier.dasSource.drawCallback(canvas, multiTier);\n }\n\n multiTier.originHaxx = 0;\n multiTier.browser.arrangeTiers();\n}\n\nfunction prepareViewport(tier, canvas, retina, canvasHeight, clear=true) {\n let desiredWidth = tier.browser.featurePanelWidth + 2000;\n if (retina) {\n desiredWidth *= 2;\n }\n\n let fpw = tier.viewport.width|0;\n if (fpw < desiredWidth - 50) {\n tier.viewport.width = fpw = desiredWidth;\n }\n\n canvasHeight += 2*tier.padding;\n canvasHeight = Math.max(canvasHeight, tier.browser.minTierHeight);\n\n if (canvasHeight != tier.viewport.height) {\n tier.viewport.height = canvasHeight;\n\n if (retina) {\n tier.viewport.height *= 2;\n }\n }\n\n tier.viewportHolder.style.left = '-1000px';\n tier.viewport.style.width = retina ? ('' + (fpw/2) + 'px') : ('' + fpw + 'px');\n tier.viewport.style.height = '' + canvasHeight + 'px';\n tier.layoutHeight = Math.max(canvasHeight, tier.browser.minTierHeight);\n\n tier.updateHeight();\n tier.norigin = tier.browser.viewStart;\n\n if (clear) {\n DefaultRenderer.clearViewport(canvas, fpw, canvasHeight);\n }\n\n DefaultRenderer.drawUnmapped(tier, canvas, canvasHeight);\n\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// memstore.js\n//\n\nfunction formatLongInt(n) {\n return (n|0).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n}\n\nfunction formatQuantLabel(v) {\n var t = '' + v;\n var dot = t.indexOf('.');\n if (dot < 0) {\n return t;\n } else {\n var dotThreshold = 2;\n if (t.substring(0, 1) == '-') {\n ++dotThreshold;\n }\n\n if (dot >= dotThreshold) {\n return t.substring(0, dot);\n } else {\n return t.substring(0, dot + 2);\n }\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n formatLongInt: formatLongInt,\n formatQuantLabel: formatQuantLabel\n };\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// overlay.js: featuresources composed from multiple underlying sources\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n var arrayIndexOf = utils.arrayIndexOf;\n}\n\nfunction OverlayFeatureSource(sources, opts) {\n this.sources = sources;\n this.opts = opts || {};\n this.activityListeners = [];\n this.readinessListeners = [];\n this.changeListeners = [];\n this.business = [];\n this.readiness = [];\n\n for (var i = 0; i < this.sources.length; ++i) {\n this.initN(i);\n }\n\n if (typeof(opts.merge) === 'function') {\n this.merge = opts.merge;\n } else if (opts.merge == 'concat') {\n this.merge = OverlayFeatureSource_merge_concat;\n } else if (opts.merge == 'alternates') {\n this.merge = OverlayFeatureSource_merge_concat;\n this.filterDispatchOnMethod = true;\n } else {\n this.merge = OverlayFeatureSource_merge_byKey;\n }\n}\n\nOverlayFeatureSource.prototype.initN = function(n) {\n var s = this.sources[n];\n var thisB = this;\n this.business[n] = 0;\n\n if (s.addActivityListener) {\n s.addActivityListener(function(b) {\n thisB.business[n] = b;\n thisB.notifyActivity();\n });\n }\n if (s.addChangeListener) {\n s.addChangeListener(function() {\n thisB.notifyChange();\n });\n }\n if (s.addReadinessListener) {\n s.addReadinessListener(function(r) {\n thisB.readiness[n] = r;\n thisB.notifyReadiness();\n });\n }\n}\n\nOverlayFeatureSource.prototype.addReadinessListener = function(l) {\n this.readinessListeners.push(l);\n this.notifyReadinessListener(l);\n}\n\nOverlayFeatureSource.prototype.removeReadinessListener = function(l) {\n var idx = arrayIndexOf(this.readinessListeners, l);\n if (idx >= 0) {\n this.readinessListeners.splice(idx, 1);\n }\n}\n\nOverlayFeatureSource.prototype.notifyReadiness = function() {\n for (var i = 0; i < this.readinessListeners.length; ++i) {\n this.notifyReadinessListener(this.readinessListeners[i]);\n }\n}\n\nOverlayFeatureSource.prototype.notifyReadinessListener = function(l) {\n var r = null;\n for (var i = 0; i < this.readiness.length; ++i) {\n if (this.readiness[i] != null) {\n r = this.readiness[i]; break;\n }\n }\n try {\n l(r);\n } catch (e) {\n console.log(e);\n }\n}\n\nOverlayFeatureSource.prototype.addActivityListener = function(l) {\n this.activityListeners.push(l);\n}\n\nOverlayFeatureSource.prototype.removeActivityListener = function(l) {\n var idx = arrayIndexOf(this.activityListeners, l);\n if (idx >= 0) {\n this.activityListeners.splice(idx, 1);\n }\n}\n\nOverlayFeatureSource.prototype.notifyActivity = function() {\n var busy = 0;\n for (var i = 0; i < this.business.length; ++i) {\n busy += this.business[i];\n }\n\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](busy);\n } catch (e) {\n console.log(e);\n }\n }\n}\n\nOverlayFeatureSource.prototype.addChangeListener = function(listener) {\n this.changeListeners.push(listener);\n}\n\nOverlayFeatureSource.prototype.removeChangeListener = function(l) {\n var idx = arrayIndexOf(this.changeListeners, l);\n if (idx >= 0) {\n this.changeListeners.splice(idx, 1);\n }\n}\n\nOverlayFeatureSource.prototype.notifyChange = function() {\n for (var li = 0; li < this.changeListeners.length; ++li) {\n try {\n this.changeListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n}\n\nOverlayFeatureSource.prototype.getScales = function() {\n return this.sources[0].getScales();\n}\n\nOverlayFeatureSource.prototype.getStyleSheet = function(callback) {\n return this.sources[0].getStyleSheet(callback);\n}\n\nOverlayFeatureSource.prototype.capabilities = function() {\n var caps = {};\n var s0 = this.sources[0];\n if (s0.capabilities) \n caps = shallowCopy(s0.capabilities());\n\n for (var i = 1; i < this.sources.length; ++i) {\n var si = this.sources[i];\n if (si.capabilities) {\n var co = si.capabilities();\n if (co.search) {\n caps.search = co.search;\n }\n }\n }\n\n return caps;\n}\n\nOverlayFeatureSource.prototype.search = function(query, callback) {\n for (var i = 0; i < this.sources.length; ++i) {\n if (_sourceAdapterIsCapable(this.sources[i], 'search')) {\n return this.sources[i].search(query, callback);\n }\n }\n}\n\nOverlayFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback, styleFilters) {\n var sources;\n if (this.filterDispatchOnMethod) {\n sources = [];\n var sfl = styleFilters.list();\n for (var si = 0; si < this.sources.length; ++si) {\n var source = this.sources[si];\n for (var fi = 0; fi < sfl.length; ++fi) {\n var filter = sfl[fi];\n if (!filter.method || filter.method == source.name) {\n sources.push(source);\n break;\n }\n }\n }\n } else {\n sources = this.sources;\n }\n\n var baton = new OverlayBaton(this, callback, sources);\n for (var si = 0; si < sources.length; ++si) {\n\t this.fetchN(baton, si, sources[si], chr, min, max, scale, types, pool, styleFilters);\n }\n}\n\nOverlayFeatureSource.prototype.fetchN = function(baton, si, source, chr, min, max, scale, types, pool, styleFilters) {\n // FIXME should we try to prune styleFilters?\n source.fetch(chr, min, max, scale, types, pool, function(status, features, scale) {\n\t return baton.completed(si, status, features, scale);\n }, styleFilters);\n}\n\nOverlayFeatureSource.prototype.quantFindNextFeature = function(chr, pos, dir, threshold, callback) {\n return this.sources[0].quantFindNextFeature(chr, pos, dir, threshold, callback);\n}\n\nOverlayFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n return this.sources[0].findNextFeature(chr, pos, dir, callback);\n}\n\nfunction OverlayBaton(source, callback, sources) {\n this.source = source;\n this.callback = callback;\n this.sources = sources;\n this.count = sources.length;\n\n this.returnCount = 0;\n this.statusCount = 0;\n this.returns = [];\n this.features = []\n this.statuses = [];\n this.scale = null;\n}\n\nOverlayBaton.prototype.completed = function(index, status, features, scale) {\n if (this.scale == null || index == 0) \n\t this.scale = scale;\n\n if (this.returns[index])\n\t throw 'Multiple returns for source ' + index;\n\n this.returns[index] = true;\n this.returnCount++;\n\n this.features[index] = features;\n\n if (status) {\n \tthis.statuses[index] = status;\n \tthis.statusCount++;\n }\n\n\n if (this.returnCount == this.count) {\n \tif (this.statusCount > 0) {\n \t var message = '';\n \t for (var si = 0; si < this.count; ++si) {\n \t\tvar s = this.statuses[si];\n \t\tif (s) {\n \t\t if (message.length > 0) \n \t\t\tmessage += ', ';\n \t\t message += s;\n \t\t}\n \t }\n \t return this.callback(message, null, this.scale);\n \t} else {\n \t this.callback(null, this.source.merge(this.features, this.sources), this.scale);\n \t}\n }\n}\n\nOverlayFeatureSource.prototype.getDefaultFIPs = function(callback) {\n for (var si = 0; si < this.sources.length; ++si) {\n var s = this.sources[si];\n if (s.getDefaultFIPs)\n s.getDefaultFIPs(callback);\n }\n}\n\nOverlayFeatureSource.prototype.keyForFeature = function(feature) {\n return '' + feature.min + '..' + feature.max;\n}\n\nfunction OverlayFeatureSource_merge_byKey(featureSets) {\n var omaps = [];\n\n for (var fsi = 1; fsi < featureSets.length; ++fsi) {\n var om = {};\n var of = featureSets[fsi];\n for (var fi = 0; fi < of.length; ++fi) {\n \t om[this.keyForFeature(of[fi])] = of[fi];\n }\n omaps.push(om);\n }\n\n\n var mf = [];\n var fl = featureSets[0];\n for (var fi = 0; fi < fl.length; ++fi) {\n \tvar f = fl[fi];\n\n for (var oi = 0; oi < omaps.length; ++oi) {\n var om = omaps[oi];\n \tof = om[this.keyForFeature(f)]\n \tif (of) {\n for (var k in of) {\n if (k === 'score') {\n f.score2 = of.score;\n } else if (k === 'min' || k === 'max' || k === 'segment' || k === '_cachedStyle') {\n // do nothing\n } else {\n f[k] = of[k];\n }\n }\n \t}\n }\n \tmf.push(f);\n }\n return mf;\n}\n\nfunction OverlayFeatureSource_merge_concat(featureSets, sources) {\n var features = [];\n for (var fsi = 0; fsi < featureSets.length; ++fsi) {\n var fs = featureSets[fsi];\n var name = sources[fsi].name;\n for (var fi = 0; fi < fs.length; ++fi) {\n var f = fs[fi];\n f.method = name;\n features.push(f);\n }\n }\n return features;\n}\n\nfunction _sourceAdapterIsCapable(s, cap) {\n if (!s.capabilities)\n return false;\n else \n return s.capabilities()[cap];\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n OverlayFeatureSource: OverlayFeatureSource\n };\n}\n\n\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// bedwig.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n var readInt = bin.readInt;\n\n var bbi = require('./bigwig');\n var BIG_WIG_MAGIC = bbi.BIG_WIG_MAGIC;\n var BIG_BED_MAGIC = bbi.BIG_BED_MAGIC;\n\n var lh3utils = require('./lh3utils');\n var unbgzf = lh3utils.unbgzf;\n\n var bam = require('./bam');\n var BAM_MAGIC = bam.BAM_MAGIC;\n var BAI_MAGIC = bam.BAI_MAGIC;\n\n var tbi = require('./tabix');\n var TABIX_MAGIC = tbi.TABIX_MAGIC;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nfunction probeResource(source, listener, retry) {\n var BED_REGEXP = new RegExp('^\\\\w+\\\\s[0-9]+\\\\s[0-9]+.*$');\n var KV_REGEXP=/([^=]+)=\\\"?([^\\\"]+)\\\"?/;\n var VCFHEAD_RE = /^##\\s*fileformat=VCFv4\\..+/;\n\n var fetchable;\n if (source.blob)\n fetchable = new BlobFetchable(source.blob);\n else if (source.transport == 'encode')\n fetchable = new EncodeFetchable(source.uri);\n else\n fetchable = new URLFetchable(source.uri, {credentials: source.credentials});\n\n fetchable.slice(0, 1<<16).salted().fetch(function(result, error) {\n if (!result) {\n if (!retry) {\n source.credentials = true;\n probeResource(source, listener, true)\n }\n\n return listener(source, \"Couldn't fetch data\");\n }\n\n var ba = new Uint8Array(result);\n var la = new Uint32Array(result, 0, 1);\n var magic = la[0];\n if (magic == BIG_WIG_MAGIC || magic == BIG_BED_MAGIC) {\n source.tier_type = 'bwg';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.bw|.bb|.bigWig|.bigBed)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else if (magic == BAI_MAGIC) {\n source.tier_type = 'bai';\n return listener(source, null);\n } else if (ba[0] == 31 || ba[1] == 139) {\n var unc = unbgzf(result);\n var uncba = new Uint8Array(unc);\n magic = readInt(uncba, 0);\n if (magic == BAM_MAGIC) {\n source.tier_type = 'bam';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.bam)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else if (magic == TABIX_MAGIC) {\n source.tier_type = 'tabix-index';\n return listener(source, null);\n } else if (magic == 0x69662323) {\n source.tier_type = 'tabix';\n source.payload = 'vcf';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.vcf)?(.gz)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n source.name = match[1];\n }\n\n return listener(source, null);\n } else {\n console.log('magic = ' + magic.toString(16));\n return listener(source, \"Unsupported format\");\n }\n } else {\n var text = String.fromCharCode.apply(null, ba);\n var lines = text.split(\"\\n\");\n\n if (lines.length > 0 && VCFHEAD_RE.test(lines[0])) {\n source.tier_type = 'memstore';\n source.payload = 'vcf';\n var nameExtractPattern = new RegExp('/?([^/]+?)(\\.vcf)?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match && !source.name) {\n source.name = match[1];\n }\n return listener(source, null);\n }\n\n for (var li = 0; li < lines.length; ++li) {\n var line = lines[li].replace('\\r', '');\n if (line.length == 0) continue;\n\n if (line.indexOf('browser') == 0) continue;\n\n if (line.indexOf('track') == 0) {\n var maybeType = 'bed';\n var toks = line.split(/\\s/);\n for (var ti = 1; ti < toks.length; ++ti) {\n var m = KV_REGEXP.exec(toks[ti]);\n if (m) {\n if (m[1] == 'type' && m[2] == 'wiggle_0') {\n maybeType = 'wig'\n } else if (m[0] == 'name') {\n source.name = m[2];\n }\n }\n }\n\n finishProbeBedWig(source, maybeType);\n return listener(source, null);\n }\n\n if (line.indexOf('fixedStep') == 0) {\n finishProbeBedWig(source, 'wig');\n return listener(source, null);\n }\n\n if (line.indexOf('variableStep') == 0) {\n finishProbeBedWig(source, 'wig');\n return listener(source, null);\n }\n\n if (BED_REGEXP.test(line)) {\n finishProbeBedWig(source, null);\n return listener(source, null);\n }\n\n break;\n }\n\n return listener(source, \"Unsupported format\");\n }\n }, {timeout: 1500}); // Timeout to catch mixed-origin case on Chromium.\n}\n\nfunction finishProbeBedWig(source, maybeType) {\n source.tier_type = 'memstore';\n var nameExtractPattern = new RegExp('/?([^/]+?)(.(bed|wig))?$');\n var match = nameExtractPattern.exec(source.uri || source.blob.name);\n if (match) {\n if (!source.name)\n source.name = match[1];\n if (!maybeType && match[3]) {\n maybeType = match[3];\n }\n }\n source.payload = maybeType || 'bed';\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n probeResource: probeResource\n };\n}\n","/* jshint esversion: 6 */\n\n\"use strict\";\n\nexport { Ruler, rulerDrawCallback };\n\n\nfunction Ruler(options) {\n let self = this;\n\n self.value = options.value;\n self.min = options.min;\n self.max = options.max;\n self.width = options.width;\n self.color = options.color;\n\n Object.keys(self).map(key => {\n if (self[key] === undefined) {\n console.log(\"WARNING: Ruler option \" + key + \" not set\");\n }\n });\n}\n\nRuler.prototype.constructor = Ruler;\n\nfunction rulerDrawCallback(canvas, tier) {\n let rulers = tier.dasSource.rulers;\n\n if (!rulers) {\n console.log(\"Tier uses ruler callback but has no rulers!\");\n } else if (!(rulers instanceof Array)) {\n console.log(\"rulers.js: 'rulers' should be an Array\");\n }\n\n\n rulers.map(r => {\n let rulerY = ((r.max - r.value) * r.height);\n let viewWidth = tier.viewport.width;\n let oldLineWidth = canvas.lineWidth;\n\n canvas.strokeStyle = r.color;\n canvas.beginPath();\n canvas.moveTo(-viewWidth, rulerY + r.offset);\n // Other parts of the code rely on not having changed the lineWidth...\n // So we need to change it back when we're done.\n canvas.lineWidth = r.width;\n canvas.lineTo(2*viewWidth, rulerY + r.offset);\n canvas.stroke();\n canvas.lineWidth = oldLineWidth;\n });\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// sample.js: downsampling of quantitative features\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var das = require('./das');\n var DASFeature = das.DASFeature;\n\n var parseCigar = require('./cigar').parseCigar;\n\n var shallowCopy = require('./utils').shallowCopy;\n}\n\nvar __DS_SCALES = [1, 2, 5];\n\nfunction ds_scale(n) {\n return __DS_SCALES[n % __DS_SCALES.length] * Math.pow(10, (n / __DS_SCALES.length)|0);\n}\n\n\nfunction DSBin(scale, min, max) {\n this.scale = scale;\n this.tot = 0;\n this.cnt = 0;\n this.hasScore = false;\n this.min = min; this.max = max;\n this.features = [];\n}\n\nfunction _featureOrder(a, b) {\n if (a.min < b.min) {\n return -1;\n } else if (a.min > b.min) {\n return 1;\n } else if (a.max < b.max) {\n return -1;\n } else if (b.max > a.max) {\n return 1;\n } else {\n return 0;\n }\n}\n\nDSBin.prototype.score = function() {\n if (this.cnt == 0) {\n return 0;\n } else if (this.hasScore) {\n return this.tot / this.cnt;\n } else {\n var features = this.features;\n features.sort(_featureOrder);\n\n var maxSeen = -10000000000;\n var cov=0, lap=0;\n\n for (var fi = 1; fi < features.length; ++fi) {\n var f = features[fi];\n var lMin = Math.max(f.min, this.min);\n var lMax = Math.min(f.max, this.max);\n lap += (lMax - lMin + 1);\n\n if (lMin > maxSeen) {\n cov += lMax - lMin + 1;\n maxSeen = lMax;\n } else {\n if (lMax > maxSeen) {\n cov += (lMax - maxSeen);\n maxSeen = lMax;\n }\n }\n }\n\n if (cov > 0)\n return (1.0 * lap) / cov;\n else\n return 0;\n }\n}\n\nDSBin.prototype.feature = function(f) {\n if (f.score !== undefined) {\n this.tot += f.score;\n this.hasScore = true\n }\n\n ++this.cnt;\n this.features.push(f);\n}\n\nfunction downsample(features, targetRez) {\n var sn = 0;\n while (ds_scale(sn + 1) < targetRez) {\n ++sn;\n }\n var scale = ds_scale(sn);\n\n var binTots = [];\n var maxBin = -10000000000;\n var minBin = 10000000000;\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.groups && f.groups.length > 0) {\n // Don't downsample complex features (?)\n return features;\n }\n\n var minLap = (f.min / scale)|0;\n var maxLap = (f.max / scale)|0;\n maxBin = Math.max(maxBin, maxLap);\n minBin = Math.min(minBin, minLap);\n for (var b = minLap; b <= maxLap; ++b) {\n var bm = binTots[b];\n if (!bm) {\n bm = new DSBin(scale, b * scale, (b + 1) * scale - 1);\n binTots[b] = bm;\n }\n bm.feature(f);\n }\n }\n\n var sampledFeatures = [];\n for (var b = minBin; b <= maxBin; ++b) {\n var bm = binTots[b];\n if (bm) {\n var f = new DASFeature();\n f.segment = features[0].segment;\n f.min = (b * scale) + 1;\n f.max = (b + 1) * scale;\n f.score = bm.score();\n f.type = 'density';\n sampledFeatures.push(f);\n }\n }\n\n var afterDS = Date.now();\n return sampledFeatures;\n}\n\n/** Data structure to store information for\na base position:\n\npos: position of the base.\n*/\nfunction BaseBin(pos) {\n\n this._pos = pos;\n this._bases = {};\n this._totalCount = 0;\n}\n\n/** Keep record for incidence of a base,\nwith related qual score and strand for a position.\n\nParams\n base: base (e.g A, T, G, C, N) observed at position.\n qual: numeric quality score.\n strand: '+' or '-'.\n*/\nBaseBin.prototype.recordBase = function(base, qual, strand) {\n if (!this._bases[base]) {\n var strandComposition = {'+': 0, '-': 0};\n strandComposition[strand]++;\n this._bases[base] = {\n cnt: 1,\n totalQual: qual,\n strandCnt: strandComposition\n };\n } else {\n var baseComposition = this._bases[base];\n baseComposition.cnt++;\n baseComposition.totalQual += qual;\n baseComposition.strandCnt[strand]++;\n }\n this._totalCount++;\n};\n\n/** Returns count of total number of bases observed at position */\nBaseBin.prototype.totalCount = function() {return this._totalCount;};\n\n/** Returns the base position */\nBaseBin.prototype.pos = function() {return this._pos;};\n\n/** Creates a list of tag, info pairs in the form\n[tag]=[info] for each base, for use in feature-popup */\nBaseBin.prototype.infoList = function() {\n var info = [];\n var totalCount = this._totalCount;\n var totalCountStr = \"Depth=\" + totalCount.toString();\n info.push(totalCountStr);\n for (var base in this._bases) {\n var baseComposition = this._bases[base];\n var baseCnt = baseComposition.cnt;\n var basePercentage = (baseCnt * 100 / totalCount); \n var plusStrandCnt = baseComposition.strandCnt['+'];\n var minusStrandCnt = baseComposition.strandCnt['-'];\n var meanQual = baseComposition.totalQual/baseCnt;\n\n var baseInfoString = [base, '=', baseCnt, ' (', basePercentage.toFixed(0), '%, ',\n plusStrandCnt, ' +, ', minusStrandCnt, ' -, Qual: ', meanQual.toFixed(0), ')'];\n info.push(baseInfoString.join(''));\n }\n return info;\n};\n\n/** Return a list of objects for creating a\nhistogram showing composition of different bases at a\ngiven location.\n\nCurrent implementation is hacky: the logic involves\noverlaying BoxGlyphs on top of each other, thus the score\nis not meaningful, but only used to manipulate height.\n\nParams:\n ref: reference base at position\n threshold: value between 0 and 1 representing min allele frequency\n below which the allele will be ignored in histogram.\n (interpreted as noise)\n Similar to 'allele threshold' parameter in IGV\n\nReturns a list of objects containing 2 properties\n base: such as A, T, G, C, N, - (del)\n score: a numeric score for determining height of histogram\nThe list is ordered such that a preceeding object always have a\nscore >= the current object, and the ref base will be the last item.\n\nExample: There are 50 T's and 40 A's (total depth = 90)\nat a base where ref=A. The function will return\n[T: 90, A: 40]. When creating a histogram with overlap,\nthis will give an appearance of 40 A's (bottom) and 50 T's (top):\n#######\n# T #\n# T #\n# T #\n# T #\n# T #\n#######\n# A #\n# A #\n# A #\n# A #\n#######\n*/\nBaseBin.prototype.baseScoreList = function(ref, threshold) {\n var baseScoreList = [];\n var totalCount = this._totalCount;\n var minCount = threshold * totalCount;\n for (var base in this._bases) {\n var baseCount = this._bases[base].cnt;\n if (baseCount < minCount || base == ref)\n continue;\n var baseScorePair = {base: base, score: totalCount};\n baseScoreList.push(baseScorePair);\n totalCount -= baseCount;\n }\n baseScoreList.push({base: ref, score: totalCount});\n return baseScoreList;\n};\n\n/** Generates an aligned read from the raw sequence of a BAM record\nusing given cigar string.\n\nParams:\n rawseq: unaligned read sequence from Bam record\n rawquals: unaligned read quals from Bam record\n cigar: Bam cigar string from Bam record\n\nReturns an object with 2 properties:\n seq: string containing aligned read\n quals: string containing printable-character representation\n of sequencing quality score\n*/\nfunction alignSeqUsingCigar(rawseq, rawquals, cigar) {\n var ops = parseCigar(cigar);\n var seq = [];\n var quals = [];\n var cursor = 0;\n for (var ci = 0; ci < ops.length; ++ci) {\n var co = ops[ci];\n if (co.op == 'M') {\n seq.push(rawseq.substr(cursor, co.cnt));\n quals.push(rawquals.substr(cursor, co.cnt));\n cursor += co.cnt;\n } else if (co.op == 'D') {\n for (var oi = 0; oi < co.cnt; ++oi) {\n seq.push('-');\n quals.push('Z');\n }\n } else if (co.op == 'I') {\n cursor += co.cnt;\n } else if (co.op == 'S') {\n cursor += co.cnt;\n } else {\n console.log('unknown cigop' + co.op);\n }\n }\n var processedSeq = {seq: seq.join(''), quals: quals.join('')};\n return processedSeq;\n}\n\n/** Constructs the reference sequence for a given window.\n\nParams\n currentSequence: DasSequence object containing ref sequence\n in current browser view.\n min, max: min and max position for window.\n\nReturns a string containing the refseq, padded with 'N' where sequence is not\n available.\n*/\nfunction getRefSeq(currentSequence, min, max) {\n var refSeq = [];\n if (currentSequence) {\n var csStart = currentSequence.start|0;\n var csEnd = currentSequence.end|0;\n if (csStart <= max && csEnd >= min) {\n var sfMin = Math.max(min, csStart);\n var sfMax = Math.min(max, csEnd);\n\n for (var i = 0; i < sfMin - min; i++)\n refSeq.push('N');\n refSeq.push(currentSequence.seq.substr(sfMin - csStart, sfMax - sfMin + 1));\n for (var i = 0; i < max - sfMax; i++)\n refSeq.push('N');\n }\n }\n return refSeq.join('');\n}\n\n/** Constructs features necessary for a coverage track showing\nbase composition for BAM reads\n\nParams\n features: a list of features from BAM records.\n currentRefSeq: a DASSequence object containing reference sequence.\n baseColors: an object mapping base to desired colors.\n\nReturns a list of features of type base-coverage.\n*/\nfunction getBaseCoverage(features, currentRefSeq, baseColors) {\n var minBin = null;\n var maxBin = null;\n\n var allBins = [];\n\n // Populate BaseBins\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.groups && f.groups.length > 0) {\n // Don't downsample complex features\n return features;\n }\n var processedSeq = alignSeqUsingCigar(f.seq, f.quals, f.cigar);\n var seq = processedSeq.seq;\n var quals = processedSeq.quals;\n var strand = f.orientation;\n var minForFeature = f.min || 0;\n var maxForFeature = f.max || 0;\n var ind = 0;\n\n for (var b = minForFeature; b <= maxForFeature; ++b) {\n var bm = allBins[b];\n if (!bm) {\n bm = new BaseBin(b);\n allBins[b] = bm;\n }\n var base = seq.charAt(ind);\n var qual = quals.charCodeAt(ind) - 33; // Generate numeric qual score\n bm.recordBase(base, qual, strand);\n ind++;\n }\n\n if (!minBin)\n minBin = minForFeature;\n else\n minBin = Math.min(minBin, minForFeature);\n if (!maxBin)\n maxBin = maxForFeature;\n else\n maxBin = Math.max(maxBin, maxForFeature);\n }\n\n // Generate coverage features\n var refSeq = getRefSeq(currentRefSeq, minBin, maxBin);\n var baseFeatures = [];\n var ind = 0;\n for (var b = minBin; b <= maxBin; ++b) {\n var bm = allBins[b];\n if (bm) {\n var f = new DASFeature();\n f.segment = features[0].segment;\n f.min = bm.pos();\n f.max = f.min;\n f.notes = [];\n f.notes = f.notes.concat(bm.infoList());\n f.type = 'base-coverage';\n f.suppressScore = true;\n if (refSeq) {\n var refBase = refSeq.charAt(ind);\n var refString = 'Ref=' + refBase;\n f.notes.unshift(refString);\n var baseScoreList = bm.baseScoreList(refBase, 0.2);\n // TODO: shift 0.2 threshold to a config parameter\n for (var i = 0; i < baseScoreList.length; i++) {\n var base = baseScoreList[i].base;\n var score = baseScoreList[i].score;\n var fBase = shallowCopy(f);\n fBase.score = score;\n // Color by baseColor when mismatch occurs\n // otherwise, BoxGlyph to COLOR1 in style\n if (baseScoreList.length > 1 || base != refBase)\n fBase.itemRgb = baseColors[base];\n\n baseFeatures.push(fBase);\n }\n } else {\n // No refSeq, only show coverage height.\n baseFeatures.push(f);\n }\n }\n ind ++;\n }\n return baseFeatures;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n downsample: downsample,\n getBaseCoverage: getBaseCoverage\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// bin.js general binary data support\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n\n var connectTrix = require('./trix').connectTrix;\n}\n\nvar REGION_PATTERN = /^([\\d+,\\w,\\.,\\_,\\-]+)[\\s:]+([0-9,\\.]+?)([KkMmGg])?((-|\\.\\.|\\s)+([0-9,\\.]+)([KkMmGg])?)?$/;\n\nfunction parseLocCardinal(n, m) {\n var i = parseFloat(n.replace(/,/g, ''));\n if (m === 'k' || m === 'K') {\n return (i * 1000)|0;\n } else if (m == 'm' || m === 'M') {\n return (i * 1000000)|0;\n } else {\n return i|0;\n }\n}\n\nBrowser.prototype.search = function(g, statusCallback, opts) {\n var thisB = this;\n opts = opts || {};\n var srPadding = opts.padding || this.defaultSearchRegionPadding;\n \n var m = REGION_PATTERN.exec(g);\n\n if (m) {\n var chr = m[1], start, end;\n if (m[6]) {\n start = parseLocCardinal(m[2], m[3]);\n end = parseLocCardinal(m[6], m[7]);\n } else {\n var width = this.viewEnd - this.viewStart + 1;\n start = (parseLocCardinal(m[2], m[3]) - (width/2))|0;\n end = start + width - 1;\n }\n this.setLocation(chr, start, end, statusCallback);\n } else {\n if (!g || g.length == 0) {\n return false;\n }\n\n var searchCount = 0;\n var foundLatch = false;\n\n var searchCallback = function(found, err) {\n --searchCount;\n if (err) {\n return statusCallback(err);\n }\n\n if (!found) found = [];\n var min = 500000000, max = -100000000;\n var nchr = null;\n for (var fi = 0; fi < found.length; ++fi) {\n var f = found[fi];\n \n if (nchr == null) {\n nchr = f.segment;\n }\n min = Math.min(min, f.min);\n max = Math.max(max, f.max);\n }\n\n if (!nchr) {\n if (searchCount == 0 && !foundLatch)\n return statusCallback(\"no match for '\" + g + \"'\");\n } else {\n foundLatch = true;\n thisB.highlightRegion(nchr, min, max);\n\n var mid = ((max+min)/2)|0\n var padding = Math.max(srPadding, (0.3 * (max - min + 1))|0);\n thisB.setLocation(nchr, min - padding, max + padding, statusCallback);\n }\n }\n\n var doTrixSearch = function(tier, trix) {\n trix.lookup(g, function(result, status) {\n if (result == null || result.length < 2) {\n return tier.featureSource.search(g, searchCallback);\n } else {\n var hit = result[1].split(',')[0];\n return tier.featureSource.search(hit, searchCallback);\n }\n });\n }\n\n if (this.searchEndpoint) {\n searchCount = 1;\n return this.doDasSearch(thisB.searchEndpoint, g, searchCallback);\n }\n\n\n const searchSources = [\n ...(this.searchOnlySourceHolders || []),\n ...this.tiers\n ];\n\n for (var ti = 0; ti < searchSources.length; ++ti) {\n (function(tier) {\n if (thisB.sourceAdapterIsCapable(tier.featureSource, 'search')) {\n if (tier.dasSource.trixURI) {\n ++searchCount;\n if (tier.trix) {\n doTrixSearch(tier, tier.trix);\n } else {\n var ix = new URLFetchable(\n tier.dasSource.trixURI,\n {credentials: tier.dasSource.credentials,\n resolver: tier.dasSource.resolver}\n );\n\n var ixx = new URLFetchable(\n tier.dasSource.trixxURI || (tier.dasSource.trixURI + 'x'),\n {credentials: tier.dasSource.credentials,\n resolver: tier.dasSource.resolver}\n );\n\n connectTrix(ix, ixx, function(trix) {\n tier.trix = trix;\n doTrixSearch(tier, trix);\n });\n }\n } else {\n ++searchCount;\n tier.featureSource.search(g, searchCallback);\n }\n } else if (tier.dasSource.provides_search) {\n ++searchCount;\n thisB.doDasSearch(tier.dasSource, g, searchCallback);\n }\n })(searchSources[ti]);\n }\n }\n}\n\nBrowser.prototype.doDasSearch = function(source, g, searchCallback) {\n var thisB = this;\n source.features(null, {group: g, type: 'transcript'}, function(found) {\n if (!found) found = [];\n var min = 500000000, max = -100000000;\n var nchr = null;\n\n var found2 = [];\n for (var fi = 0; fi < found.length; ++fi) {\n var f = found[fi];\n \n if (f.label.toLowerCase() != g.toLowerCase()) {\n // ...because Dazzle can return spurious overlapping features.\n continue;\n }\n found2.push(f);\n }\n\n return searchCallback(found2);\n }, false);\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2012\n//\n// sequence-draw.js: renderers for sequence-related data\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var formatLongInt = utils.formatLongInt;\n var makeElementNS = utils.makeElementNS;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n\n var nf = require('./numformats');\n var formatLongInt = nf.formatLongInt;\n}\n\nvar MIN_TILE = 100;\nvar rulerTileColors = ['black', 'white'];\n\nvar steps = [1,2,5];\n\n\nvar NS_SVG = 'http://www.w3.org/2000/svg';\n\n\nfunction tileSizeForScale(scale, min)\n{\n if (!min) {\n min = MIN_TILE;\n }\n\n function ts(p) {\n return steps[p % steps.length] * Math.pow(10, (p / steps.length)|0);\n }\n var pow = steps.length;\n while (scale * ts(pow) < min) {\n ++pow;\n }\n return ts(pow);\n}\n\nfunction drawSeqTier(tier, seq) {\n var gc = tier.viewport.getContext('2d');\n var retina = tier.browser.retina && window.devicePixelRatio > 1;\n var desiredWidth = tier.browser.featurePanelWidth + 2000;\n if (retina) {\n desiredWidth *= 2;\n }\n var fpw = tier.viewport.width|0; // this.browser.featurePanelWidth;\n if (fpw < desiredWidth - 50) {\n tier.viewport.width = fpw = desiredWidth;\n }\n\n var height = 50;\n if (seq && seq.seq) {\n height += 25;\n }\n\n var canvasHeight = height;\n if (retina) \n canvasHeight *= 2;\n\n tier.viewport.height = canvasHeight;\n tier.viewport.style.height = '' + height + 'px';\n tier.viewport.style.width = retina ? ('' + (fpw/2) + 'px') : ('' + fpw + 'px');\n tier.layoutHeight = height;\n tier.updateHeight();\n\n \n if (tier.background) {\n gc.fillStyle = tier.background;\n gc.fillRect(0, 0, fpw, tier.viewport.height);\n }\n if (retina) {\n gc.scale(2, 2);\n }\n\n gc.translate(1000,0);\n drawSeqTierGC(tier, seq, gc);\n tier.norigin = tier.browser.viewStart;\n tier.viewportHolder.style.left = '-1000px';\n}\n\nfunction drawSeqTierGC(tier, seq, gc)\n{\n var scale = tier.browser.scale, knownStart = tier.browser.viewStart - (1000/scale)|0, knownEnd = tier.browser.viewEnd + (2000/scale), currentSeqMax = tier.browser.currentSeqMax;\n\n var seqTierMax = knownEnd;\n if (currentSeqMax > 0 && currentSeqMax < knownEnd) {\n seqTierMax = currentSeqMax;\n }\n var tile = tileSizeForScale(scale);\n var pos = Math.max(0, ((knownStart / tile)|0) * tile);\n \n var origin = tier.browser.viewStart;\n\n while (pos <= seqTierMax) {\n\t\tgc.fillStyle = ((pos / tile) % 2 == 0) ? 'white' : 'black';\n\t\tgc.strokeStyle = 'black';\n\t\tgc.fillRect((pos - origin) * scale,\n\t\t\t 8,\n\t\t\t tile*scale,\n\t\t\t 3);\n\t\tgc.strokeRect((pos - origin) * scale,\n\t\t\t 8,\n\t\t\t tile*scale,\n\t\t\t 3);\n\n\t\tgc.fillStyle = 'black';\n\t\tgc.fillText(formatLongInt(pos), ((pos - origin) * scale), 22);\n\t\t\n\n\t\tpos += tile;\n }\n\n if (seq && seq.seq) {\n\t\tfor (var p = knownStart; p <= knownEnd; ++p) {\n\t\t if (p >= seq.start && p <= seq.end) {\n\t\t\t\tvar base = seq.seq.substr(p - seq.start, 1).toUpperCase();\n\t\t\t\tvar color = tier.browser.baseColors[base];\n\t\t\t\tif (!color) {\n\t\t color = 'gray';\n\t\t\t\t}\n\n\t\t\t\tgc.fillStyle = color;\n\n\t\t\t\tif (scale >= 8) {\n var w = gc.measureText(base).width;\n // console.log(scale-w);\n\t\t\t\t gc.fillText(base, (p - origin) * scale + ((scale-w)*0.5) , 52);\n\t\t\t\t} else {\n\t\t\t\t gc.fillRect((p - origin) * scale, 42, scale, 12); \n\t\t\t\t}\n\t\t }\n\t\t}\n }\n}\n\nfunction svgSeqTier(tier, seq) {\n var scale = tier.browser.scale, knownStart = tier.browser.viewStart - (1000/scale)|0, knownEnd = tier.browser.viewEnd + (2000/scale), currentSeqMax = tier.browser.currentSeqMax;\n\n var fpw = tier.viewport.width|0; \n\n var seqTierMax = knownEnd;\n if (currentSeqMax > 0 && currentSeqMax < knownEnd) {\n seqTierMax = currentSeqMax;\n }\n var tile = tileSizeForScale(scale);\n var pos = Math.max(0, ((knownStart / tile)|0) * tile);\n \n var origin = tier.browser.viewStart;\n\n var g = makeElementNS(NS_SVG, 'g', [], {fontSize: '8pt'}); \n while (pos <= seqTierMax) {\n \tg.appendChild(\n \t makeElementNS(\n \t\tNS_SVG, 'rect',\n \t\tnull,\n \t\t{x: (pos-origin)*scale,\n \t\t y: 8,\n \t\t width: tile*scale,\n \t\t height: 3,\n \t\t fill: ((pos / tile) % 2 == 0) ? 'white' : 'black',\n \t\t stroke: 'black'}));\n\n \tg.appendChild(\n \t makeElementNS(\n \t\tNS_SVG, 'text',\n \t\tformatLongInt(pos),\n \t\t{x: (pos-origin)*scale,\n \t\t y: 28,\n \t\t fill: 'black', stroke: 'none'}));\n \t\n \tpos += tile;\n }\n\n if (seq && seq.seq) {\n \tfor (var p = knownStart; p <= knownEnd; ++p) {\n \t if (p >= seq.start && p <= seq.end) {\n \t\tvar base = seq.seq.substr(p - seq.start, 1).toUpperCase();\n \t\tvar color = tier.browser.baseColors[base];\n \t\tif (!color) {\n color = 'gray';\n \t\t}\n\n \t\tif (scale >= 8) {\n \t\t g.appendChild(\n \t\t\tmakeElementNS(NS_SVG, 'text', base, {\n \t\t\t x: (0.5+p-origin)*scale,\n \t\t\t y: 52,\n textAnchor: 'middle',\n \t\t\t fill: color}));\n \t\t} else {\n \t\t g.appendChild(\n \t\t\tmakeElementNS(NS_SVG, 'rect', null, {\n \t\t\t x: (p - origin)*scale,\n \t\t\t y: 42,\n \t\t\t width: scale,\n \t\t\t height: 12,\n \t fill: color}));\n\n \t\t}\n \t }\n \t}\n } \n\n return g;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n drawSeqTier: drawSeqTier,\n drawSeqTierGC: drawSeqTierGC,\n svgSeqTier: svgSeqTier\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// session.js\n//\n\n\"use strict\";\n\nif (typeof(require) != 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var sc = require('./sourcecompare');\n var sourceDataURI = sc.sourceDataURI;\n var sourcesAreEqual = sc.sourcesAreEqual;\n\n var VERSION = require('./version');\n\n var utils = require('./utils');\n var miniJSONify = utils.miniJSONify;\n\n var sha1 = require('./sha1');\n var hex_sha1 = sha1.hex_sha1;\n}\n\nBrowser.prototype.nukeStatus = function() {\n delete localStorage['dalliance.' + this.cookieKey + '.view-chr'];\n delete localStorage['dalliance.' + this.cookieKey + '.view-start'];\n delete localStorage['dalliance.' + this.cookieKey + '.view-end'];\n delete localStorage['dalliance.' + this.cookieKey + '.current-seq-length'];\n delete localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom'];\n delete localStorage['dalliance.' + this.cookieKey + '.saved-zoom'];\n\n delete localStorage['dalliance.' + this.cookieKey + '.sources'];\n delete localStorage['dalliance.' + this.cookieKey + '.hubs'];\n delete localStorage['dalliance.' + this.cookieKey + '.version'];\n\n delete localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'];\n delete localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'];\n delete localStorage['dalliance.' + this.cookieKey + '.ruler-location'];\n}\n\nBrowser.prototype.storeStatus = function() {\n this.storeViewStatus();\n this.storeTierStatus();\n}\n\nBrowser.prototype.storeViewStatus = function() {\n if (!this.cookieKey || this.noPersist || this.noPersistView) {\n return;\n }\n\n localStorage['dalliance.' + this.cookieKey + '.view-chr'] = this.chr;\n localStorage['dalliance.' + this.cookieKey + '.view-start'] = this.viewStart|0;\n localStorage['dalliance.' + this.cookieKey + '.view-end'] = this.viewEnd|0\n localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom'] = '' + this.isSnapZooming;\n localStorage['dalliance.' + this.cookieKey + '.saved-zoom'] = this.savedZoom;\n if (this.currentSeqMax) {\n\t localStorage['dalliance.' + this.cookieKey + '.current-seq-length'] = this.currentSeqMax;\n }\n}\n\n\nBrowser.prototype.storeTierStatus = function() {\n if (!this.cookieKey || this.noPersist) {\n return;\n }\n\n var currentSourceList = [];\n for (var t = 0; t < this.tiers.length; ++t) {\n var tt = this.tiers[t];\n var ts = tt.dasSource;\n if (!ts.noPersist) {\n currentSourceList.push({source: tt.dasSource, config: tt.config || {}});\n }\n }\n localStorage['dalliance.' + this.cookieKey + '.sources'] = JSON.stringify(currentSourceList);\n\n\n var coveredHubURLs = {};\n var currentHubList = [];\n for (var hi = 0; hi < this.hubObjects.length; ++hi) {\n var tdb = this.hubObjects[hi];\n var hc = {url: tdb.hub.url, genome: tdb.genome};\n if (tdb.credentials)\n hc.credentials = tdb.credentials;\n if (tdb.mapping)\n hc.mapping = tdb.mapping;\n coveredHubURLs[hc.url] = true;\n currentHubList.push(hc);\n }\n\n // Needed to handle hubs that failed to connect, or hubs that haven't\n // connected yet when we're called soon after startup.\n for (var hi = 0; hi < this.hubs.length; ++hi) {\n var hc = this.hubs[hi];\n if (typeof hc === 'string')\n hc = {url: hc};\n if (!coveredHubURLs[hc.url])\n currentHubList.push(hc);\n }\n\n localStorage['dalliance.' + this.cookieKey + '.hubs'] = JSON.stringify(currentHubList);\n\n localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'] = this.reverseScrolling;\n localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'] = this.reverseKeyScrolling;\n localStorage['dalliance.' + this.cookieKey + '.single-base-highlight'] = this.singleBaseHighlight;\n localStorage['dalliance.' + this.cookieKey + '.ruler-location'] = this.rulerLocation;\n\n localStorage['dalliance.' + this.cookieKey + '.export-ruler'] = this.exportRuler;\n localStorage['dalliance.' + this.cookieKey + '.export-highlights'] = this.exportHighlights;\n \n localStorage['dalliance.' + this.cookieKey + '.version'] = VERSION.CONFIG;\n}\n\nBrowser.prototype.restoreStatus = function() {\n if (this.noPersist)\n return;\n \n var storedConfigVersion = localStorage['dalliance.' + this.cookieKey + '.version'];\n if (storedConfigVersion) {\n storedConfigVersion = storedConfigVersion|0;\n } else {\n storedConfigVersion = -100;\n }\n if (VERSION.CONFIG != storedConfigVersion) {\n return;\n }\n\n var storedConfigHash = localStorage['dalliance.' + this.cookieKey + '.configHash'] || '';\n var pageConfigHash = hex_sha1(miniJSONify({\n sources: this.sources,\n hubs: this.hubs,\n rulerLocation: this.rulerLocation\n }));\n if (pageConfigHash != storedConfigHash) {\n localStorage['dalliance.' + this.cookieKey + '.configHash'] = pageConfigHash;\n return;\n }\n\n var defaultSourcesByURI = {};\n for (var si = 0; si < this.sources.length; ++si) {\n var source = this.sources[si];\n if (!source)\n continue;\n\n var uri = sourceDataURI(source);\n var ul = defaultSourcesByURI[uri];\n if (!ul)\n defaultSourcesByURI[uri] = ul = [];\n ul.push(source);\n \n }\n\n if (!this.noPersistView) {\n var qChr = localStorage['dalliance.' + this.cookieKey + '.view-chr'];\n var qMin = localStorage['dalliance.' + this.cookieKey + '.view-start']|0;\n var qMax = localStorage['dalliance.' + this.cookieKey + '.view-end']|0;\n if (qChr && qMin && qMax) {\n \tthis.chr = qChr;\n \tthis.viewStart = qMin;\n \tthis.viewEnd = qMax;\n \t\n \tvar csm = localStorage['dalliance.' + this.cookieKey + '.current-seq-length'];\n \tif (csm) {\n \t this.currentSeqMax = csm|0;\n \t}\n\n this.isSnapZooming = (localStorage['dalliance.' + this.cookieKey + '.showing-alt-zoom']) == 'true';\n\n var sz = parseFloat(localStorage['dalliance.' + this.cookieKey + '.saved-zoom']);\n if (typeof sz === 'number' && !isNaN(sz)) {\n this.savedZoom = sz;\n }\n }\n }\n\n var rs = localStorage['dalliance.' + this.cookieKey + '.reverse-scrolling'];\n this.reverseScrolling = (rs && rs == 'true');\n var rks = localStorage['dalliance.' + this.cookieKey + '.reverse-key-scrolling'];\n this.reverseKeyScrolling = (rks && rks == 'true');\n var sbh = localStorage['dalliance.' + this.cookieKey + '.single-base-highlight'];\n this.singleBaseHighlight = (sbh && sbh == 'true');\n \n var rl = localStorage['dalliance.' + this.cookieKey + '.ruler-location'];\n if (rl)\n this.rulerLocation = rl;\n\n var x = localStorage['dalliance.' + this.cookieKey + '.export-ruler'];\n if (x)\n this.exportRuler = (x === 'true');\n var x = localStorage['dalliance.' + this.cookieKey + '.export-highlights'];\n if (x)\n this.exportHighlights = (x === 'true');\n\n var sourceStr = localStorage['dalliance.' + this.cookieKey + '.sources'];\n if (sourceStr) {\n\t var storedSources = JSON.parse(sourceStr);\n this.sources = [];\n this.restoredConfigs = [];\n for (var si = 0; si < storedSources.length; ++si) {\n var source = this.sources[si] = storedSources[si].source;\n this.restoredConfigs[si] = storedSources[si].config;\n var uri = sourceDataURI(source);\n var ul = defaultSourcesByURI[uri] || [];\n for (var osi = 0; osi < ul.length; ++osi) { \n var oldSource = ul[osi];\n if (sourcesAreEqual(source, oldSource)) {\n for (var k in oldSource) {\n if (oldSource.hasOwnProperty(k) && \n (typeof(oldSource[k]) === 'function' || oldSource[k] instanceof Blob))\n {\n source[k] = oldSource[k];\n }\n }\n }\n }\n }\n }\n\n var hubStr = localStorage['dalliance.' + this.cookieKey + '.hubs'];\n if (hubStr) {\n this.hubs = JSON.parse(hubStr);\n }\n\n return true;\n}\n\nBrowser.prototype.reset = function() {\n for (var i = this.tiers.length - 1; i >= 0; --i) {\n this.removeTier({index: i}, true);\n }\n for (var i = 0; i < this.defaultSources.length; ++i) {\n var s = this.defaultSources[i];\n if (!s.disabled) \n this.addTier(this.defaultSources[i]);\n }\n\n this.highlights.splice(0, this.highlights.length);\n\n this.setLocation(this.defaultChr, this.defaultStart, this.defaultEnd);\n}\n","/*\r\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\r\n * in FIPS 180-1\r\n * Version 2.2 Copyright Paul Johnston 2000 - 2009.\r\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n * Distributed under the BSD License\r\n * See http://pajhome.org.uk/crypt/md5 for details.\r\n */\r\n\r\n \"use strict\";\r\n\r\n/*\r\n * Configurable variables. You may need to tweak these to be compatible with\r\n * the server-side, but the defaults work in most cases.\r\n */\r\nvar hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */\r\nvar b64pad = \"\"; /* base-64 pad character. \"=\" for strict RFC compliance */\r\n\r\n/*\r\n * These are the functions you'll usually want to call\r\n * They take string arguments and return either hex or base-64 encoded strings\r\n */\r\nfunction hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }\r\nfunction b64_sha1(s) { return rstr2b64(rstr_sha1(str2rstr_utf8(s))); }\r\nfunction any_sha1(s, e) { return rstr2any(rstr_sha1(str2rstr_utf8(s)), e); }\r\nfunction hex_hmac_sha1(k, d)\r\n { return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d))); }\r\nfunction b64_hmac_sha1(k, d)\r\n { return rstr2b64(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d))); }\r\nfunction any_hmac_sha1(k, d, e)\r\n { return rstr2any(rstr_hmac_sha1(str2rstr_utf8(k), str2rstr_utf8(d)), e); }\r\n\r\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\r\nfunction sha1_vm_test()\r\n{\r\n return hex_sha1(\"abc\").toLowerCase() == \"a9993e364706816aba3e25717850c26c9cd0d89d\";\r\n}\r\n\r\n/*\r\n * Calculate the SHA1 of a raw string\r\n */\r\nfunction rstr_sha1(s)\r\n{\r\n return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));\r\n}\r\n\r\n/*\r\n * Calculate the HMAC-SHA1 of a key and some data (raw strings)\r\n */\r\nfunction rstr_hmac_sha1(key, data)\r\n{\r\n var bkey = rstr2binb(key);\r\n if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);\r\n\r\n var ipad = Array(16), opad = Array(16);\r\n for(var i = 0; i < 16; i++)\r\n {\r\n ipad[i] = bkey[i] ^ 0x36363636;\r\n opad[i] = bkey[i] ^ 0x5C5C5C5C;\r\n }\r\n\r\n var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);\r\n return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));\r\n}\r\n\r\n/*\r\n * Convert a raw string to a hex string\r\n */\r\nfunction rstr2hex(input)\r\n{\r\n // try { hexcase } catch(e) { hexcase=0; }\r\n var hex_tab = hexcase ? \"0123456789ABCDEF\" : \"0123456789abcdef\";\r\n var output = \"\";\r\n var x;\r\n for(var i = 0; i < input.length; i++)\r\n {\r\n x = input.charCodeAt(i);\r\n output += hex_tab.charAt((x >>> 4) & 0x0F)\r\n + hex_tab.charAt( x & 0x0F);\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to a base-64 string\r\n */\r\nfunction rstr2b64(input)\r\n{\r\n // try { b64pad } catch(e) { b64pad=''; }\r\n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n var output = \"\";\r\n var len = input.length;\r\n for(var i = 0; i < len; i += 3)\r\n {\r\n var triplet = (input.charCodeAt(i) << 16)\r\n | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)\r\n | (i + 2 < len ? input.charCodeAt(i+2) : 0);\r\n for(var j = 0; j < 4; j++)\r\n {\r\n if(i * 8 + j * 6 > input.length * 8) output += b64pad;\r\n else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);\r\n }\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to an arbitrary string encoding\r\n */\r\nfunction rstr2any(input, encoding)\r\n{\r\n var divisor = encoding.length;\r\n var remainders = Array();\r\n var i, q, x, quotient;\r\n\r\n /* Convert to an array of 16-bit big-endian values, forming the dividend */\r\n var dividend = Array(Math.ceil(input.length / 2));\r\n for(i = 0; i < dividend.length; i++)\r\n {\r\n dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);\r\n }\r\n\r\n /*\r\n * Repeatedly perform a long division. The binary array forms the dividend,\r\n * the length of the encoding is the divisor. Once computed, the quotient\r\n * forms the dividend for the next step. We stop when the dividend is zero.\r\n * All remainders are stored for later use.\r\n */\r\n while(dividend.length > 0)\r\n {\r\n quotient = Array();\r\n x = 0;\r\n for(i = 0; i < dividend.length; i++)\r\n {\r\n x = (x << 16) + dividend[i];\r\n q = Math.floor(x / divisor);\r\n x -= q * divisor;\r\n if(quotient.length > 0 || q > 0)\r\n quotient[quotient.length] = q;\r\n }\r\n remainders[remainders.length] = x;\r\n dividend = quotient;\r\n }\r\n\r\n /* Convert the remainders to the output string */\r\n var output = \"\";\r\n for(i = remainders.length - 1; i >= 0; i--)\r\n output += encoding.charAt(remainders[i]);\r\n\r\n /* Append leading zero equivalents */\r\n var full_length = Math.ceil(input.length * 8 /\r\n (Math.log(encoding.length) / Math.log(2)))\r\n for(i = output.length; i < full_length; i++)\r\n output = encoding[0] + output;\r\n\r\n return output;\r\n}\r\n\r\n/*\r\n * Encode a string as utf-8.\r\n * For efficiency, this assumes the input is valid utf-16.\r\n */\r\nfunction str2rstr_utf8(input)\r\n{\r\n var output = \"\";\r\n var i = -1;\r\n var x, y;\r\n\r\n while(++i < input.length)\r\n {\r\n /* Decode utf-16 surrogate pairs */\r\n x = input.charCodeAt(i);\r\n y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;\r\n if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)\r\n {\r\n x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);\r\n i++;\r\n }\r\n\r\n /* Encode output as utf-8 */\r\n if(x <= 0x7F)\r\n output += String.fromCharCode(x);\r\n else if(x <= 0x7FF)\r\n output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),\r\n 0x80 | ( x & 0x3F));\r\n else if(x <= 0xFFFF)\r\n output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),\r\n 0x80 | ((x >>> 6 ) & 0x3F),\r\n 0x80 | ( x & 0x3F));\r\n else if(x <= 0x1FFFFF)\r\n output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),\r\n 0x80 | ((x >>> 12) & 0x3F),\r\n 0x80 | ((x >>> 6 ) & 0x3F),\r\n 0x80 | ( x & 0x3F));\r\n }\r\n return output;\r\n}\r\n\r\n/*\r\n * Encode a string as utf-16\r\n */\r\nfunction str2rstr_utf16le(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length; i++)\r\n output += String.fromCharCode( input.charCodeAt(i) & 0xFF,\r\n (input.charCodeAt(i) >>> 8) & 0xFF);\r\n return output;\r\n}\r\n\r\nfunction str2rstr_utf16be(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length; i++)\r\n output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,\r\n input.charCodeAt(i) & 0xFF);\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert a raw string to an array of big-endian words\r\n * Characters >255 have their high-byte silently ignored.\r\n */\r\nfunction rstr2binb(input)\r\n{\r\n var output = Array(input.length >> 2);\r\n for(var i = 0; i < output.length; i++)\r\n output[i] = 0;\r\n for(var i = 0; i < input.length * 8; i += 8)\r\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\r\n return output;\r\n}\r\n\r\n/*\r\n * Convert an array of big-endian words to a string\r\n */\r\nfunction binb2rstr(input)\r\n{\r\n var output = \"\";\r\n for(var i = 0; i < input.length * 32; i += 8)\r\n output += String.fromCharCode((input[i>>5] >>> (24 - i % 32)) & 0xFF);\r\n return output;\r\n}\r\n\r\n/*\r\n * Calculate the SHA-1 of an array of big-endian words, and a bit length\r\n */\r\nfunction binb_sha1(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << (24 - len % 32);\r\n x[((len + 64 >> 9) << 4) + 15] = len;\r\n\r\n var w = Array(80);\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n var e = -1009589776;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n var olde = e;\r\n\r\n for(var j = 0; j < 80; j++)\r\n {\r\n if(j < 16) w[j] = x[i + j];\r\n else w[j] = bit_rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\r\n var t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)),\r\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\r\n e = d;\r\n d = c;\r\n c = bit_rol(b, 30);\r\n b = a;\r\n a = t;\r\n }\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n e = safe_add(e, olde);\r\n }\r\n return Array(a, b, c, d, e);\r\n\r\n}\r\n\r\n/*\r\n * Perform the appropriate triplet combination function for the current\r\n * iteration\r\n */\r\nfunction sha1_ft(t, b, c, d)\r\n{\r\n if(t < 20) return (b & c) | ((~b) & d);\r\n if(t < 40) return b ^ c ^ d;\r\n if(t < 60) return (b & c) | (b & d) | (c & d);\r\n return b ^ c ^ d;\r\n}\r\n\r\n/*\r\n * Determine the appropriate additive constant for the current iteration\r\n */\r\nfunction sha1_kt(t)\r\n{\r\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\r\n (t < 60) ? -1894007588 : -899497514;\r\n}\r\n\r\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\r\nfunction safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}\r\n\r\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\r\nfunction bit_rol(num, cnt)\r\n{\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n}\r\n\r\nif (typeof(module) !== 'undefined') {\r\n module.exports = {\r\n b64_sha1: b64_sha1,\r\n hex_sha1: hex_sha1\r\n }\r\n}\r\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// sourceadapters.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var tier = require('./tier');\n var DasTier = tier.DasTier;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n var arrayIndexOf = utils.arrayIndexOf;\n var shallowCopy = utils.shallowCopy;\n var resolveUrlToPage = utils.resolveUrlToPage;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASSource = das.DASSource;\n var DASSegment = das.DASSegment;\n var DASFeature = das.DASFeature;\n var DASSequence = das.DASSequence;\n var DASLink = das.DASLink;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n\n var twoBit = require('./twoBit');\n var makeTwoBit = twoBit.makeTwoBit;\n\n var bbi = require('./bigwig');\n var makeBwg = bbi.makeBwg;\n\n var bam = require('./bam');\n var makeBam = bam.makeBam;\n var BamFlags = bam.BamFlags;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n\n var parseCigar = require('./cigar').parseCigar;\n\n var OverlayFeatureSource = require('./overlay').OverlayFeatureSource;\n\n var JBrowseStore = require('./jbjson').JBrowseStore;\n\n var Chainset = require('./chainset').Chainset;\n\n var style = require('./style');\n var StyleFilterSet = style.StyleFilterSet;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nvar __dalliance_sourceAdapterFactories = {};\n\nfunction dalliance_registerSourceAdapterFactory(type, factory) {\n __dalliance_sourceAdapterFactories[type] = factory;\n}\n\n\nvar __dalliance_parserFactories = {};\n\nfunction dalliance_registerParserFactory(type, factory) {\n __dalliance_parserFactories[type] = factory;\n}\n\nfunction dalliance_makeParser(type) {\n if (__dalliance_parserFactories[type]) {\n return __dalliance_parserFactories[type](type);\n }\n}\n\n\nDasTier.prototype.initSources = function() {\n var thisTier = this;\n\n var sources = this.browser.createSources(this.dasSource);\n this.featureSource = sources.features || new DummyFeatureSource();\n this.sequenceSource = sources.sequence;\n\n if (this.featureSource && this.featureSource.addChangeListener) {\n this.featureSource.addChangeListener(function() {\n thisTier.browser.refreshTier(thisTier);\n });\n }\n};\n\nBrowser.prototype.createSources = function(config) {\n var sources = this.sourceCache.get(config);\n if (sources)\n return sources;\n\n var fs, ss;\n\n if (config.tier_type == 'sequence' || config.twoBitURI || config.twoBitBlob) {\n if (config.twoBitURI || config.twoBitBlob) {\n ss = new TwoBitSequenceSource(config);\n } else if (config.ensemblURI) {\n ss = new EnsemblSequenceSource(config);\n } else {\n ss = new DASSequenceSource(config);\n }\n } else if (config.tier_type && __dalliance_sourceAdapterFactories[config.tier_type]) {\n var saf = __dalliance_sourceAdapterFactories[config.tier_type];\n var ns = saf(config);\n fs = ns.features;\n ss = ns.sequence;\n } else if (config.bwgURI || config.bwgBlob) {\n var worker = this.getWorker();\n if (worker)\n fs = new RemoteBWGFeatureSource(config, worker, this);\n else\n fs = new BWGFeatureSource(config);\n } else if (config.bamURI || config.bamBlob) {\n var worker = this.getWorker();\n if (worker)\n fs = new RemoteBAMFeatureSource(config, worker, this);\n else\n fs = new BAMFeatureSource(config);\n } else if (config.jbURI) {\n fs = new JBrowseFeatureSource(config);\n } else if (config.uri || config.features_uri) {\n fs = new DASFeatureSource(config);\n }\n\n if (config.overlay) {\n var sources = [];\n if (fs)\n sources.push(new CachingFeatureSource(fs));\n\n for (var oi = 0; oi < config.overlay.length; ++oi) {\n var cs = this.createSources(config.overlay[oi]);\n if (cs && cs.features)\n sources.push(cs.features);\n }\n fs = new OverlayFeatureSource(sources, config);\n }\n\n if (config.sequenceAliases) {\n fs = new MappedFeatureSource(fs, new Chainset({type: 'alias', sequenceAliases: config.sequenceAliases}));\n }\n\n if (config.mapping) {\n fs = new MappedFeatureSource(fs, this.chains[config.mapping]);\n }\n\n if (config.name && fs && !fs.name) {\n fs.name = config.name;\n }\n\n if (typeof fs !== 'undefined' && fs !== null) {\n fs = new CachingFeatureSource(fs);\n }\n\n if ( (typeof fs !== 'undefined' && fs !== null) || (typeof ss !== 'undefined' && ss != null) ) {\n sources = {\n features: fs,\n sequence: ss\n };\n this.sourceCache.put(config, sources);\n }\n\n return sources;\n};\n\nDasTier.prototype.fetchStylesheet = function(cb) {\n var ssSource;\n // Somewhat ugly workaround for the special case of DAS sources...\n if (this.dasSource.stylesheet_uri || (\n !this.dasSource.tier_type &&\n !this.dasSource.bwgURI &&\n !this.dasSource.bwgBlob &&\n !this.dasSource.bamURI &&\n !this.dasSource.bamBlob &&\n !this.dasSource.twoBitURI &&\n !this.dasSource.twoBitBlob &&\n !this.dasSource.jbURI &&\n !this.dasSource.overlay))\n {\n ssSource = new DASFeatureSource(this.dasSource);\n } else {\n ssSource = this.getSource();\n }\n ssSource.getStyleSheet(cb);\n};\n\nvar __cfs_id_seed = 0;\n\nfunction CachingFeatureSource(source) {\n var thisB = this;\n\n this.source = source;\n this.cfsid = 'cfs' + (++__cfs_id_seed);\n if (source.name) {\n this.name = source.name;\n }\n if (source.addChangeListener) {\n source.addChangeListener(function() {\n thisB.cfsid = 'cfs' + (++__cfs_id_seed);\n });\n }\n}\n\nCachingFeatureSource.prototype.addReadinessListener = function(listener) {\n if (this.source.addReadinessListener)\n return this.source.addReadinessListener(listener);\n else\n listener(null);\n};\n\nCachingFeatureSource.prototype.removeReadinessListener = function(listener) {\n if (this.source.removeReadinessListener)\n return this.source.removeReadinessListener(listener);\n};\n\nCachingFeatureSource.prototype.search = function(query, callback) {\n if (this.source.search)\n return this.source.search(query, callback);\n};\n\nCachingFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.source.getDefaultFIPs)\n return this.source.getDefaultFIPs(callback); \n};\n\nCachingFeatureSource.prototype.getStyleSheet = function(callback) {\n this.source.getStyleSheet(callback);\n};\n\nCachingFeatureSource.prototype.getScales = function() {\n return this.source.getScales();\n};\n\nCachingFeatureSource.prototype.addActivityListener = function(l) {\n if (this.source.addActivityListener) {\n this.source.addActivityListener(l);\n }\n};\n\nCachingFeatureSource.prototype.removeActivityListener = function(l) {\n if (this.source.removeActivityListener) {\n this.source.removeActivityListener(l);\n }\n};\n\nCachingFeatureSource.prototype.addChangeListener = function(l) {\n if (this.source.addChangeListener)\n this.source.addChangeListener(l);\n};\n\nCachingFeatureSource.prototype.removeChangeListener = function(l) {\n if (this.source.removeChangeListener)\n this.source.removeChangeListener(l);\n};\n\nCachingFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n this.source.findNextFeature(chr, pos, dir, callback);\n};\n\nCachingFeatureSource.prototype.quantFindNextFeature = function(chr, pos, dir, threshold, callback) {\n this.source.quantFindNextFeature(chr, pos, dir, threshold, callback);\n};\n\nCachingFeatureSource.prototype.capabilities = function() {\n if (this.source.capabilities) {\n return this.source.capabilities();\n } else {\n return {};\n }\n};\n\nCachingFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback, styleFilters) {\n if (!pool) {\n throw Error('Fetch pool is null');\n }\n\n var self = this;\n var cacheKey = this.cfsid;\n\n var awaitedFeatures = pool.awaitedFeatures[cacheKey];\n if (awaitedFeatures && awaitedFeatures.started) {\n if (awaitedFeatures.styleFilters.doesNotContain(styleFilters)) {\n // console.log('Fetch already started with wrong parameters, skipping cache.');\n self.source.fetch(chr, min, max, scale, types, pool, callback, styleFilters);\n return;\n }\n } else if (awaitedFeatures) {\n awaitedFeatures.styleFilters.addAll(styleFilters);\n } else {\n awaitedFeatures = new Awaited();\n awaitedFeatures.styleFilters = styleFilters;\n pool.awaitedFeatures[cacheKey] = awaitedFeatures;\n\n pool.requestsIssued.then(function() {\n awaitedFeatures.started = true;\n self.source.fetch(\n chr, \n min, \n max, \n scale, \n awaitedFeatures.styleFilters.typeList(), \n pool, \n function(status, features, scale, coverage) {\n if (!awaitedFeatures.res)\n awaitedFeatures.provide({status: status, features: features, scale: scale, coverage: coverage});\n }, \n awaitedFeatures.styleFilters);\n }).catch(function(err) {\n console.log(err);\n });\n } \n\n awaitedFeatures.await(function(af) {\n callback(af.status, af.features, af.scale, af.coverage);\n });\n};\n \nfunction FeatureSourceBase() {\n this.busy = 0;\n this.activityListeners = [];\n this.readinessListeners = [];\n this.readiness = null;\n}\n\nFeatureSourceBase.prototype.addReadinessListener = function(listener) {\n this.readinessListeners.push(listener);\n listener(this.readiness);\n};\n\nFeatureSourceBase.prototype.removeReadinessListener = function(listener) {\n var idx = arrayIndexOf(this.readinessListeners, listener);\n if (idx >= 0) {\n this.readinessListeners.splice(idx, 1);\n }\n};\n\nFeatureSourceBase.prototype.notifyReadiness = function() {\n for (var li = 0; li < this.readinessListeners.length; ++li) {\n try {\n this.readinessListeners[li](this.readiness);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nFeatureSourceBase.prototype.addActivityListener = function(listener) {\n this.activityListeners.push(listener);\n};\n\nFeatureSourceBase.prototype.removeActivityListener = function(listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0) {\n this.activityListeners.splice(idx, 1);\n }\n};\n\nFeatureSourceBase.prototype.notifyActivity = function() {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nFeatureSourceBase.prototype.getScales = function() {\n return null;\n};\n\nFeatureSourceBase.prototype.fetch = function(chr, min, max, scale, types, pool, cnt) {\n return cnt(null, [], 1000000000);\n};\n\nFeatureSourceBase.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({type: 'default'}, null, defStyle);\n return callback(stylesheet);\n};\n\n\n\nfunction DASFeatureSource(dasSource) {\n this.dasSource = new DASSource(dasSource);\n this.busy = 0;\n this.activityListeners = [];\n}\n\nDASFeatureSource.prototype.addActivityListener = function(listener) {\n this.activityListeners.push(listener);\n};\n\nDASFeatureSource.prototype.removeActivityListener = function(listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0)\n this.activityListeners.splice(idx, 1);\n};\n\n\nDASFeatureSource.prototype.notifyActivity = function() {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nDASFeatureSource.prototype.getStyleSheet = function(callback) {\n this.dasSource.stylesheet(function(stylesheet) {\n callback(stylesheet);\n }, function() {\n callback(null, \"Couldn't fetch DAS stylesheet\");\n });\n};\n\nDASFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n if (types && types.length === 0) {\n callback(null, [], scale);\n return;\n }\n\n if (!this.dasSource.uri && !this.dasSource.features_uri) {\n // FIXME should this be making an error callback???\n return;\n }\n\n if (this.dasSource.dasStaticFeatures && this.cachedStaticFeatures) {\n return callback(null, this.cachedStaticFeatures, this.cachedStaticScale);\n }\n\n var tryMaxBins = (this.dasSource.maxbins !== false);\n var fops = {\n type: types\n };\n if (tryMaxBins) {\n fops.maxbins = 1 + (((max - min) / scale) | 0);\n }\n \n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n\n this.dasSource.features(\n new DASSegment(chr, min, max),\n fops,\n function(features, status) {\n \n thisB.busy--;\n thisB.notifyActivity();\n\n var retScale = scale;\n if (!tryMaxBins) {\n retScale = 0.1;\n }\n if (!status && thisB.dasSource.dasStaticFeatures) {\n thisB.cachedStaticFeatures = features;\n thisB.cachedStaticScale = retScale;\n }\n callback(status, features, retScale);\n }\n );\n};\n\nDASFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n if (this.dasSource.capabilities && arrayIndexOf(this.dasSource.capabilities, 'das1:adjacent-feature') >= 0) {\n var thisB = this;\n if (this.dasAdjLock) {\n return console.log('Already looking for a next feature, be patient!');\n }\n this.dasAdjLock = true;\n var fops = {\n adjacent: chr + ':' + (pos|0) + ':' + (dir > 0 ? 'F' : 'B')\n };\n var types = thisTier.getDesiredTypes(thisTier.browser.scale);\n if (types) {\n fops.types = types;\n }\n thisTier.dasSource.features(null, fops, function(res) {\n thisB.dasAdjLock = false;\n if (res.length > 0 && res[0] !== null) {\n callback(res[0]);\n }\n });\n }\n};\n\nfunction DASSequenceSource(dasSource) {\n this.dasSource = new DASSource(dasSource);\n this.awaitedEntryPoints = new Awaited();\n\n var thisB = this;\n this.dasSource.entryPoints(\n function(ep) {\n thisB.awaitedEntryPoints.provide(ep);\n });\n}\n\n\nDASSequenceSource.prototype.fetch = function(chr, min, max, pool, callback) {\n this.dasSource.sequence(\n new DASSegment(chr, min, max),\n function(seqs) {\n if (seqs.length == 1) {\n return callback(null, seqs[0]);\n } else {\n return callback(\"Didn't get sequence\");\n }\n }\n );\n};\n\nDASSequenceSource.prototype.getSeqInfo = function(chr, cnt) {\n this.awaitedEntryPoints.await(function(ep) {\n for (var epi = 0; epi < ep.length; ++epi) {\n if (ep[epi].name == chr) {\n return cnt({length: ep[epi].end});\n }\n }\n return cnt();\n });\n};\n \n\nfunction TwoBitSequenceSource(source) {\n var thisB = this;\n this.source = source;\n this.twoBit = new Awaited();\n var data;\n if (source.twoBitURI) {\n data = new URLFetchable(source.twoBitURI, {credentials: source.credentials, resolver: source.resolver});\n } else if (source.twoBitBlob) {\n data = new BlobFetchable(source.twoBitBlob);\n } else {\n throw Error(\"No twoBitURI or twoBitBlob parameter\");\n }\n\n makeTwoBit(data, function(tb, error) {\n if (error) {\n console.log(error);\n } else {\n thisB.twoBit.provide(tb);\n }\n });\n}\n\nTwoBitSequenceSource.prototype.fetch = function(chr, min, max, pool, callback) {\n this.twoBit.await(function(tb) {\n tb.fetch(chr, min, max,\n function(seq, err) {\n if (err) {\n return callback(err, null);\n } else {\n var sequence = new DASSequence(chr, min, max, 'DNA', seq);\n return callback(null, sequence);\n }\n });\n });\n};\n\nTwoBitSequenceSource.prototype.getSeqInfo = function(chr, cnt) {\n this.twoBit.await(function(tb) {\n var seq = tb.getSeq(chr);\n if (seq) {\n tb.getSeq(chr).length(function(l) {\n cnt({length: l});\n });\n } else {\n cnt();\n }\n });\n};\n\nfunction EnsemblSequenceSource(source) {\n this.source = source;\n // http://data.gramene.org/ensembl/info/assembly/triticum_aestivum/2B?content-type=application/json\n // http://data.gramene.org/ensembl/sequence/region/triticum_aestivum/2B:8001..18000:1?content-type=application/json\n}\n\nEnsemblSequenceSource.prototype.fetch = function(chr, min, max, pool, callback) {\n var url = this.source.ensemblURI + '/sequence/region/' + this.source.species + '/' +\n chr + ':' + min + '..' + max + ':1?content-type=application/json';\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n var jr;\n if (req.status >= 300) {\n var err = 'Error code ' + req.status;\n try {\n jr = JSON.parse(req.response);\n if (jr.error) {\n err = jr.error;\n }\n } finally {\n callback(err, null);\n }\n } else {\n jr = JSON.parse(req.response);\n var sequence = new DASSequence(chr, min, max, 'DNA', jr.seq);\n return callback(null, sequence);\n }\n }\n };\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n};\n\nEnsemblSequenceSource.prototype.getSeqInfo = function(chr, cnt) {\n var url = this.source.ensemblURI + '/info/assembly/' + this.source.species + '/' + chr + '?content-type=application/json';\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status >= 300) {\n cnt();\n } else {\n var jr = JSON.parse(req.response);\n cnt(jr);\n }\n }\n };\n req.open('GET', url, true);\n req.responseType = 'text';\n req.send();\n};\n\nDASFeatureSource.prototype.getScales = function() {\n return [];\n};\n\nvar bwg_preflights = {};\n\nfunction BWGFeatureSource(bwgSource) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.readiness = 'Connecting';\n this.bwgSource = this.opts = bwgSource; \n thisB.bwgHolder = new Awaited();\n\n if (this.opts.preflight) {\n var pfs = bwg_preflights[this.opts.preflight];\n if (!pfs) {\n pfs = new Awaited();\n bwg_preflights[this.opts.preflight] = pfs;\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status == 200) {\n pfs.provide('success');\n } else {\n pfs.provide('failure');\n }\n }\n };\n req.open('get', this.opts.preflight + '?' + hex_sha1('salt' + Date.now()), true); // Instead, ensure we always preflight a unique URI.\n if (this.opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n }\n pfs.await(function(status) {\n if (status === 'success') {\n thisB.init();\n }\n });\n } else {\n thisB.init();\n }\n}\n\nBWGFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nBWGFeatureSource.prototype.init = function() {\n var thisB = this;\n var arg;\n\n var uri = this.bwgSource.uri || this.bwgSource.bwgURI;\n if (uri) {\n if (this.bwgSource.transport === 'encode') {\n arg = new EncodeFetchable(uri, {credentials: this.opts.credentials});\n } else {\n arg = new URLFetchable(uri, {credentials: this.opts.credentials, resolver: this.opts.resolver});\n }\n } else {\n arg = new BlobFetchable(this.bwgSource.bwgBlob);\n }\n\n makeBwg(arg, function(bwg, err) {\n if (err) {\n thisB.error = err;\n thisB.readiness = null;\n thisB.notifyReadiness();\n thisB.bwgHolder.provide(null);\n } else {\n thisB.bwgHolder.provide(bwg);\n thisB.readiness = null;\n thisB.notifyReadiness();\n if (bwg.type == 'bigbed') {\n bwg.getExtraIndices(function(ei) {\n thisB.extraIndices = ei;\n });\n }\n }\n });\n};\n\nBWGFeatureSource.prototype.capabilities = function() {\n var caps = {leap: true};\n if (this.bwgHolder.res && this.bwgHolder.res.type == 'bigwig')\n caps.quantLeap = true;\n if (this.extraIndices && this.extraIndices.length > 0) {\n caps.search = [];\n for (var eii = 0; eii < this.extraIndices.length; ++eii) {\n caps.search.push(this.extraIndices[eii].field);\n }\n }\n return caps;\n};\n\nBWGFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n this.bwgHolder.await(function(bwg) {\n if (typeof bwg === 'undefined' || bwg === null) {\n return callback(thisB.error || \"Can't access binary file\", null, null);\n }\n\n var data;\n var wantDensity = !types || types.length === 0 || arrayIndexOf(types, 'density') >= 0;\n if (thisB.opts.clientBin) {\n wantDensity = false;\n }\n var scaleFactor = thisB.opts.scaleFactor || 1.0;\n if (bwg.type == 'bigwig' || wantDensity || (typeof thisB.opts.forceReduction !== 'undefined')) {\n var zoom = -1;\n for (var z = 0; z < bwg.zoomLevels.length; ++z) {\n if (bwg.zoomLevels[z].reduction <= (scale * scaleFactor)) {\n zoom = z;\n } else {\n break;\n }\n }\n if (typeof thisB.opts.forceReduction !== 'undefined') {\n zoom = thisB.opts.forceReduction;\n }\n\n if (zoom < 0) {\n data = bwg.getUnzoomedView();\n } else {\n data = bwg.getZoomedView(zoom);\n }\n } else {\n data = bwg.getUnzoomedView();\n }\n \n thisB.busy++;\n thisB.notifyActivity();\n data.readWigData(chr, min, max, function(features) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var fs = 1000000000;\n if (bwg.type === 'bigwig') {\n var is = (max - min) / features.length / 2;\n if (is < fs) {\n fs = is;\n }\n }\n if (thisB.opts.link) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.label) {\n f.links = [new DASLink('Link', thisB.opts.link.replace(/\\$\\$/, f.label))];\n }\n }\n }\n callback(null, features, fs);\n });\n });\n};\n\nBWGFeatureSource.prototype.quantFindNextFeature = function(chr, pos, dir, threshold, callback) {\n // var beforeQFNF = Date.now()|0;\n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n this.bwgHolder.res.thresholdSearch(chr, pos, dir, threshold, function(a, b) {\n thisB.busy--;\n thisB.notifyActivity();\n // var afterQFNF = Date.now()|0;\n // console.log('QFNF took ' + (afterQFNF - beforeQFNF) + 'ms');\n return callback(a, b);\n });\n};\n\nBWGFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n var thisB = this;\n thisB.busy++;\n thisB.notifyActivity();\n this.bwgHolder.res.getUnzoomedView().getFirstAdjacent(chr, pos, dir, function(res) {\n thisB.busy--;\n thisB.notifyActivity();\n if (res.length > 0 && res[0] !== null) {\n callback(res[0]);\n }\n });\n};\n\nBWGFeatureSource.prototype.getScales = function() {\n var bwg = this.bwgHolder.res;\n if (bwg /* && bwg.type == 'bigwig' */) {\n var scales = [1]; // Can we be smarter about inferring baseline scale?\n for (var z = 0; z < bwg.zoomLevels.length; ++z) {\n scales.push(bwg.zoomLevels[z].reduction);\n }\n return scales;\n } else {\n return null;\n }\n};\n\nBWGFeatureSource.prototype.search = function(query, callback) {\n if (!this.extraIndices || this.extraIndices.length === 0) {\n return callback(null, 'No indices available');\n }\n\n var index = this.extraIndices[0];\n return index.lookup(query, callback);\n};\n\nBWGFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.opts.noExtraFeatureInfo)\n return true;\n\n this.bwgHolder.await(function(bwg) {\n if (!bwg) return;\n\n if (bwg.schema && bwg.definedFieldCount < bwg.schema.fields.length) {\n var fip = function(feature, featureInfo) {\n for (var hi = 0; hi < featureInfo.hit.length; ++hi) {\n if (featureInfo.hit[hi].isSuperGroup)\n return;\n }\n for (var fi = bwg.definedFieldCount; fi < bwg.schema.fields.length; ++fi) {\n var f = bwg.schema.fields[fi];\n featureInfo.add(f.comment, feature[f.name]);\n }\n };\n\n callback(fip);\n } else {\n // No need to do anything.\n }\n });\n};\n\nBWGFeatureSource.prototype.getStyleSheet = function(callback) {\n var thisB = this;\n\n this.bwgHolder.await(function(bwg) {\n if (!bwg) {\n return callback(null, 'bbi error');\n }\n\n var stylesheet = new DASStylesheet();\n if (bwg.type == 'bigbed') {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'bigbed'}, null, wigStyle);\n \n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'red';\n wigStyle.HEIGHT = 10;\n wigStyle.BUMP = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'translation'}, null, wigStyle);\n \n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'white';\n densStyle.COLOR2 = 'black';\n densStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'density'}, null, densStyle);\n } else {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'HISTOGRAM';\n wigStyle.COLOR1 = 'white';\n wigStyle.COLOR2 = 'black';\n wigStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n }\n\n if (bwg.definedFieldCount == 12 && bwg.fieldCount >= 14) {\n stylesheet.geneHint = true;\n }\n\n return callback(stylesheet);\n });\n};\n\nfunction RemoteBWGFeatureSource(bwgSource, worker, browser) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.worker = worker;\n this.readiness = 'Connecting';\n this.bwgSource = this.opts = bwgSource;\n this.keyHolder = new Awaited();\n\n if (bwgSource.resolver) {\n this.resolverKey = browser.registerResolver(bwgSource.resolver);\n }\n\n this.init();\n}\n\nRemoteBWGFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nRemoteBWGFeatureSource.prototype.init = function() {\n var thisB = this;\n var uri = this.uri || this.bwgSource.uri || this.bwgSource.bwgURI;\n var blob = this.bwgSource.blob || this.bwgSource.bwgBlob;\n\n var cnt = function(key, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (key) {\n thisB.worker.postCommand({command: 'meta', connection: key}, function(meta, err) {\n if (err) {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n } else {\n thisB.meta = meta;\n thisB.keyHolder.provide(key);\n }\n });\n } else {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n }\n };\n\n if (blob) {\n this.worker.postCommand({command: 'connectBBI', blob: blob}, cnt);\n } else {\n this.worker.postCommand({\n command: 'connectBBI', \n uri: resolveUrlToPage(uri), \n resolver: this.resolverKey,\n transport: this.bwgSource.transport,\n credentials: this.bwgSource.credentials}, \n cnt); \n }\n};\n\nRemoteBWGFeatureSource.prototype.capabilities = function() {\n var caps = {leap: true};\n\n if (this.meta && this.meta.type == 'bigwig')\n caps.quantLeap = true;\n if (this.meta && this.meta.extraIndices && this.meta.extraIndices.length > 0) {\n caps.search = [];\n for (var eii = 0; eii < this.meta.extraIndices.length; ++eii) {\n caps.search.push(this.meta.extraIndices[eii].field);\n }\n }\n return caps;\n};\n\nRemoteBWGFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.keyHolder.await(function(key) {\n if (!key) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Can't access binary file\", null, null);\n }\n\n var zoom = -1;\n var wantDensity = !types || types.length === 0 || arrayIndexOf(types, 'density') >= 0;\n if (thisB.opts.clientBin) {\n wantDensity = false;\n }\n if (thisB.meta.type == 'bigwig' || wantDensity || (typeof thisB.opts.forceReduction !== 'undefined')) {\n for (var z = 1; z < thisB.meta.zoomLevels.length; ++z) {\n if (thisB.meta.zoomLevels[z] <= scale) {\n zoom = z - 1; // Scales returned in metadata start at 1, unlike \"real\" zoom levels.\n } else {\n break;\n }\n }\n if (typeof thisB.opts.forceReduction !== 'undefined') {\n zoom = thisB.opts.forceReduction;\n }\n }\n \n thisB.worker.postCommand({command: 'fetch', connection: key, chr: chr, min: min, max: max, zoom: zoom}, function(features, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var fs = 1000000000;\n if (thisB.meta.type === 'bigwig') {\n var is = (max - min) / features.length / 2;\n if (is < fs) {\n fs = is;\n }\n } \n if (thisB.opts.link) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n if (f.label) {\n f.links = [new DASLink('Link', thisB.opts.link.replace(/\\$\\$/, f.label))];\n }\n }\n } \n callback(error, features, fs);\n });\n });\n};\n\n\nRemoteBWGFeatureSource.prototype.quantFindNextFeature = function(chr, pos, dir, threshold, callback) {\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n this.worker.postCommand({command: 'quantLeap', connection: this.keyHolder.res, chr: chr, pos: pos, dir: dir, threshold: threshold, under: false}, function(result, err) {\n console.log(result, err);\n thisB.busy--;\n thisB.notifyActivity();\n return callback(result, err);\n });\n};\n\nRemoteBWGFeatureSource.prototype.findNextFeature = function(chr, pos, dir, callback) {\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n this.worker.postCommand({command: 'leap', connection: this.keyHolder.res, chr: chr, pos: pos, dir: dir}, function(result, err) {\n thisB.busy--;\n thisB.notifyActivity();\n if (result.length > 0 && result[0] !== null) {\n callback(result[0]);\n }\n });\n};\n\nRemoteBWGFeatureSource.prototype.getScales = function() {\n var meta = this.meta;\n if (meta) {\n return meta.zoomLevels;\n } else {\n return null;\n }\n};\n\nRemoteBWGFeatureSource.prototype.search = function(query, callback) {\n if (!this.meta.extraIndices || this.meta.extraIndices.length === 0) {\n return callback(null, 'No indices available');\n }\n\n var thisB = this;\n this.busy++;\n this.notifyActivity();\n var index = this.meta.extraIndices[0];\n this.worker.postCommand({command: 'search', connection: this.keyHolder.res, query: query, index: index}, function(result, err) {\n thisB.busy--;\n thisB.notifyActivity();\n\n callback(result, err);\n });\n};\n\nRemoteBWGFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.opts.noExtraFeatureInfo)\n return true;\n\n var thisB = this;\n this.keyHolder.await(function(key) {\n var bwg = thisB.meta;\n if (!bwg) return;\n\n if (bwg.schema && bwg.definedFieldCount < bwg.schema.fields.length) {\n var fip = function(feature, featureInfo) {\n for (var hi = 0; hi < featureInfo.hit.length; ++hi) {\n if (featureInfo.hit[hi].isSuperGroup)\n return;\n }\n for (var fi = bwg.definedFieldCount; fi < bwg.schema.fields.length; ++fi) {\n var f = bwg.schema.fields[fi];\n featureInfo.add(f.comment, feature[f.name]);\n }\n };\n\n callback(fip);\n } else {\n // No need to do anything.\n }\n });\n};\n\nRemoteBWGFeatureSource.prototype.getStyleSheet = function(callback) {\n var thisB = this;\n\n this.keyHolder.await(function(key) {\n var bwg = thisB.meta;\n if (!bwg) {\n return callback(null, 'bbi error');\n } \n\n var stylesheet = new DASStylesheet();\n if (bwg.type == 'bigbed') {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'bigbed'}, null, wigStyle);\n \n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'red';\n wigStyle.HEIGHT = 10;\n wigStyle.BUMP = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'translation'}, null, wigStyle);\n \n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n\n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'white';\n densStyle.COLOR2 = 'black';\n densStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'density'}, null, densStyle);\n } else {\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'HISTOGRAM';\n wigStyle.COLOR1 = 'white';\n wigStyle.COLOR2 = 'black';\n wigStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n }\n\n\n if (bwg.definedFieldCount == 12 && bwg.fieldCount >= 14) {\n stylesheet.geneHint = true;\n } \n\n return callback(stylesheet);\n });\n};\n\nfunction bamRecordToFeature(r, group) {\n if (r.flag & BamFlags.SEGMENT_UNMAPPED)\n return; \n \n var len;\n if (r.seq)\n len = r.seq.length;\n else \n len = r.seqLength;\n \n if (r.cigar) {\n len = 0;\n var ops = parseCigar(r.cigar);\n for (var ci = 0; ci < ops.length; ++ci) {\n var co = ops[ci];\n if (co.op == 'M' || co.op == 'D')\n len += co.cnt;\n }\n }\n\n var f = new DASFeature();\n f.min = r.pos + 1;\n f.max = r.pos + len;\n f.segment = r.segment;\n f.type = 'bam';\n f.id = r.readName;\n f.notes = [/* 'Sequence=' + r.seq, 'CIGAR=' + r.cigar, */ 'MQ=' + r.mq];\n f.cigar = r.cigar;\n f.seq = r.seq;\n f.quals = r.quals;\n f.orientation = (r.flag & BamFlags.REVERSE_COMPLEMENT) ? '-' : '+';\n f.bamRecord = r;\n\n if (group && (r.flag & BamFlags.MULTIPLE_SEGMENTS)) {\n f.groups = [{id: r.readName, \n type: 'readpair'}];\n }\n\n return f;\n}\n\nfunction BAMFeatureSource(bamSource) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.bamSource = bamSource;\n this.opts = {credentials: bamSource.credentials, preflight: bamSource.preflight, bamGroup: bamSource.bamGroup};\n this.bamHolder = new Awaited();\n \n if (this.opts.preflight) {\n var pfs = bwg_preflights[this.opts.preflight];\n if (!pfs) {\n pfs = new Awaited();\n bwg_preflights[this.opts.preflight] = pfs;\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n if (req.status == 200) {\n pfs.provide('success');\n } else {\n pfs.provide('failure');\n }\n }\n };\n // req.setRequestHeader('cache-control', 'no-cache'); /* Doesn't work, not an allowed request header in CORS */\n req.open('get', this.opts.preflight + '?' + hex_sha1('salt' + Date.now()), true); // Instead, ensure we always preflight a unique URI.\n if (this.opts.credentials) {\n req.withCredentials = 'true';\n }\n req.send();\n }\n pfs.await(function(status) {\n if (status === 'success') {\n thisB.init();\n }\n });\n } else {\n thisB.init();\n }\n}\n\nBAMFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nBAMFeatureSource.prototype.init = function() {\n var thisB = this;\n var bamF, baiF;\n if (this.bamSource.bamBlob) {\n bamF = new BlobFetchable(this.bamSource.bamBlob);\n baiF = new BlobFetchable(this.bamSource.baiBlob);\n } else {\n bamF = new URLFetchable(this.bamSource.bamURI, {credentials: this.opts.credentials, resolver: this.opts.resolver});\n baiF = new URLFetchable(this.bamSource.baiURI || (this.bamSource.bamURI + '.bai'), \n {credentials: this.opts.credentials, resolver: this.opts.resolver});\n }\n makeBam(bamF, baiF, null, function(bam, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (bam) {\n thisB.bamHolder.provide(bam);\n } else {\n thisB.error = err;\n thisB.bamHolder.provide(null);\n }\n });\n};\n\nBAMFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var light = types && (types.length == 1) && (types[0] == 'density');\n\n var thisB = this;\n \n thisB.busy++;\n thisB.notifyActivity();\n \n this.bamHolder.await(function(bam) {\n if (!bam) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Couldn't fetch BAM\");\n }\n\n bam.fetch(chr, min, max, function(bamRecords, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n if (error) {\n callback(error, null, null);\n } else {\n var features = [];\n for (var ri = 0; ri < bamRecords.length; ++ri) {\n var r = bamRecords[ri];\n\n var f = bamRecordToFeature(r, thisB.opts.bamGroup);\n if (f)\n features.push(f);\n }\n callback(null, features, 1000000000);\n }\n }, {light: light});\n });\n};\n\nBAMFeatureSource.prototype.getScales = function() {\n return 1000000000;\n};\n\nBAMFeatureSource.prototype.getStyleSheet = function(callback) {\n this.bamHolder.await(function(bam) {\n var stylesheet = new DASStylesheet();\n \n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'black';\n densStyle.COLOR2 = 'red';\n densStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'density'}, 'low', densStyle);\n stylesheet.pushStyle({type: 'density'}, 'medium', densStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = '__SEQUENCE';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'bam'}, 'high', wigStyle);\n\n return callback(stylesheet);\n });\n};\n\n\nfunction RemoteBAMFeatureSource(bamSource, worker) {\n FeatureSourceBase.call(this);\n\n var thisB = this;\n this.bamSource = bamSource;\n this.worker = worker;\n this.opts = {credentials: bamSource.credentials, preflight: bamSource.preflight, bamGroup: bamSource.bamGroup};\n this.keyHolder = new Awaited();\n \n if (bamSource.resolver) {\n this.resolverKey = browser.registerResolver(bamSource.resolver);\n }\n\n this.init();\n}\n\nRemoteBAMFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nRemoteBAMFeatureSource.prototype.init = function() { var thisB = this;\n var uri = this.bamSource.uri || this.bamSource.bamURI;\n var indexUri = this.bamSource.indexUri || this.bamSource.baiURI || uri + '.bai';\n\n var blob = this.bamSource.bamBlob || this.bamSource.blob;\n var indexBlob = this.bamSource.baiBlob || this.bamSource.indexBlob;\n\n var cnt = function(result, err) {\n thisB.readiness = null;\n thisB.notifyReadiness();\n\n if (result) {\n thisB.keyHolder.provide(result);\n } else {\n thisB.error = err;\n thisB.keyHolder.provide(null);\n }\n };\n\n if (blob) {\n this.worker.postCommand({command: 'connectBAM', blob: blob, indexBlob: indexBlob}, cnt);\n } else {\n this.worker.postCommand({\n command: 'connectBAM', \n uri: resolveUrlToPage(uri), \n resolver: this.resolverKey,\n indexUri: resolveUrlToPage(indexUri),\n credentials: this.bamSource.credentials,\n indexChunks: this.bamSource.indexChunks},\n cnt); \n }\n};\n\nRemoteBAMFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var light = types && (types.length == 1) && (types[0] == 'density');\n var thisB = this;\n \n thisB.busy++;\n thisB.notifyActivity();\n \n this.keyHolder.await(function(key) {\n if (!key) {\n thisB.busy--;\n thisB.notifyActivity();\n return callback(thisB.error || \"Couldn't fetch BAM\");\n }\n\n thisB.worker.postCommand({command: 'fetch', connection: key, chr: chr, min: min, max: max, opts: {light: light}}, function(bamRecords, error) {\n // console.log('retrieved ' + bamRecords.length + ' via worker.');\n\n thisB.busy--;\n thisB.notifyActivity();\n\n if (error) {\n callback(error, null, null);\n } else {\n var features = [];\n for (var ri = 0; ri < bamRecords.length; ++ri) {\n var r = bamRecords[ri];\n var f = bamRecordToFeature(r, thisB.opts.bamGroup);\n if (f)\n features.push(f);\n }\n callback(null, features, 1000000000);\n }\n });\n });\n};\n\nRemoteBAMFeatureSource.prototype.getScales = function() {\n return 1000000000;\n};\n\nRemoteBAMFeatureSource.prototype.getStyleSheet = function(callback) {\n this.keyHolder.await(function(bam) {\n var stylesheet = new DASStylesheet();\n \n var densStyle = new DASStyle();\n densStyle.glyph = 'HISTOGRAM';\n densStyle.COLOR1 = 'black';\n densStyle.COLOR2 = 'red';\n densStyle.HEIGHT=30;\n stylesheet.pushStyle({type: 'density'}, 'low', densStyle);\n stylesheet.pushStyle({type: 'density'}, 'medium', densStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = '__SEQUENCE';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'blue';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = false;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'bam'}, 'high', wigStyle);\n return callback(stylesheet);\n });\n};\n\n\nfunction MappedFeatureSource(source, mapping) {\n this.source = source;\n this.mapping = mapping;\n \n this.activityListeners = [];\n this.busy = 0;\n}\n\nMappedFeatureSource.prototype.addActivityListener = function(listener) {\n this.activityListeners.push(listener);\n};\n\nMappedFeatureSource.prototype.removeActivityListener = function(listener) {\n var idx = arrayIndexOf(this.activityListeners, listener);\n if (idx >= 0)\n this.activityListeners.splice(idx, 0);\n};\n\nMappedFeatureSource.prototype.notifyActivity = function() {\n for (var li = 0; li < this.activityListeners.length; ++li) {\n try {\n this.activityListeners[li](this.busy);\n } catch (e) {\n console.log(e);\n }\n }\n};\n\nMappedFeatureSource.prototype.getStyleSheet = function(callback) {\n return this.source.getStyleSheet(callback);\n};\n\nMappedFeatureSource.prototype.getScales = function() {\n return this.source.getScales();\n};\n\nMappedFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.source.getDefaultFIPs)\n return this.source.getDefaultFIPs(callback);\n};\n\nMappedFeatureSource.prototype.simplifySegments = function(segs, minGap) {\n if (segs.length === 0) return segs;\n\n segs.sort(function(s1, s2) {\n var d = s1.name - s2.name;\n if (d)\n return d;\n d = s1.start - s2.start;\n if (d)\n return d;\n return s1.end - s2.end; // Should never come to this...?\n });\n\n var ssegs = [];\n var currentSeg = segs[0];\n for (var si = 0; si < segs.length; ++si) {\n var ns = segs[si];\n\n // console.log(ns.name + ' ' + ns.start + ' ' + ns.end);\n if (ns.name != currentSeg.name || ns.start > (currentSeg.end + minGap)) {\n ssegs.push(currentSeg);\n currentSeg = ns;\n } else {\n currentSeg = new DASSegment(currentSeg.name, Math.min(currentSeg.start, ns.start), Math.max(currentSeg.end, ns.end));\n }\n }\n ssegs.push(currentSeg);\n return ssegs;\n};\n\nMappedFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback, styleFilters) {\n var thisB = this;\n var fetchLength = max - min + 1;\n\n thisB.busy++;\n thisB.notifyActivity();\n\n this.mapping.sourceBlocksForRange(chr, min, max, function(mseg) {\n if (mseg.length === 0) {\n thisB.busy--;\n thisB.notifyActivity();\n\n callback(\"No mapping available for this regions\", [], scale);\n } else {\n mseg = thisB.simplifySegments(mseg, Math.max(100, 0.05 * fetchLength));\n\n var mappedFeatures = [];\n var mappedLoc = null;\n var count = mseg.length;\n var finalStatus;\n\n mseg.map(function(seg) {\n thisB.source.fetch(seg.name, seg.start, seg.end, scale, types, pool, function(status, features, fscale) {\n if (status && !finalStatus)\n finalStatus = status;\n\n if (features) {\n for (var fi = 0; fi < features.length; ++fi) {\n var f = features[fi];\n var sn = f.segment;\n if (sn.indexOf('chr') === 0) {\n sn = sn.substr(3);\n }\n\n var mappings = thisB.mapping.mapSegment(sn, f.min, f.max);\n\n if (mappings.length === 0) {\n if (f.parts && f.parts.length > 0) {\n mappedFeatures.push(f);\n }\n } else {\n for (var mi = 0; mi < mappings.length; ++mi) {\n var m = mappings[mi];\n var mf = shallowCopy(f);\n mf.segment = m.segment;\n mf.min = m.min;\n mf.max = m.max;\n if (m.partialMin)\n mf.partialMin = m.partialMin;\n if (m.partialMax)\n mf.partialMax = m.partialMax;\n\n if (m.flipped) {\n if (f.orientation == '-') {\n mf.orientation = '+';\n } else if (f.orientation == '+') {\n mf.orientation = '-';\n }\n }\n mappedFeatures.push(mf);\n }\n }\n }\n }\n\n var m1 = thisB.mapping.mapPoint(seg.name, seg.start);\n var m2 = thisB.mapping.mapPoint(seg.name, seg.end);\n\n if (m1 && m2) {\n var segDestCoverage = new Range(m1.pos, m2.pos);\n if (mappedLoc)\n mappedLoc = union(mappedLoc, segDestCoverage);\n else\n mappedLoc = segDestCoverage;\n }\n\n --count;\n if (count === 0) {\n thisB.busy--;\n thisB.notifyActivity();\n callback(finalStatus, mappedFeatures, fscale, mappedLoc);\n }\n }, styleFilters);\n });\n }\n });\n};\n\nfunction DummyFeatureSource() {\n}\n\nDummyFeatureSource.prototype.getScales = function() {\n return null;\n};\n\nDummyFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, cnt) {\n return cnt(null, [], 1000000000);\n};\n\nDummyFeatureSource.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n stylesheet.pushStyle({type: 'default'}, null, defStyle);\n return callback(stylesheet);\n};\n\nfunction DummySequenceSource() {\n}\n\nDummySequenceSource.prototype.fetch = function(chr, min, max, pool, cnt) {\n return cnt(null, null);\n};\n\nfunction JBrowseFeatureSource(source) {\n this.store = new JBrowseStore(source.jbURI, source.jbQuery);\n}\n\nJBrowseFeatureSource.prototype.getScales = function() {\n return null;\n};\n\nJBrowseFeatureSource.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n \n var cdsStyle = new DASStyle();\n cdsStyle.glyph = 'BOX';\n cdsStyle.FGCOLOR = 'black';\n cdsStyle.BGCOLOR = 'red';\n cdsStyle.HEIGHT = 10;\n cdsStyle.BUMP = true;\n cdsStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'translation'}, null, cdsStyle);\n \n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = 'green';\n wigStyle.HEIGHT = 8;\n wigStyle.BUMP = true;\n wigStyle.LABEL = true;\n wigStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n\n return callback(stylesheet);\n};\n\nJBrowseFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n if (types && types.length === 0) {\n callback(null, [], scale);\n return;\n }\n \n var fops = {};\n\n this.store.features(\n new DASSegment(chr, min, max),\n fops,\n function(features, status) {\n callback(status, features, 100000);\n }\n );\n};\n\nBrowser.prototype.sourceAdapterIsCapable = function(s, cap) {\n if (!s.capabilities)\n return false;\n else return s.capabilities()[cap];\n};\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n FeatureSourceBase: FeatureSourceBase,\n\n TwoBitSequenceSource: TwoBitSequenceSource,\n EnsemblSequenceSource: EnsemblSequenceSource,\n DASSequenceSource: DASSequenceSource,\n MappedFeatureSource: MappedFeatureSource,\n CachingFeatureSource: CachingFeatureSource,\n BWGFeatureSource: BWGFeatureSource,\n RemoteBWGFeatureSource: RemoteBWGFeatureSource,\n BAMFeatureSource: BAMFeatureSource,\n RemoteBAMFeatureSource: RemoteBAMFeatureSource,\n DummyFeatureSource: DummyFeatureSource,\n DummySequenceSource: DummySequenceSource,\n\n registerSourceAdapterFactory: dalliance_registerSourceAdapterFactory,\n registerParserFactory: dalliance_registerParserFactory,\n makeParser: dalliance_makeParser\n };\n\n // Standard set of plugins.\n require('./ensembljson');\n //---START MOLGENIS CUSTOM CODE---\n require('./molgenisjson');\n //---END MOLGENIS CUSTOM CODE---\n require('./tabix-source');\n require('./memstore');\n require('./bedwig');\n require('./vcf');\n require('./test-source');\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2015\n//\n// sourcecompare.js\n//\n\n\nfunction sourceDataURI(conf) {\n if (conf.uri) {\n return conf.uri;\n } else if (conf.blob) {\n return 'file:' + conf.blob.name;\n } else if (conf.bwgBlob) {\n return 'file:' + conf.bwgBlob.name;\n } else if (conf.bamBlob) {\n return 'file:' + conf.bamBlob.name;\n } else if (conf.twoBitBlob) {\n return 'file:' + conf.twoBitBlob.name;\n }\n\n return conf.bwgURI || conf.bamURI || conf.jbURI || conf.twoBitURI || 'https://www.biodalliance.org/magic/no_uri';\n}\n\nfunction sourceStyleURI(conf) {\n if (conf.stylesheet_uri)\n return conf.stylesheet_uri;\n else if (conf.tier_type == 'sequence' || conf.twoBitURI || conf.twoBitBlob)\n return 'https://www.biodalliance.org/magic/sequence'\n else\n return sourceDataURI(conf);\n}\n\nfunction sourcesAreEqualModuloStyle(a, b) {\n if (sourceDataURI(a) != sourceDataURI(b))\n return false;\n\n if (a.mapping != b.mapping)\n return false;\n\n if (a.tier_type != b.tier_type)\n return false;\n\n if (a.overlay) {\n if (!b.overlay || b.overlay.length != a.overlay.length)\n return false;\n for (var oi = 0; oi < a.overlay.length; ++oi) {\n if (!sourcesAreEqualModuloStyle(a.overlay[oi], b.overlay[oi]))\n return false;\n }\n } else {\n if (b.overlay)\n return false;\n }\n\n return true;\n}\n\nfunction sourcesAreEqual(a, b) {\n if (sourceDataURI(a) != sourceDataURI(b) ||\n sourceStyleURI(a) != sourceStyleURI(b))\n return false;\n\n if (a.mapping != b.mapping)\n return false;\n\n if (a.tier_type != b.tier_type)\n return false;\n\n if (a.overlay) {\n if (!b.overlay || b.overlay.length != a.overlay.length)\n return false;\n for (var oi = 0; oi < a.overlay.length; ++oi) {\n if (!sourcesAreEqual(a.overlay[oi], b.overlay[oi]))\n return false;\n }\n } else {\n if (b.overlay)\n return false;\n }\n\n return true;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n sourcesAreEqual: sourcesAreEqual,\n sourcesAreEqualModuloStyle: sourcesAreEqualModuloStyle,\n sourceDataURI: sourceDataURI,\n sourceStyleURI: sourceStyleURI\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// spans.js: JavaScript Intset/Location port.\n//\n\n\"use strict\";\n\n\nfunction Range(min, max)\n{\n if (typeof(min) != 'number' || typeof(max) != 'number')\n throw 'Bad range ' + min + ',' + max;\n this._min = min;\n this._max = max;\n}\n\nRange.prototype.min = function() {\n return this._min;\n}\n\nRange.prototype.max = function() {\n return this._max;\n}\n\nRange.prototype.contains = function(pos) {\n return pos >= this._min && pos <= this._max;\n}\n\nRange.prototype.isContiguous = function() {\n return true;\n}\n\nRange.prototype.ranges = function() {\n return [this];\n}\n\nRange.prototype._pushRanges = function(ranges) {\n ranges.push(this);\n}\n\nRange.prototype.toString = function() {\n return '[' + this._min + '-' + this._max + ']';\n}\n\nfunction _Compound(ranges) {\n // given: a set of unsorted possibly overlapping ranges\n // sort the input ranges\n var sorted = ranges.sort(_rangeOrder);\n // merge overlaps between adjacent ranges\n var merged = [];\n var current = sorted.shift();\n sorted.forEach(function(range) {\n if (range._min <= current._max) {\n if (range._max > current._max) {\n current._max = range._max;\n }\n }\n else {\n merged.push(current);\n current = range;\n }\n });\n merged.push(current);\n this._ranges = merged;\n}\n\n_Compound.prototype.min = function() {\n return this._ranges[0].min();\n}\n\n_Compound.prototype.max = function() {\n return this._ranges[this._ranges.length - 1].max();\n}\n\n// returns the index of the first range that is not less than pos\n_Compound.prototype.lower_bound = function(pos) {\n // first check if pos is out of range\n var r = this.ranges();\n if (pos > this.max()) return r.length;\n if (pos < this.min()) return 0;\n // do a binary search\n var a=0, b=r.length - 1;\n while (a <= b) {\n var m = Math.floor((a+b)/2);\n if (pos > r[m]._max) {\n a = m+1;\n }\n else if (pos < r[m]._min) {\n b = m-1;\n }\n else {\n return m;\n }\n }\n return a;\n}\n\n_Compound.prototype.contains = function(pos) {\n var lb = this.lower_bound(pos);\n if (lb < this._ranges.length && this._ranges[lb].contains(pos)) {\n return true;\n }\n return false;\n}\n\n_Compound.prototype.insertRange = function(range) {\n var lb = this.lower_bound(range._min);\n if (lb === this._ranges.length) { // range follows this\n this._ranges.push(range);\n return;\n }\n \n var r = this.ranges();\n if (range._max < r[lb]._min) { // range preceeds lb\n this._ranges.splice(lb,0,range);\n return;\n }\n\n // range overlaps lb (at least)\n if (r[lb]._min < range._min) range._min = r[lb]._min;\n var ub = lb+1;\n while (ub < r.length && r[ub]._min <= range._max) {\n ub++;\n }\n ub--;\n // ub is the upper bound of the new range\n if (r[ub]._max > range._max) range._max = r[ub]._max;\n \n // splice range into this._ranges\n this._ranges.splice(lb,ub-lb+1,range);\n return;\n}\n\n_Compound.prototype.isContiguous = function() {\n return this._ranges.length > 1;\n}\n\n_Compound.prototype.ranges = function() {\n return this._ranges;\n}\n\n_Compound.prototype._pushRanges = function(ranges) {\n for (var ri = 0; ri < this._ranges.length; ++ri)\n ranges.push(this._ranges[ri]);\n}\n\n_Compound.prototype.toString = function() {\n var s = '';\n for (var r = 0; r < this._ranges.length; ++r) {\n if (r>0) {\n s = s + ',';\n }\n s = s + this._ranges[r].toString();\n }\n return s;\n}\n\nfunction union(s0, s1) {\n if (! (s0 instanceof _Compound)) {\n if (! (s0 instanceof Array))\n s0 = [s0];\n s0 = new _Compound(s0);\n }\n \n if (s1)\n s0.insertRange(s1);\n\n return s0;\n}\n\nfunction intersection(s0, s1) {\n var r0 = s0.ranges();\n var r1 = s1.ranges();\n var l0 = r0.length, l1 = r1.length;\n var i0 = 0, i1 = 0;\n var or = [];\n\n while (i0 < l0 && i1 < l1) {\n var s0 = r0[i0], s1 = r1[i1];\n var lapMin = Math.max(s0.min(), s1.min());\n var lapMax = Math.min(s0.max(), s1.max());\n if (lapMax >= lapMin) {\n or.push(new Range(lapMin, lapMax));\n }\n if (s0.max() > s1.max()) {\n ++i1;\n } else {\n ++i0;\n }\n }\n \n if (or.length == 0) {\n return null; // FIXME\n } else if (or.length == 1) {\n return or[0];\n } else {\n return new _Compound(or);\n }\n}\n\nfunction coverage(s) {\n var tot = 0;\n var rl = s.ranges();\n for (var ri = 0; ri < rl.length; ++ri) {\n var r = rl[ri];\n tot += (r.max() - r.min() + 1);\n }\n return tot;\n}\n\n\n\nfunction rangeOrder(a, b)\n{\n if (a.min() < b.min()) {\n return -1;\n } else if (a.min() > b.min()) {\n return 1;\n } else if (a.max() < b.max()) {\n return -1;\n } else if (b.max() > a.max()) {\n return 1;\n } else {\n return 0;\n }\n}\n\nfunction _rangeOrder(a, b)\n{\n if (a._min < b._min) {\n return -1;\n } else if (a._min > b._min) {\n return 1;\n } else if (a._max < b._max) {\n return -1;\n } else if (b._max > a._max) {\n return 1;\n } else {\n return 0;\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n Range: Range,\n union: union,\n intersection: intersection,\n coverage: coverage,\n rangeOver: rangeOrder,\n _rangeOrder: _rangeOrder\n }\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2014\n//\n// style.js\n//\n\n\"use strict\";\n\nfunction StyleFilter(type, method, label) {\n this.type = type;\n this.method = method;\n this.label = label;\n}\n\nStyleFilter.prototype.equals = function(o) {\n return this.type == o.type && this.method == o.method && this.label == o.label;\n}\n\nStyleFilter.prototype.toString = function() {\n var fs = [];\n if (this.type) \n fs.push('type=' + this.type);\n if (this.method)\n fs.push('method=' + this.method);\n if (this.label)\n fs.push('label=' + this.label);\n return 'StyleFilter<' + fs.join(';') + '>';\n}\n\nfunction StyleFilterSet(filters) {\n this._filters = {};\n if (filters) {\n for (var fi = 0; fi < filters.length; ++fi) {\n this.add(filters[fi]);\n }\n }\n}\n\nStyleFilterSet.prototype.add = function(filter) {\n var fs = filter.toString();\n if (!this._filters[fs]) {\n this._filters[fs] = filter;\n this._list = null;\n }\n}\n\nStyleFilterSet.prototype.addAll = function(filterSet) {\n var l = filterSet.list();\n for (var fi = 0; fi < l.length; ++fi) {\n this.add(l[fi]);\n }\n}\n\nStyleFilterSet.prototype.doesNotContain = function(filterSet) {\n var l = filterSet.list();\n for (var fi = 0; fi < l.length; ++fi) {\n if (!this._filters[fi.toString()])\n return true;\n }\n return false\n}\n\nStyleFilterSet.prototype.list = function() {\n if (!this._list) {\n this._list = [];\n for (var k in this._filters) {\n if (this._filters.hasOwnProperty(k)) {\n this._list.push(this._filters[k]);\n }\n }\n }\n return this._list;\n}\n\nStyleFilterSet.prototype.typeList = function() {\n var types = [];\n var list = this.list();\n for (var fi = 0; fi < list.length; ++fi) {\n var filter = list[fi];\n var type = filter.type;\n if (!type || type == 'default')\n return null;\n if (types.indexOf(type) < 0)\n types.push(type);\n }\n return types;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n StyleFilter: StyleFilter,\n StyleFilterSet: StyleFilterSet\n };\n}\n","/* jshint esversion: 6 */\n\"use strict\";\n\nexport { renderTier, drawTier };\n\n/* To be used by tiers which are to be drawn in a multitier\n using the multi-renderer.\n\n Subtiers are configured by adding the following to a tier's source configuration:\n renderer: 'sub',\n sub: {\n multi_id: \"multi_1\",\n offset: 130,\n z: 2,\n }\n This would define a subtier that's to be rendered in the multi-tier with\n id \"multi_1\", with the top of the subtier at 130 pixels and at z-index 2.\n */\n\nfunction renderTier(status, tier) {\n drawTier(tier);\n tier.updateStatus(status);\n}\n\n// drawTier is called when this tier's data has been fetched,\n// so by refreshing the multiTier from here, we can be sure that\n// there's something new worth drawing in it\nfunction drawTier(tier) {\n let browser = tier.browser;\n\n let multiTier = browser.tiers.\n filter(t => t.dasSource.renderer === 'multi' &&\n t.dasSource.multi.multi_id === tier.dasSource.sub.multi_id);\n\n multiTier.forEach(t => browser.refreshTier(t));\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// svg-export.js\n//\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var makeElementNS = utils.makeElementNS;\n\n var VERSION = require('./version');\n\n var svgSeqTier = require('./sequence-draw').svgSeqTier;\n\n var svgu = require('./svg-utils');\n var NS_SVG = svgu.NS_SVG;\n var NS_XLINK = svgu.NS_XLINK;\n var SVGPath = svgu.SVGPath;\n\n var nf = require('./numformats');\n var formatQuantLabel = nf.formatQuantLabel;\n var formatLongInt = nf.formatLongInt;\n}\n\n\nBrowser.prototype.makeSVG = function(opts) {\n opts = opts || {};\n var minTierHeight = opts.minTierHeight || 20;\n var padding = 3;\n var fpw = opts.width || this.featurePanelWidth;\n\n var backupFPW = this.featurePanelWidth;\n var backupScale = this.scale;\n this.featurePanelWidth = fpw;\n this.scale = this.featurePanelWidth / (this.viewEnd - this.viewStart);\n\n var b = this;\n var saveDoc = document.implementation.createDocument(NS_SVG, 'svg', null);\n\n var saveRoot = makeElementNS(NS_SVG, 'g', null, {\n fontFamily: 'helvetica',\n fontSize: '8pt'\n });\n saveDoc.documentElement.appendChild(saveRoot);\n\n var margin = 200;\n\n if (opts.banner) {\n var dallianceAnchor = makeElementNS(NS_SVG, 'a',\n makeElementNS(NS_SVG, 'text', 'Graphics from Biodalliance ' + VERSION, {\n x: (b.featurePanelWidth + margin) - 100,\n y: 35,\n strokeWidth: 0,\n fontSize: '12pt',\n\t textAnchor: 'end',\n\t fill: 'blue'\n }));\n dallianceAnchor.setAttribute('xmlns:xlink', NS_XLINK);\n dallianceAnchor.setAttribute('xlink:href', 'http://www.biodalliance.org/');\n\n saveRoot.appendChild(dallianceAnchor);\n }\n \n if (opts.region) {\n saveRoot.appendChild(\n makeElementNS(NS_SVG, 'text', this.chr + ':' + formatLongInt(this.viewStart) + '..' + formatLongInt(this.viewEnd), {\n x: margin + 100,\n y: 35,\n strokeWidth: 0,\n fontSize: '12pt',\n textAnchor: 'start'\n })\n );\n }\n \n var clipRect = makeElementNS(NS_SVG, 'rect', null, {\n \tx: margin,\n \ty: 50,\n \twidth: b.featurePanelWidth,\n \theight: 100000\n });\n var clip = makeElementNS(NS_SVG, 'clipPath', clipRect, {id: 'featureClip'});\n saveRoot.appendChild(clip);\n\n var pos = 70;\n var tierHolder = makeElementNS(NS_SVG, 'g', null, {});\n\n for (var ti = 0; ti < b.tiers.length; ++ti) {\n var tier = b.tiers[ti];\n tier.backupSubtiers = tier.subtiers;\n tier.backupOriginHaxx = tier.originHaxx;\n tier.backupLayoutHeight = tier.layoutHeight;\n\n const renderer = b.getTierRenderer(tier);\n if (renderer && renderer.prepareSubtiers) {\n renderer.prepareSubtiers(tier, tier.viewport.getContext('2d'));\n }\n\n var tierSVG = makeElementNS(NS_SVG, 'g', null, {clipPath: 'url(#featureClip)', clipRule: 'nonzero'});\n \tvar tierLabels = makeElementNS(NS_SVG, 'g');\n \tvar tierTopPos = pos;\n\n \tvar tierBackground = makeElementNS(NS_SVG, 'rect', null, {x: 0, y: tierTopPos, width: '10000', height: 50, fill: tier.background});\n \ttierSVG.appendChild(tierBackground);\n\n \tif (tier.sequenceSource) {\n \t var seqTrack = svgSeqTier(tier, tier.currentSequence);\n \t \n \t tierSVG.appendChild(makeElementNS(NS_SVG, 'g', seqTrack, {transform: 'translate(' + (margin) + ', ' + pos + ')'}));\n \t pos += 80;\n \t} else {\n if (!tier.subtiers) {\n \t\t continue;\n }\n \t\n \t var offset = ((tier.glyphCacheOrigin - b.viewStart) * b.scale);\n var hasQuant = false;\n for (var sti = 0; sti < tier.subtiers.length; ++sti) {\n pos += padding;\n \t\tvar subtier = tier.subtiers[sti];\n \n \t\tvar glyphElements = [];\n \t\tfor (var gi = 0; gi < subtier.glyphs.length; ++gi) {\n var glyph = subtier.glyphs[gi];\n glyphElements.push(glyph.toSVG());\n \t\t}\n\n \t\t tierSVG.appendChild(makeElementNS(NS_SVG, 'g', glyphElements, {transform: 'translate(' + (margin+offset) + ', ' + pos + ')'}));\n\n \t\tif (subtier.quant) {\n hasQuant = true;\n \t\t var q = subtier.quant;\n var h = subtier.height;\n\n var numTics = 2;\n if (h > 40) {\n numTics = 1 + ((h/20) | 0);\n }\n var ticSpacing = h / (numTics - 1);\n var ticInterval = (q.max - q.min) / (numTics - 1);\n\n \t\t var path = new SVGPath();\n \t\t path.moveTo(margin + 5, pos);\n \t\t path.lineTo(margin, pos);\n \t\t path.lineTo(margin, pos + subtier.height);\n \t\t path.lineTo(margin + 5, pos + subtier.height);\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n path.moveTo(margin, pos + ty);\n path.lineTo(margin+3, pos + ty);\n }\n\n \t\t tierLabels.appendChild(makeElementNS(NS_SVG, 'path', null, {d: path.toPathData(), fill: 'none', stroke: 'black', strokeWidth: '2px'}));\n \t\t tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel(q.max), {x: margin - 3, y: pos + 7, textAnchor: 'end'}));\n \t\t tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel(q.min), {x: margin - 3, y: pos + subtier.height, textAnchor: 'end'}));\n for (var t = 1; t < numTics-1; ++t) {\n var ty = t*ticSpacing;\n tierLabels.appendChild(makeElementNS(NS_SVG, 'text', formatQuantLabel((1.0*q.max) - (t*ticInterval)), \n {x: margin - 3, y: pos + ty + 3, textAnchor: 'end'}));\n }\n \t\t}\n\n \t\t pos += subtier.height + padding;\n }\n\n if (pos - tierTopPos < minTierHeight) {\n pos = tierTopPos + minTierHeight;\n }\n \t}\n\n var labelName;\n if (typeof tier.config.name === 'string')\n labelName = tier.config.name;\n else\n labelName = tier.dasSource.name;\n \ttierLabels.appendChild(\n \t makeElementNS(\n \t\tNS_SVG, 'text',\n \t\tlabelName,\n \t\t{x: margin - (hasQuant ? 20 : 12), y: (pos+tierTopPos+8)/2, fontSize: '10pt', textAnchor: 'end'}));\n\n \t\n \ttierBackground.setAttribute('height', pos - tierTopPos);\n \ttierHolder.appendChild(makeElementNS(NS_SVG, 'g', [tierSVG, tierLabels]));\n\n tier.subtiers = tier.backupSubtiers;\n tier.originHaxx = tier.backupOriginHaxx;\n tier.layoutHeight = tier.backupLayoutHeight;\n }\n\n if (opts.highlights) {\n var highlights = this.highlights || [];\n for (var hi = 0; hi < highlights.length; ++hi) {\n var h = highlights[hi];\n if ((h.chr == this.chr || h.chr == ('chr' + this.chr)) && h.min < this.viewEnd && h.max > this.viewStart) {\n var tmin = (Math.max(h.min, this.viewStart) - this.viewStart) * this.scale;\n var tmax = (Math.min(h.max, this.viewEnd) - this.viewStart) * this.scale;\n\n tierHolder.appendChild(makeElementNS(NS_SVG, 'rect', null, {x: margin + tmin, y: 70, width: (tmax-tmin), height: pos-70,\n stroke: 'none', fill: this.defaultHighlightFill, fillOpacity: this.defaultHighlightAlpha}));\n }\n }\n }\n\n var rulerPos = -1; \n if (opts.ruler == 'center') {\n rulerPos = margin + ((this.viewEnd - this.viewStart)*this.scale) / 2;\n } else if (opts.ruler == 'left') {\n rulerPos = margin;\n } else if (opts.ruler == 'right') {\n rulerPos = margin + ((this.viewEnd - this.viewStart)*this.scale);\n }\n if (rulerPos >= 0) {\n tierHolder.appendChild(makeElementNS(NS_SVG, 'line', null, {x1: rulerPos, y1: 70, x2: rulerPos, y2: pos,\n stroke: 'blue'}));\n }\n\n saveRoot.appendChild(tierHolder);\n saveDoc.documentElement.setAttribute('width', b.featurePanelWidth + 20 + margin);\n saveDoc.documentElement.setAttribute('height', pos + 50);\n\n \n this.featurePanelWidth = backupFPW;\n this.scale = backupScale;\n\n let svg;\n if (typeof(XMLSerializer) !== 'undefined') {\n svg = new XMLSerializer().serializeToString(saveDoc);\n } else {\n const root = saveDoc.documentElement;\n root.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg = root.outerHTML;\n }\n\n if (opts.output && opts.output === 'string') {\n return svg;\n } else {\n return new Blob([svg], {type: 'image/svg+xml'});\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// svg-utils.js\n//\n\nvar NS_SVG = 'http://www.w3.org/2000/svg';\nvar NS_XLINK = 'http://www.w3.org/1999/xlink';\n\nfunction SVGPath() {\n this.ops = [];\n}\n\nSVGPath.prototype.moveTo = function(x, y) {\n this.ops.push('M ' + x + ' ' + y);\n}\n\nSVGPath.prototype.lineTo = function(x, y) {\n this.ops.push('L ' + x + ' ' + y);\n}\n\nSVGPath.prototype.closePath = function() {\n this.ops.push('Z');\n}\n\nSVGPath.prototype.toPathData = function() {\n return this.ops.join(' ');\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n NS_SVG: NS_SVG,\n NS_XLINK: NS_XLINK,\n SVGPath: SVGPath\n }\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tabix-source.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerSourceAdapterFactory = sa.registerSourceAdapterFactory;\n var dalliance_makeParser = sa.makeParser;\n var FeatureSourceBase = sa.FeatureSourceBase;\n\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n\n var utils = require('./utils');\n var Awaited = utils.Awaited;\n\n var connectTabix = require('./tabix').connectTabix;\n}\n\nfunction TabixFeatureSource(source) {\n FeatureSourceBase.call(this);\n this.readiness = 'Connecting';\n this.source = source;\n\n this.tabixHolder = new Awaited();\n var thisB = this;\n\n\n var parser = dalliance_makeParser(source.payload);\n if (!parser) {\n throw 'Unsuported tabix payload ' + source.payload;\n } else {\n this.parser = parser;\n }\n\n var data, index;\n if (this.source.blob) {\n data = new BlobFetchable(this.source.blob);\n index = new BlobFetchable(this.source.indexBlob);\n } else {\n data = new URLFetchable(this.source.uri, {credentials: this.source.credentials, resolver: this.source.resolver});\n index = new URLFetchable(this.source.indexURI || (this.source.uri + '.tbi'), \n {credentials: this.source.credentials, resolver: this.source.resolver});\n }\n connectTabix(data, index, function(tabix, err) {\n thisB.tabixHolder.provide(tabix);\n tabix.fetchHeader(function(lines, err) {\n if (lines) {\n var session = parser.createSession(function() { /* Null sink because we shouldn't get records */ });\n for (var li = 0; li < lines.length; ++li) {\n session.parse(lines[li]);\n }\n session.flush();\n }\n });\n thisB.readiness = null\n thisB.notifyReadiness();\n });\n}\n\nTabixFeatureSource.prototype = Object.create(FeatureSourceBase.prototype);\n\nTabixFeatureSource.prototype.fetch = function(chr, min, max, scale, types, pool, callback) {\n var thisB = this;\n \n thisB.busy++;\n thisB.notifyActivity();\n \n this.tabixHolder.await(function(tabix) {\n tabix.fetch(chr, min, max, function(records, error) {\n thisB.busy--;\n thisB.notifyActivity();\n\n var features = [];\n var session = thisB.parser.createSession(function(f) {features.push(f)});\n for (var ri = 0; ri < records.length; ++ri) {\n var f = session.parse(records[ri]);\n }\n session.flush();\n callback(null, features, 1000000000);\n });\n });\n}\n\n\nTabixFeatureSource.prototype.getStyleSheet = function(callback) {\n if (this.parser && this.parser.getStyleSheet)\n this.parser.getStyleSheet(callback)\n}\n\nTabixFeatureSource.prototype.getDefaultFIPs = function(callback) {\n if (this.parser && this.parser.getDefaultFIPs)\n this.parser.getDefaultFIPs(callback);\n}\n\n\ndalliance_registerSourceAdapterFactory('tabix', function(source) {\n return {features: new TabixFeatureSource(source)};\n});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2011\n//\n// tabix.js: basic support for tabix-indexed flatfiles\n//\n\n\"use strict\";\n\nvar TABIX_MAGIC = 0x01494254;\n\nif (typeof(require) !== 'undefined') {\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n\n var bin = require('./bin');\n var readInt = bin.readInt;\n var readShort = bin.readShort;\n var readByte = bin.readByte;\n var readInt64 = bin.readInt64;\n var readFloat = bin.readFloat;\n\n var lh3utils = require('./lh3utils');\n var readVob = lh3utils.readVob;\n var unbgzf = lh3utils.unbgzf;\n var reg2bins = lh3utils.reg2bins;\n var Chunk = lh3utils.Chunk;\n}\n\nfunction TabixFile() {\n}\n\nfunction connectTabix(data, tbi, callback) {\n var tabix = new TabixFile();\n tabix.data = data;\n tabix.tbi = tbi;\n\n tabix.tbi.fetch(function(header) { // Do we really need to fetch the whole thing? :-(\n if (!header) {\n return callback(null, \"Couldn't access Tabix\");\n }\n\n var unchead = unbgzf(header, header.byteLength);\n var uncba = new Uint8Array(unchead);\n var magic = readInt(uncba, 0);\n if (magic != TABIX_MAGIC) {\n return callback(null, 'Not a tabix index');\n }\n\n var nref = readInt(uncba, 4);\n tabix.format = readInt(uncba, 8);\n tabix.colSeq = readInt(uncba, 12);\n tabix.colStart = readInt(uncba, 16);\n tabix.colEnd = readInt(uncba, 20);\n tabix.meta = readInt(uncba, 24);\n tabix.skip = readInt(uncba, 28);\n var nameLength = readInt(uncba, 32);\n\n tabix.indices = [];\n\n var p = 36;\n tabix.chrToIndex = {};\n tabix.indexToChr = [];\n for (var i = 0; i < nref; ++i) {\n var name = ''\n\n while (true) {\n var ch = uncba[p++];\n if (ch == 0)\n break;\n\n name += String.fromCharCode(ch);\n }\n\n tabix.chrToIndex[name] = i;\n if (name.indexOf('chr') == 0) {\n tabix.chrToIndex[name.substring(3)] = i;\n } else {\n tabix.chrToIndex['chr' + name] = i;\n }\n tabix.indexToChr.push(name);\n }\n\n var minBlockIndex = 1000000000;\n for (var ref = 0; ref < nref; ++ref) {\n var blockStart = p;\n var nbin = readInt(uncba, p); p += 4;\n for (var b = 0; b < nbin; ++b) {\n var bin = readInt(uncba, p);\n var nchnk = readInt(uncba, p+4);\n p += 8 + (nchnk * 16);\n }\n var nintv = readInt(uncba, p); p += 4;\n \n var q = p;\n for (var i = 0; i < nintv; ++i) {\n var v = readVob(uncba, q); q += 8;\n if (v) {\n var bi = v.block;\n if (v.offset > 0)\n bi += 65536;\n\n if (bi < minBlockIndex)\n minBlockIndex = bi;\n break;\n }\n }\n p += (nintv * 8);\n\n\n var ub = uncba;\n if (nbin > 0) {\n tabix.indices[ref] = new Uint8Array(unchead, blockStart, p - blockStart);\n } \n }\n\n tabix.headerMax = minBlockIndex;\n\n callback(tabix);\n }, {timeout: 50000});\n}\n\n// Copy-paste from BamFile\n\nTabixFile.prototype.blocksForRange = function(refId, min, max) {\n var index = this.indices[refId];\n if (!index) {\n return [];\n }\n\n var intBinsL = reg2bins(min, max);\n var intBins = [];\n for (var i = 0; i < intBinsL.length; ++i) {\n intBins[intBinsL[i]] = true;\n }\n var leafChunks = [], otherChunks = [];\n\n var nbin = readInt(index, 0);\n var p = 4;\n for (var b = 0; b < nbin; ++b) {\n var bin = readInt(index, p);\n var nchnk = readInt(index, p+4);\n p += 8;\n if (intBins[bin]) {\n for (var c = 0; c < nchnk; ++c) {\n var cs = readVob(index, p, true);\n var ce = readVob(index, p + 8, true);\n (bin < 4681 ? otherChunks : leafChunks).push(new Chunk(cs, ce));\n p += 16;\n }\n } else {\n p += (nchnk * 16);\n }\n }\n\n var nintv = readInt(index, p);\n var lowest = null;\n var minLin = Math.min(min>>14, nintv - 1), maxLin = Math.min(max>>14, nintv - 1);\n for (var i = minLin; i <= maxLin; ++i) {\n var lb = readVob(index, p + 4 + (i * 8));\n if (!lb) {\n continue;\n }\n if (!lowest || lb.block < lowest.block || lb.offset < lowest.offset) {\n lowest = lb;\n }\n }\n \n var prunedOtherChunks = [];\n if (lowest != null) {\n for (var i = 0; i < otherChunks.length; ++i) {\n var chnk = otherChunks[i];\n if (chnk.maxv.block >= lowest.block && chnk.maxv.offset >= lowest.offset) {\n prunedOtherChunks.push(chnk);\n }\n }\n } \n otherChunks = prunedOtherChunks;\n\n var intChunks = [];\n for (var i = 0; i < otherChunks.length; ++i) {\n intChunks.push(otherChunks[i]);\n }\n for (var i = 0; i < leafChunks.length; ++i) {\n intChunks.push(leafChunks[i]);\n }\n\n intChunks.sort(function(c0, c1) {\n var dif = c0.minv.block - c1.minv.block;\n if (dif != 0) {\n return dif;\n } else {\n return c0.minv.offset - c1.minv.offset;\n }\n });\n var mergedChunks = [];\n if (intChunks.length > 0) {\n var cur = intChunks[0];\n for (var i = 1; i < intChunks.length; ++i) {\n var nc = intChunks[i];\n if (nc.minv.block == cur.maxv.block /* && nc.minv.offset == cur.maxv.offset */) { // no point splitting mid-block\n cur = new Chunk(cur.minv, nc.maxv);\n } else {\n mergedChunks.push(cur);\n cur = nc;\n }\n }\n mergedChunks.push(cur);\n }\n\n return mergedChunks;\n}\n\nTabixFile.prototype.fetch = function(chr, min, max, callback) {\n var thisB = this;\n\n var chrId = this.chrToIndex[chr];\n if (chrId == undefined)\n return callback([]);\n\n var canonicalChr = this.indexToChr[chrId];\n\n var chunks;\n if (chrId === undefined) {\n chunks = [];\n } else {\n chunks = this.blocksForRange(chrId, min, max);\n if (!chunks) {\n callback(null, 'Error in index fetch');\n }\n }\n\n var records = [];\n var index = 0;\n var data;\n\n function tramp() {\n if (index >= chunks.length) {\n return callback(records);\n } else if (!data) {\n var c = chunks[index];\n var fetchMin = c.minv.block;\n var fetchMax = c.maxv.block + (1<<16); // *sigh*\n thisB.data.slice(fetchMin, fetchMax - fetchMin).fetch(function(r) {\n data = unbgzf(r, c.maxv.block - c.minv.block + 1);\n return tramp();\n });\n } else {\n var ba = new Uint8Array(data);\n thisB.readRecords(ba, chunks[index].minv.offset, records, min, max, canonicalChr);\n data = null;\n ++index;\n return tramp();\n }\n }\n tramp();\n}\n\nTabixFile.prototype.readRecords = function(ba, offset, sink, min, max, chr) {\n LINE_LOOP:\n while (true) {\n var line = '';\n while (offset < ba.length) {\n var ch = ba[offset++];\n if (ch == 10) {\n var toks = line.split('\\t');\n\n if (toks[this.colSeq - 1] == chr) {\n var fmin = parseInt(toks[this.colStart - 1]);\n var fmax = fmin;\n if (this.colEnd > 0)\n fmax = parseInt(toks[this.colEnd - 1]);\n if (this.format & 0x10000) ++fmin;\n\n if (fmin <= max && fmax >= min)\n sink.push(line);\n }\n continue LINE_LOOP;\n } else {\n line += String.fromCharCode(ch);\n }\n }\n return;\n }\n}\n\nTabixFile.prototype.fetchHeader = function(callback) {\n var self = this;\n var fetchPtr = 0, ptr = 0, line='';\n var lines = [];\n\n self.data.slice(0, self.headerMax).fetch(function(chnk) {\n if (!chnk) {\n return callback(null, \"Fetch failed\");\n }\n var ba = new Uint8Array(unbgzf(chnk, chnk.byteLength));\n var ptr = 0, line = '', lines = [];\n while (ptr < ba.length) {\n var ch = ba[ptr++]\n if (ch == 10) {\n if (line.charCodeAt(0) == self.meta) {\n lines.push(line);\n line = '';\n } else {\n return callback(lines);\n }\n } else {\n line += String.fromCharCode(ch);\n }\n }\n callback(lines);\n });\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n connectTabix: connectTabix,\n TABIX_MAGIC: TABIX_MAGIC\n };\n}\n","/* jshint esversion: 6 */\n\n/*\n Source that can be configured to produce any type of feature,\n useful for testing renderers.\n */\n\nimport { registerSourceAdapterFactory,\n FeatureSourceBase\n } from \"./sourceadapters.js\";\n\nimport { DASFeature\n } from \"./das.js\";\n\nimport * as R from \"ramda\";\n\n\nclass TestSource extends FeatureSourceBase {\n constructor(source) {\n super();\n\n this.features = R.defaultTo([], source.features);\n }\n\n genFeature(conf) {\n let feature = new DASFeature();\n\n for (let key in conf) {\n feature[key] = conf[key];\n }\n }\n\n fetch(chr, min, max, scale, types, pool, callback) {\n let features = R.forEach(this.genFeature, this.features);\n return callback(null, features, 1);\n }\n}\n\n\nregisterSourceAdapterFactory('test-source', source => {\n return { features: new TestSource(source) };\n});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// thub.js: support for track-hub style registries\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var textXHR = utils.textXHR;\n var relativeURL = utils.relativeURL;\n var shallowCopy = utils.shallowCopy;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n}\n\nvar THUB_STANZA_REGEXP = /\\n\\s*\\n/;\nvar THUB_PARSE_REGEXP = /(\\w+) +(.+)\\n?/;\nvar THUB_SUBGROUP_REGEXP = /subGroup[1-9]/;\n\nvar THUB_PENNANT_PREFIX = 'http://genome.ucsc.edu/images/';\n\nfunction TrackHub(url) {\n this.genomes = {};\n this.url = url;\n}\n\nfunction TrackHubTrack() {\n}\n\nTrackHubTrack.prototype.get = function(k) {\n if (this[k])\n return this[k];\n else if (this._parent) \n return this._parent.get(k);\n}\n\nfunction TrackHubDB(hub) {\n this.hub = hub;\n}\n\nTrackHubDB.prototype.getTracks = function(callback) {\n var thisB = this;\n if (this._tracks) {\n return callback(this._tracks);\n } \n \n textXHR(this.absURL, function(trackFile, err) {\n if (err) {\n return callback(null, err);\n }\n \n // trackFile = trackFile.replace(/\\#.*/g, '');\n trackFile = trackFile.replace('\\\\\\n', ' ');\n\n var tracks = [];\n var tracksById = {};\n var stanzas = trackFile.split(THUB_STANZA_REGEXP);\n for (var s = 0; s < stanzas.length; ++s) {\n var toks = stanzas[s].replace(/\\#.*/g, '').split(THUB_PARSE_REGEXP);\n var track = new TrackHubTrack();\n track._db = thisB;\n for (var l = 0; l < toks.length - 2; l += 3) {\n var k = toks[l+1], v = toks[l+2];\n if (k.match(THUB_SUBGROUP_REGEXP)) {\n if (!track.subgroups)\n track.subgroups = {};\n var sgtoks = v.split(/\\s/);\n var sgtag = sgtoks[0];\n var sgrecord = {name: sgtoks[1], tags: [], titles: []};\n for (var sgti = 2; sgti < sgtoks.length; ++sgti) {\n var grp = sgtoks[sgti].split(/=/);\n sgrecord.tags.push(grp[0]);\n sgrecord.titles.push(grp[1]);\n }\n track.subgroups[sgtag] = sgrecord;\n } else if (k === 'subGroups') {\n var sgtoks = v.split(/(\\w+)=(\\w+)/);\n track.sgm = {};\n for (var sgti = 0; sgti < sgtoks.length - 2; sgti += 3) {\n track.sgm[sgtoks[sgti+1]] = sgtoks[sgti + 2];\n }\n } else {\n track[toks[l+1]] = toks[l+2];\n }\n }\n\n if (track.track && (track.type || track.container || track.view || track.bigDataUrl)) {\n tracks.push(track);\n tracksById[track.track] = track;\n } else {\n // console.log('skipping ', track);\n }\n }\n \n var toplevels = [];\n var composites = [];\n for (var ti = 0; ti < tracks.length; ++ti) {\n var track = tracks[ti];\n var top = true;\n if (track.parent) {\n var ptoks = track.parent.split(/\\s+/);\n var parent = tracksById[ptoks[0]];\n if (parent) {\n track._parent = parent;\n\n if (!parent.children)\n parent.children = [];\n parent.children.push(track);\n\n if (parent)\n top = false;\n } else {\n console.log(\"Couldn't find parent \" + ptoks[0] + '(' + track.parent + ')');\n }\n \n }\n if (track.compositeTrack) {\n composites.push(track);\n } else if (top) {\n toplevels.push(track);\n }\n }\n\n for (var ci = 0; ci < composites.length; ++ci) {\n var comp = composites[ci];\n if (!comp.children)\n continue;\n\n var parentOfViews = false;\n for (var ki = 0; ki < comp.children.length; ++ki) {\n var k = comp.children[ki];\n if (k.view) {\n k.shortLabel = comp.shortLabel + \": \" + k.shortLabel;\n toplevels.push(k);\n parentOfViews = true;\n }\n }\n if (!parentOfViews)\n toplevels.push(comp);\n }\n \n thisB._tracks = toplevels;\n return callback(thisB._tracks, null);\n }, {credentials: this.credentials, salt: true});\n}\n\nfunction connectTrackHub(hubURL, callback, opts) {\n opts = opts || {};\n opts.salt = true;\n\n textXHR(hubURL, function(hubFile, err) {\n if (err) {\n return callback(null, err);\n }\n\n var toks = hubFile.split(THUB_PARSE_REGEXP);\n var hub = new TrackHub(hubURL);\n if (opts.credentials) {\n hub.credentials = opts.credentials;\n }\n for (var l = 0; l < toks.length - 2; l += 3) {\n hub[toks[l+1]] = toks[l+2];\n }\n \n \n if (hub.genomesFile) {\n var genURL = relativeURL(hubURL, hub.genomesFile);\n textXHR(genURL, function(genFile, err) {\n if (err) {\n return callback(null, err);\n }\n\n var stanzas = genFile.split(THUB_STANZA_REGEXP);\n for (var s = 0; s < stanzas.length; ++s) {\n var toks = stanzas[s].split(THUB_PARSE_REGEXP);\n var gprops = new TrackHubDB(hub);\n if (opts.credentials) {\n gprops.credentials = opts.credentials;\n }\n\n for (var l = 0; l < toks.length - 2; l += 3) {\n gprops[toks[l+1]] = toks[l+2];\n }\n\n if (gprops.twoBitPath) {\n gprops.twoBitPath = relativeURL(genURL, gprops.twoBitPath);\n }\n\n if (gprops.genome && gprops.trackDb) {\n gprops.absURL = relativeURL(genURL, gprops.trackDb);\n hub.genomes[gprops.genome] = gprops;\n }\n }\n\n callback(hub);\n \n }, opts);\n } else {\n callback(null, 'No genomesFile');\n }\n }, opts);\n}\n\n\nTrackHubTrack.prototype.toDallianceSource = function() {\n var source = {\n name: this.shortLabel,\n desc: this.longLabel\n };\n if (this._db.mapping) {\n source.mapping = this._db.mapping;\n }\n\n var pennantIcon = this.get('pennantIcon');\n if (pennantIcon) {\n var ptoks = pennantIcon.split(/\\s+/);\n source.pennant = THUB_PENNANT_PREFIX + ptoks[0];\n }\n\n var searchTrix = this.get('searchTrix');\n if (searchTrix) {\n source.trixURI = relativeURL(this._db.absURL, searchTrix);\n }\n\n if (this.container == 'multiWig') {\n source.merge = 'concat';\n source.overlay = [];\n var children = this.children || [];\n source.style = [];\n source.noDownsample = true;\n\n for (var ci = 0; ci < children.length; ++ci) {\n var ch = children[ci];\n var cs = ch.toDallianceSource()\n source.overlay.push(cs);\n\n if (cs.style) {\n for (var si = 0; si < cs.style.length; ++si) {\n var style = cs.style[si];\n style.method = ch.shortLabel; // FIXME\n if (this.aggregate == 'transparentOverlay')\n style.style.ALPHA = 0.5;\n source.style.push(style);\n }\n }\n }\n return source; \n } else {\n var type = this.type;\n if (!type) {\n var p = this;\n while (p._parent && !p.type) {\n p = p._parent;\n }\n type = p.type;\n }\n if (!type)\n return;\n var typeToks = type.split(/\\s+/);\n if (typeToks[0] == 'bigBed' && this.bigDataUrl) {\n var bedTokens = typeToks[1]|0\n var bedPlus = typeToks[2] == '+';\n\n source.bwgURI = relativeURL(this._db.absURL, this.bigDataUrl);\n source.style = this.bigbedStyles();\n if (this._db.credentials) {\n source.credentials = true;\n }\n if (bedTokens >= 12 && bedPlus)\n source.collapseSuperGroups = true;\n return source;\n } else if (typeToks[0] == 'bigWig' && this.bigDataUrl) {\n source.bwgURI = relativeURL(this._db.absURL, this.bigDataUrl);\n source.style = this.bigwigStyles();\n source.noDownsample = true; // FIXME seems like a blunt instrument...\n \n if (this.yLineOnOff && this.yLineOnOff == 'on') {\n source.quantLeapThreshold = this.yLineMark !== undefined ? (1.0 * this.yLineMark) : 0.0;\n }\n\n if (this._db.credentials) {\n source.credentials = true;\n }\n\n return source;\n } else if (typeToks[0] == 'bam' && this.bigDataUrl) {\n source.bamURI = relativeURL(this._db.absURL, this.bigDataUrl);\n if (this._db.credentials) {\n source.credentials = true;\n }\n return source;\n } else if (typeToks[0] == 'vcfTabix' && this.bigDataUrl) {\n source.uri = relativeURL(this._db.absURL, this.bigDataUrl);\n source.tier_type = 'tabix';\n source.payload = 'vcf';\n if (this._db.credentials) {\n source.credentials = true;\n }\n return source;\n } else {\n console.log('Unsupported ' + this.type);\n }\n }\n}\n\nTrackHubTrack.prototype.bigwigStyles = function() {\n var type = this.type;\n if (!type) {\n var p = this;\n while (p._parent && !p.type) {\n p = p._parent;\n }\n type = p.type;\n }\n if (!type)\n return;\n var typeToks = type.split(/\\s+/);\n\n var min, max;\n if (typeToks.length >= 3) {\n min = 1.0 * typeToks[1];\n max = 1.0 * typeToks[2];\n }\n\n var height;\n if (this.maxHeightPixels) {\n var mhpToks = this.maxHeightPixels.split(/:/);\n if (mhpToks.length == 3) {\n height = mhpToks[1] | 0;\n } else {\n console.log('maxHeightPixels should be of the form max:default:min');\n }\n }\n \n var gtype = 'bars';\n if (this.graphTypeDefault) {\n gtype = this.graphTypeDefault;\n }\n \n var color = 'black';\n var altColor = null;\n if (this.color) {\n color = 'rgb(' + this.color + ')';\n }\n if (this.altColor) {\n altColor = 'rgb(' + this.altColor + ')';\n }\n \n var stylesheet = new DASStylesheet();\n var wigStyle = new DASStyle();\n if (gtype == 'points') {\n wigStyle.glyph = 'POINT';\n } else {\n wigStyle.glyph = 'HISTOGRAM';\n }\n\n if (altColor) {\n wigStyle.COLOR1 = color;\n wigStyle.COLOR2 = altColor;\n } else {\n wigStyle.BGCOLOR = color;\n }\n wigStyle.HEIGHT = height || 30;\n if (min || max) {\n wigStyle.MIN = min;\n wigStyle.MAX = max;\n }\n stylesheet.pushStyle({type: 'default'}, null, wigStyle);\n return stylesheet.styles;\n}\n\nTrackHubTrack.prototype.bigbedStyles = function() {\n var itemRgb = (''+this.get('itemRgb')).toLowerCase() == 'on';\n var visibility = this.get('visibility') || 'full';\n var color = this.get('color');\n if (color)\n color = 'rgb(' + color + ')';\n else \n color = 'blue';\n \n var stylesheet = new DASStylesheet();\n var wigStyle = new DASStyle();\n wigStyle.glyph = 'BOX';\n wigStyle.FGCOLOR = 'black';\n wigStyle.BGCOLOR = color;\n wigStyle.HEIGHT = (visibility == 'full' || visibility == 'pack') ? 12 : 8;\n wigStyle.BUMP = (visibility == 'full' || visibility == 'pack');\n wigStyle.LABEL = (visibility == 'full' || visibility == 'pack');\n wigStyle.ZINDEX = 20;\n if (itemRgb)\n wigStyle.BGITEM = true;\n\n var cbs = this.get('colorByStrand');\n if (cbs) {\n var cbsToks = cbs.split(/\\s+/);\n \n var plus = shallowCopy(wigStyle);\n plus.BGCOLOR = 'rgb(' + cbsToks[0] + ')';\n stylesheet.pushStyle({type: 'bigbed', orientation: '+'}, null, plus);\n\n var minus = shallowCopy(wigStyle);\n minus.BGCOLOR = 'rgb(' + cbsToks[1] + ')';\n stylesheet.pushStyle({type: 'bigbed', orientation: '-'}, null, minus);\n } else {\n stylesheet.pushStyle({type: 'bigbed'}, null, wigStyle);\n } \n \n var tlStyle = new DASStyle();\n tlStyle.glyph = 'BOX';\n tlStyle.FGCOLOR = 'black';\n if (itemRgb)\n tlStyle.BGITEM = true;\n tlStyle.BGCOLOR = 'red'\n tlStyle.HEIGHT = 10;\n tlStyle.BUMP = true;\n tlStyle.ZINDEX = 20;\n stylesheet.pushStyle({type: 'translation'}, null, tlStyle);\n \n var tsStyle = new DASStyle();\n tsStyle.glyph = 'BOX';\n tsStyle.FGCOLOR = 'black';\n tsStyle.BGCOLOR = 'white';\n tsStyle.HEIGHT = 10;\n tsStyle.ZINDEX = 10;\n tsStyle.BUMP = true;\n tsStyle.LABEL = true;\n stylesheet.pushStyle({type: 'transcript'}, null, tsStyle);\n\n return stylesheet.styles;\n}\n\nfunction THUB_COMPARE(g, h) {\n if (g.priority && h.priority) {\n return (1.0 * g.priority) - (1.0 * h.priority)\n } else if (g.priority) {\n return 1;\n } else if (h.priority) {\n return -1;\n } else {\n return g.shortLabel.localeCompare(h.shortLabel);\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n connectTrackHub: connectTrackHub,\n THUB_COMPARE: THUB_COMPARE\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tier-actions.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var shallowCopy = utils.shallowCopy;\n}\n\nBrowser.prototype.mergeSelectedTiers = function() {\n var sources = [];\n var styles = [];\n\n for (var sti = 0; sti < this.selectedTiers.length; ++sti) {\n var tier = this.tiers[this.selectedTiers[sti]];\n\t sources.push(shallowCopy(tier.dasSource));\n var ss = tier.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n var nsh = shallowCopy(sh);\n nsh.method = tier.dasSource.name.replace(/[()+*?]/g, '\\\\$&');\n nsh._methodRE = null;\n nsh.style = shallowCopy(sh.style);\n if (nsh.style.ZINDEX === undefined)\n nsh.style.ZINDEX = sti;\n\n if (tier.forceMin) {\n nsh.style.MIN = tier.forceMin;\n }\n if (tier.forceMax) {\n nsh.style.MAX = tier.forceMax;\n }\n\n styles.push(nsh);\n }\n }\n \n this.addTier(\n\t{name: 'Merged',\n\t merge: 'concat',\n\t overlay: sources,\n\t noDownsample: true,\n style: styles});\n\n this.setSelectedTier(this.tiers.length - 1);\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2013\n//\n// tier-edit.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n\n var das = require('./das');\n var isDasBooleanTrue = das.isDasBooleanTrue;\n var isDasBooleanNotFalse = das.isDasBooleanNotFalse;\n var copyStylesheet = das.copyStylesheet;\n\n var color = require('./color');\n var dasColourForName = color.dasColourForName;\n\n var sourceDataURI = require('./sourcecompare').sourceDataURI;\n}\n\nvar __dalliance_smallGlyphs = {\n DOT: true, \n EX: true, \n STAR: true, \n SQUARE: true, \n CROSS: true, \n TRIANGLE: true, \n PLIMSOLL: true\n};\n\nBrowser.prototype.openTierPanel = function(tier) {\n var b = this;\n\n if (this.uiMode === 'tier' && this.manipulatingTier === tier) {\n this.hideToolPanel();\n this.setUiMode('none');\n } else if (!tier) {\n return;\n } else {\n var setStyleColors = function(style) {\n if (style.BGGRAD)\n return;\n\n if (numColors == 1) {\n if (style.glyph == 'LINEPLOT' || __dalliance_smallGlyphs[style.glyph]) {\n style.FGCOLOR = tierColorField.value;\n } else {\n style.BGCOLOR = tierColorField.value;\n }\n style.COLOR1 = style.COLOR2 = style.COLOR3 = null;\n } else {\n style.COLOR1 = tierColorField.value;\n style.COLOR2 = tierColorField2.value;\n if (numColors > 2) {\n style.COLOR3 = tierColorField3.value;\n } else {\n style.COLOR3 = null;\n }\n }\n style._gradient = null;\n style._plusColor = tierPlusColorField.value;\n style._minusColor = tierMinusColorField.value;\n }\n\n var mutateStylesheet = function(visitor) {\n var nss = copyStylesheet(tier.stylesheet);\n var ssScale = tier.browser.zoomForCurrentScale();\n\n for (var i = 0; i < nss.styles.length; ++i) {\n var sh = nss.styles[i];\n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n\n visitor(sh.style);\n }\n\n return nss;\n }\n\n var changeColor = function(ev) {\n tier.mergeStylesheet(mutateStylesheet(setStyleColors));\n }\n \n this.manipulatingTier = tier;\n\n var tierForm = makeElement('div', null, {className: 'tier-edit'});\n\n var aboutBanner = makeElement('div', \"About '\" + (tier.config.Name || tier.dasSource.name) + \"'\", null,\n {background: 'gray', paddingBottom: '5px', marginBottom: '5px', textAlign: 'center'});\n tierForm.appendChild(aboutBanner);\n\n var about = makeElement('div', \n [makeElement('p', tier.dasSource.desc)]\n );\n var aboutNotes = [];\n var sduri = sourceDataURI(tier.dasSource);\n if (sduri &&\n (sduri.indexOf('http://') == 0 ||\n sduri.indexOf('https://') == 0 ||\n sduri.indexOf('//') == 0) &&\n sduri !== 'https://www.biodalliance.org/magic/no_uri')\n {\n aboutNotes.push(makeElement('li', makeElement('a', '(Download data)', {href: sduri})));\n }\n\n if (tier.dasSource.mapping) {\n var coords = this.chains[tier.dasSource.mapping].coords;\n aboutNotes.push(makeElement('li', 'Mapped from ' + coords.auth + coords.version));\n }\n\n if (aboutNotes.length > 0) {\n about.appendChild(makeElement('ul', aboutNotes));\n }\n \n tierForm.appendChild(about);\n\n var semanticBanner = makeElement('span', ' (styles for current zoom level)', null, {display: 'none'});\n var editBanner = makeElement('div', ['Edit', semanticBanner], null,\n {background: 'gray', paddingBottom: '5px', marginBottom: '5px', textAlign: 'center'});\n tierForm.appendChild(editBanner);\n\n var tierNameField = makeElement('input', null, {type: 'text'});\n var tierPinnedToggle = makeElement('input', null, {type: 'checkbox', disabled: this.disablePinning});\n\n var glyphField = makeElement('select');\n glyphField.appendChild(makeElement('option', 'Histogram', {value: 'HISTOGRAM'}));\n glyphField.appendChild(makeElement('option', 'Line Plot', {value: 'LINEPLOT'}));\n glyphField.appendChild(makeElement('option', 'Ribbon', {value: 'GRADIENT'}));\n glyphField.appendChild(makeElement('option', 'Scatter', {value: 'SCATTER'}));\n\n var tierColorField = makeElement('input', null, {type: 'text', value: '#dd00dd'});\n var tierColorField2 = makeElement('input', null, {type: 'text', value: '#dd00dd'});\n var tierColorField3 = makeElement('input', null, {type: 'text', value: '#dd00dd'});\n\n var tierPlusColorField = makeElement('input', null, {type: 'text', value: '#ffa07a'});\n var tierMinusColorField = makeElement('input', null, {type: 'text', value: '#87cefa'});\n\n try {\n tierColorField.type = tierColorField2.type = tierColorField3.type = 'color';\n tierPlusColorField.type = tierMinusColorField.type = 'color';\n } catch (e) {\n // IE throws if attempt to set type to 'color'.\n }\n\n var tierColorFields = [tierColorField, tierColorField2, tierColorField3];\n var colorListPlus = makeElement('i', null, {className: 'fa fa-plus-circle'});\n var colorListMinus = makeElement('i', null, {className: 'fa fa-minus-circle'});\n var numColors = 1;\n var colorListElement = makeElement('td', tierColorFields);\n var setNumColors = function(n) {\n numColors = n;\n for (var i = 0; i < n; ++i) \n tierColorFields[i].style.display = 'block';\n for (var i = n; i < tierColorFields.length; ++i)\n tierColorFields[i].style.display = 'none';\n }\n colorListPlus.addEventListener('click', function(ev) {\n if (numColors < 3) {\n setNumColors(numColors + 1);\n changeColor(null);\n }\n }, false);\n colorListMinus.addEventListener('click', function(ev) {\n if (numColors > 1) {\n setNumColors(numColors - 1);\n changeColor(null);\n }\n }, false);\n\n var tierMinField = makeElement('input', null, {type: 'text', value: '0.0'});\n var tierMaxField = makeElement('input', null, {type: 'text', value: '10.0'});\n var tierMinToggle = makeElement('input', null, {type: 'checkbox'});\n var tierMaxToggle = makeElement('input', null, {type: 'checkbox'});\n\n var quantLeapToggle = makeElement('input', null, {type: 'checkbox', checked: tier.quantLeapThreshold !== undefined});\n var quantLeapThreshField = makeElement('input', null, {type: 'text', value: tier.quantLeapThreshold, disabled: !quantLeapToggle.checked});\n\n var tierHeightField = makeElement('input', null, {type: 'text', value: '50'});\n\n var bumpToggle = makeElement('input', null, {type: 'checkbox'});\n var bumpLimit = makeElement('input', null, {type: 'text'});\n var labelToggle = makeElement('input', null, {type: 'checkbox'});\n\n var mainStyle = null;\n if (tier.stylesheet.styles.length > 0) {\n var s = mainStyle = tier.stylesheet.styles[0].style;\n }\n\n var refresh = function() {\n if (typeof tier.config.name === 'string')\n tierNameField.value = tier.config.name;\n else \n tierNameField.value = tier.dasSource.name;\n\n tierPinnedToggle.checked = tier.pinned;\n\n if (tier.forceHeight) {\n tierHeightField.value = '' + tier.forceHeight;\n } else if (mainStyle && mainStyle.HEIGHT) {\n tierHeightField.value = '' + mainStyle.HEIGHT;\n }\n\n if (typeof tier.quantLeapThreshold == 'number') {\n quantLeapToggle.checked = true;\n quantLeapThreshField.disabled = false;\n if (parseFloat(quantLeapThreshField.value) != tier.quantLeapThreshold)\n quantLeapThreshField.value = tier.quantLeapThreshold;\n } else {\n quantLeapToggle.checked = false;\n quantLeapThreshField.disabled = true;\n }\n\n if (typeof tier.subtierMax == 'number') {\n bumpLimit.value = '' + tier.subtierMax;\n } else {\n bumpLimit.value = '' + (tier.dasSource.subtierMax || tier.browser.defaultSubtierMax);\n }\n\n if (tier.stylesheet.styles.length > 0) {\n var s = null;\n var isQuantitative=false, isSimpleQuantitative = false;\n var ssScale = tier.browser.zoomForCurrentScale();\n var activeStyleCount = 0;\n\n for (var si = 0; si < tier.stylesheet.styles.length; ++si) {\n var sh = tier.stylesheet.styles[si]; \n if (sh.zoom && sh.zoom != ssScale) {\n continue;\n }\n ++activeStyleCount;\n var ss = tier.stylesheet.styles[si].style;\n\n if (!s) {\n s = mainStyle = ss;\n }\n \n if (ss.glyph == 'LINEPLOT' || ss.glyph == 'HISTOGRAM' || ss.glyph == 'GRADIENT' || isDasBooleanTrue(ss.SCATTER)) {\n if (!isQuantitative)\n s = mainStyle = ss;\n isQuantitative = true;\n }\n }\n if (!s) {\n return;\n }\n\n semanticBanner.style.display = (activeStyleCount == tier.stylesheet.styles.length) ? 'none' : 'inline';\n\n isSimpleQuantitative = isQuantitative && activeStyleCount == 1;\n var isGradient = s.COLOR2 || s.BGGRAD;\n\n if (isQuantitative) {\n minRow.style.display = 'table-row';\n maxRow.style.display = 'table-row';\n bumpRow.style.display = 'none';\n labelRow.style.display = 'none';\n } else {\n minRow.style.display = 'none';\n maxRow.style.display = 'none';\n bumpRow.style.display = 'table-row';\n bumpToggle.checked = isDasBooleanTrue(mainStyle.BUMP);\n bumpLimit.disabled = !isDasBooleanTrue(mainStyle.BUMP);\n labelRow.style.display = 'table-row';\n labelToggle.checked = isDasBooleanTrue(mainStyle.LABEL);\n }\n\n if (isSimpleQuantitative) {\n styleRow.style.display = 'table-row';\n colorRow.style.display = 'table-row';\n } else {\n styleRow.style.display = 'none';\n colorRow.style.display = 'none';\n\n }\n\n var numColors = 1;\n if (s.COLOR1) {\n tierColorField.value = dasColourForName(s.COLOR1).toHexString();\n if (s.COLOR2) {\n tierColorField2.value = dasColourForName(s.COLOR2).toHexString();\n if (s.COLOR3) {\n tierColorField3.value = dasColourForName(s.COLOR3).toHexString();\n numColors = 3;\n } else {\n numColors = 2;\n }\n }\n } else {\n if (s.glyph == 'LINEPLOT' || s.glyph == 'DOT' && s.FGCOLOR) {\n tierColorField.value = dasColourForName(s.FGCOLOR).toHexString();\n } else if (s.BGCOLOR) {\n tierColorField.value = dasColourForName(s.BGCOLOR).toHexString();\n }\n } \n setNumColors(numColors);\n\n if (s._plusColor)\n tierPlusColorField.value = dasColourForName(s._plusColor).toHexString() || s._plusColor;\n if (s._minusColor)\n tierMinusColorField.value = dasColourForName(s._minusColor).toHexString() || s._minusColor;\n if (isDasBooleanTrue(s.SCATTER)) {\n glyphField.value = 'SCATTER';\n } else {\n glyphField.value = s.glyph;\n } \n\n var setMinValue, setMaxValue;\n if (s.MIN !== undefined) {\n var x = parseFloat(s.MIN);\n if (!isNaN(x))\n setMinValue = x;\n }\n if (!tier.forceMinDynamic && (s.MIN !== undefined || tier.forceMin !== undefined)) {\n tierMinToggle.checked = true;\n tierMinField.disabled = false;\n } else {\n tierMinToggle.checked = false;\n tierMinField.disabled = true;\n }\n\n if (s.MAX !== undefined) {\n var x = parseFloat(s.MAX)\n if (!isNaN(x))\n setMaxValue = x;\n }\n if (!tier.forceMaxDynamic && (s.MAX !== undefined || tier.forceMax !== undefined)) {\n tierMaxToggle.checked = true;\n tierMaxField.disabled = false;\n } else {\n tierMaxToggle.checked = false;\n tierMaxField.disabled = true;\n }\n\n if (tier.forceMin != undefined) {\n setMinValue = tier.forceMin;\n }\n if (tier.forceMax != undefined) {\n setMaxValue = tier.forceMax;\n }\n if (typeof(setMinValue) == 'number' && setMinValue != parseFloat(tierMinField.value)) {\n tierMinField.value = setMinValue;\n }\n if (typeof(setMaxValue) == 'number' && setMaxValue != parseFloat(tierMaxField.value)) {\n tierMaxField.value = setMaxValue;\n }\n\n var seqStyle = getSeqStyle(tier.stylesheet);\n if (seqStyle) {\n seqMismatchRow.style.display = 'table-row';\n seqMismatchToggle.checked = (seqStyle.__SEQCOLOR === 'mismatch');\n seqInsertRow.style.display = 'table-row';\n seqInsertToggle.checked = isDasBooleanTrue(seqStyle.__INSERTIONS);\n seqIgnoreQualsRow.style.display = 'table-row';\n seqIgnoreQualsToggle.checked = (seqStyle.__disableQuals === undefined || seqStyle.__disableQuals === false);\n console.log(seqStyle.__disableQuals);\n } else {\n seqMismatchRow.style.display = 'none';\n seqInsertRow.style.display = 'none';\n seqIgnoreQualsRow.style.display = 'none';\n }\n\n if (seqStyle && seqMismatchToggle.checked && !isSimpleQuantitative) {\n plusStrandColorRow.style.display = 'table-row';\n minusStrandColorRow.style.display = 'table-row';\n } else {\n plusStrandColorRow.style.display = 'none';\n minusStrandColorRow.style.display = 'none';\n }\n }\n\n if (isQuantitative && tier.browser.sourceAdapterIsCapable(tier.featureSource, 'quantLeap'))\n quantLeapRow.style.display = 'table-row';\n else \n quantLeapRow.style.display = 'none';\n }\n\n var seqMismatchToggle = makeElement('input', null, {type: 'checkbox'});\n var seqMismatchRow = makeElement('tr',\n [makeElement('th', 'Highlight mismatches & strands'),\n makeElement('td', seqMismatchToggle)]);\n seqMismatchToggle.addEventListener('change', function(ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__SEQCOLOR = seqMismatchToggle.checked ? 'mismatch' : 'base';\n tier.mergeStylesheet(nss);\n });\n\n var seqInsertToggle = makeElement('input', null, {type: 'checkbox'});\n var seqInsertRow = makeElement('tr',\n [makeElement('th', 'Show insertions'),\n makeElement('td', seqInsertToggle)]);\n seqInsertToggle.addEventListener('change', function(ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__INSERTIONS = seqInsertToggle.checked ? 'yes' : 'no';\n tier.mergeStylesheet(nss);\n });\n\n var seqIgnoreQualsToggle = makeElement('input', null, {type: 'checkbox'});\n var seqIgnoreQualsRow = makeElement('tr',\n [makeElement('th', 'Reflect base quality as base color transparency'),\n makeElement('td', seqIgnoreQualsToggle)]);\n seqIgnoreQualsToggle.addEventListener('change', function(ev) {\n var nss = copyStylesheet(tier.stylesheet);\n var seqStyle = getSeqStyle(nss);\n seqStyle.__disableQuals = !seqIgnoreQualsToggle.checked;\n console.log(seqStyle.__disableQuals);\n tier.mergeStylesheet(nss);\n });\n\n var styleRow = makeElement('tr',\n [makeElement('th', 'Style'),\n makeElement('td', glyphField)]);\n var colorRow = makeElement('tr',\n [makeElement('th', ['Colour(s)', colorListPlus, colorListMinus]),\n colorListElement]);\n var plusStrandColorRow = makeElement('tr',\n [makeElement('th', 'Plus Strand Color'),\n makeElement('td', tierPlusColorField)]);\n var minusStrandColorRow = makeElement('tr',\n [makeElement('th', 'Minus Strand Color'),\n makeElement('td', tierMinusColorField)]);\n var minRow = makeElement('tr',\n [makeElement('th', 'Min value'),\n makeElement('td', [tierMinToggle, ' ', tierMinField])]);\n var maxRow = makeElement('tr',\n [makeElement('th', 'Max value'),\n makeElement('td', [tierMaxToggle, ' ', tierMaxField])]);\n var quantLeapRow = \n makeElement('tr',\n [makeElement('th', 'Threshold leap:'),\n makeElement('td', [quantLeapToggle, ' ', quantLeapThreshField])]);\n var bumpRow = makeElement('tr',\n [makeElement('th', 'Bump overlaps'),\n makeElement('td', [bumpToggle, ' limit: ', bumpLimit])]);\n var labelRow = makeElement('tr',\n [makeElement('th', 'Label features'),\n makeElement('td', labelToggle)]);\n\n\n var tierTable = makeElement('table',\n [makeElement('tr',\n [makeElement('th', 'Name', {}, {width: '150px', textAlign: 'right'}),\n tierNameField]),\n\n makeElement('tr',\n [makeElement('th', 'Pin to top'),\n tierPinnedToggle]),\n\n makeElement('tr',\n [makeElement('th', 'Height'),\n makeElement('td', tierHeightField)]),\n\n styleRow,\n colorRow,\n plusStrandColorRow,\n minusStrandColorRow,\n minRow,\n maxRow,\n quantLeapRow,\n bumpRow,\n labelRow,\n seqMismatchRow,\n seqInsertRow,\n seqIgnoreQualsRow\n ]);\n\n\n refresh();\n\n tierForm.appendChild(tierTable);\n\n var resetButton = makeElement('button', 'Reset track', {className: 'btn'}, {marginLeft: 'auto', marginRight: 'auto', display: 'block'});\n resetButton.addEventListener('click', function(ev) {\n tier.setConfig({});\n }, false);\n tierForm.appendChild(resetButton);\n\n tierNameField.addEventListener('input', function(ev) {\n tier.mergeConfig({name: tierNameField.value});\n }, false);\n\n tierPinnedToggle.addEventListener('change', function(ev) {\n tier.mergeConfig({pinned: tierPinnedToggle.checked});\n }, false);\n\n for (var ci = 0; ci < tierColorFields.length; ++ci) {\n tierColorFields[ci].addEventListener('change', changeColor, false);\n }\n\n tierPlusColorField.addEventListener('change', changeColor, false);\n tierMinusColorField.addEventListener('change', changeColor, false);\n\n glyphField.addEventListener('change', function(ev) {\n var nss = mutateStylesheet(function(ts) {\n if (glyphField.value === 'SCATTER') {\n ts.SCATTER = true;\n ts.glyph = 'DOT';\n ts.SIZE = '3';\n } else {\n ts.glyph = glyphField.value;\n ts.SCATTER = undefined;\n }\n setStyleColors(ts);\n });\n tier.mergeStylesheet(nss);\n }, false);\n\n tierMinToggle.addEventListener('change', function(ev) {\n var conf = {forceMinDynamic: !tierMinToggle.checked};\n tierMinField.disabled = !tierMinToggle.checked;\n var x = parseFloat(tierMinField.value);\n if (tierMinToggle.checked && typeof(x) == 'number' && !isNaN(x))\n conf.forceMin = parseFloat(x);\n tier.mergeConfig(conf);\n });\n tierMinField.addEventListener('input', function(ev) {\n var x = parseFloat(tierMinField.value);\n if (typeof(x) == 'number' && !isNaN(x))\n tier.mergeConfig({forceMin: x});\n }, false);\n\n tierMaxToggle.addEventListener('change', function(ev) {\n var conf = {forceMaxDynamic: !tierMaxToggle.checked};\n tierMaxField.disabled = !tierMaxToggle.checked;\n var x = parseFloat(tierMaxField.value);\n if (tierMaxToggle.checked && typeof(x) == 'number' && !isNaN(x))\n conf.forceMax = parseFloat(x);\n tier.mergeConfig(conf);\n });\n tierMaxField.addEventListener('input', function(ev) {\n var x = parseFloat(tierMaxField.value);\n if (typeof(x) == 'number' && !isNaN(x))\n tier.mergeConfig({forceMax: x});\n }, false);\n\n tierHeightField.addEventListener('input', function(ev) {\n var x = parseFloat(tierHeightField.value);\n if (typeof(x) == 'number' && !isNaN(x))\n tier.mergeConfig({height: Math.min(500, x|0)});\n }, false);\n\n var updateQuant = function() {\n quantLeapThreshField.disabled = !quantLeapToggle.checked;\n if (quantLeapToggle.checked) {\n var x = parseFloat(quantLeapThreshField.value);\n if (typeof(x) == 'number' && !isNaN(x)) {\n tier.mergeConfig({quantLeapThreshold: parseFloat(quantLeapThreshField.value)});\n }\n } else {\n tier.mergeConfig({quantLeapThreshold: null});\n }\n }\n quantLeapToggle.addEventListener('change', function(ev) {\n updateQuant();\n }, false);\n quantLeapThreshField.addEventListener('input', function(ev) {\n updateQuant();\n }, false);\n\n labelToggle.addEventListener('change', function(ev) {\n var nss = mutateStylesheet(function(style) {\n style.LABEL = labelToggle.checked ? 'yes' : 'no';\n });\n tier.mergeStylesheet(nss);\n }, false);\n bumpToggle.addEventListener('change', function(ev) {\n var nss = mutateStylesheet(function(style) {\n style.BUMP = bumpToggle.checked ? 'yes' : 'no';\n });\n tier.mergeStylesheet(nss);\n }, false);\n bumpLimit.addEventListener('input', function(ev) {\n var x = parseInt(bumpLimit.value);\n if (typeof(x) == 'number' && x > 0) {\n tier.mergeConfig({subtierMax: x});\n }\n }, false);\n\n\n this.showToolPanel(tierForm);\n this.setUiMode('tier');\n\n tier.addTierListener(refresh);\n\n var currentScale = tier.browser.scale;\n tier.browser.addViewListener(function() {\n if (tier.browser.scale != currentScale) {\n currentScale = tier.browser.scale;\n refresh();\n }\n });\n }\n}\n\nfunction getSeqStyle(stylesheet) {\n for (var si = 0; si < stylesheet.styles.length; ++si) {\n var ss = stylesheet.styles[si].style;\n if (ss.glyph === '__SEQUENCE') {\n return ss;\n }\n }\n}\n\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// tier.js: (try) to encapsulate the functionality of a browser tier.\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n var shallowCopy = utils.shallowCopy;\n var pushnew = utils.pushnew;\n var miniJSONify = utils.miniJSONify;\n var arrayIndexOf = utils.arrayIndexOf;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n\n var sha1 = require('./sha1');\n var b64_sha1 = sha1.b64_sha1;\n\n var style = require('./style');\n var StyleFilter = style.StyleFilter;\n var StyleFilterSet = style.StyleFilterSet;\n\n var sc = require('./sourcecompare');\n var sourceDataURI = sc.sourceDataURI;\n\n var Promise = require('es6-promise').Promise;\n\n var sortFeatures = require('./features').sortFeatures;\n}\n\nvar __tier_idSeed = 0;\n\nfunction DasTier(browser, source, config, background)\n{\n this.config = config || {};\n this.id = 'tier' + (++__tier_idSeed);\n this.browser = browser;\n this.dasSource = shallowCopy(source);\n this.background = background;\n\n this.viewport = makeElement('canvas', null, \n {width: '' + ((this.browser.featurePanelWidth|0) + 2000), \n height: \"30\",\n className: 'viewport_12_5'},\n {position: 'inline-block',\n margin: '0px', border: '0px'});\n this.viewportHolder = makeElement('div', this.viewport, {className: 'viewport-holder_12_5'}, \n {background: background,\n position: 'absolute',\n padding: '0px', margin: '0px',\n border: '0px',\n left: '-1000px',\n minHeight: '200px'});\n this.overlay = makeElement('canvas', null,\n {width: + ((this.browser.featurePanelWidth|0)), \n height: \"30\",\n className: 'viewport-overlay'});\n\n this.notifier = makeElement('div', '', {className: 'notifier'});\n this.notifierHolder = makeElement('div', this.notifier, {className: 'notifier-holder'});\n this.quantOverlay = makeElement(\n 'canvas', null, \n {width: '50', height: \"56\",\n className: 'quant-overlay'});\n\n this.removeButton = makeElement('i', null, {className: 'fa fa-times'});\n this.bumpButton = makeElement('i', null, {className: 'fa fa-plus-circle'});\n this.loaderButton = browser.makeLoader(16);\n this.loaderButton.style.display = 'none';\n this.infoElement = makeElement('div', this.dasSource.desc, {className: 'track-label-info'});\n this.nameButton = makeElement('div', [], {className: 'tier-tab'});\n this.nameButton.appendChild(this.removeButton);\n if (source.pennant) {\n this.nameButton.appendChild(makeElement('img', null, {src: source.pennant, width: '16', height: '16'}))\n } else if (source.mapping) {\n var version = null;\n if (this.browser.chains[source.mapping])\n version = this.browser.chains[source.mapping].coords.version;\n if (version)\n this.nameButton.appendChild(makeElement('span', '' + version, null, {fontSize: '8pt', background: 'black', color: 'white', paddingLeft: '3px', paddingRight: '3px', paddingTop: '1px', paddingBottom: '1px', marginLeft: '2px', borderRadius: '10px'}));\n }\n this.nameElement = makeElement('span', source.name);\n this.nameButton.appendChild(makeElement('span', [this.nameElement, this.infoElement], {className: 'track-name-holder'}));\n this.nameButton.appendChild(this.bumpButton);\n this.nameButton.appendChild(this.loaderButton);\n\n this.label = makeElement('span',\n [this.nameButton],\n {className: 'btn-group track-label'});\n\n var classes = 'tier' + (source.className ? ' ' + source.className : '');\n this.row = makeElement('div', [this.viewportHolder,\n this.overlay,\n this.quantOverlay],\n {className: classes});\n\n if (!background) {\n this.row.style.background = 'none';\n }\n\n if (!browser.noDefaultLabels)\n this.row.appendChild(this.label);\n this.row.appendChild(this.notifierHolder);\n \n this.layoutHeight = 25;\n this.bumped = true;\n this.styleIdSeed = 0;\n if (source.quantLeapThreshold) {\n this.quantLeapThreshold = source.quantLeapThreshold;\n }\n if (this.dasSource.collapseSuperGroups) {\n this.bumped = false;\n }\n this.layoutWasDone = false;\n\n if (source.featureInfoPlugin) {\n this.addFeatureInfoPlugin(source.featureInfoPlugin);\n }\n\n this.initSources();\n\n var thisB = this;\n if (this.featureSource && this.featureSource.getDefaultFIPs && !source.noSourceFeatureInfo) {\n this.featureSource.getDefaultFIPs(function(fip) {\n if (fip)\n thisB.addFeatureInfoPlugin(fip);\n });\n }\n\n if (this.featureSource && this.featureSource.addReadinessListener) {\n this.readinessListener = function(ready) {\n thisB.notify(ready, -1);\n };\n this.featureSource.addReadinessListener(this.readinessListener);\n }\n\n if (this.featureSource && this.featureSource.addActivityListener) {\n this.activityListener = function(busy) {\n if (busy > 0) {\n thisB.loaderButton.style.display = 'inline-block';\n } else {\n thisB.loaderButton.style.display = 'none';\n }\n thisB.browser.pingActivity();\n };\n this.featureSource.addActivityListener(this.activityListener);\n }\n\n this.listeners = [];\n this.featuresLoadedListeners = [];\n this.firstRenderPromise = new Promise((resolve, reject) => this._resolveFirstRenderPromise = resolve);\n}\n\nDasTier.prototype.destroy = function() {\n if (this.featureSource.removeReadinessListener) {\n this.featureSource.removeReadinessListener(this.readinessListener);\n }\n if (this.featureSource.removeActivityListener) {\n this.featureSource.removeActivityListener(this.activityListener);\n }\n}\n\nDasTier.prototype.setBackground = function(b) {\n this.background = b;\n this.viewportHolder.style.background = b;\n}\n\nDasTier.prototype.toString = function() {\n return this.id;\n}\n\nDasTier.prototype.addFeatureInfoPlugin = function(p) {\n if (!this.featureInfoPlugins) \n this.featureInfoPlugins = [];\n this.featureInfoPlugins.push(p);\n}\n\nDasTier.prototype.init = function() {\n var tier = this;\n return new Promise(function (resolve, reject) {\n \n if (tier.dasSource.style) {\n tier.setStylesheet({styles: tier.dasSource.style});\n resolve(tier);\n } else {\n tier.status = 'Fetching stylesheet';\n tier.fetchStylesheet(function(ss, err) {\n if (err || !ss) {\n tier.error = 'No stylesheet';\n var ss = new DASStylesheet();\n var defStyle = new DASStyle();\n defStyle.glyph = 'BOX';\n defStyle.BGCOLOR = 'blue';\n defStyle.FGCOLOR = 'black';\n ss.pushStyle({type: 'default'}, null, defStyle);\n tier.setStylesheet(ss);\n } else {\n tier.setStylesheet(ss);\n if (ss.geneHint) {\n tier.dasSource.collapseSuperGroups = true;\n tier.bumped = false;\n tier.updateLabel();\n }\n tier._updateFromConfig();\n }\n resolve(tier);\n });\n }\n });\n}\n\nDasTier.prototype.setStylesheet = function(ss) {\n this.baseStylesheet = shallowCopy(ss);\n for (var si = 0; si < this.baseStylesheet.styles.length; ++si) {\n var sh = this.baseStylesheet.styles[si] = shallowCopy(this.baseStylesheet.styles[si]);\n sh._methodRE = sh._labelRE = sh._typeRE = null;\n sh.style = shallowCopy(sh.style);\n sh.style.id = 'style' + (++this.styleIdSeed);\n }\n this.baseStylesheetValidity = b64_sha1(miniJSONify(this.baseStylesheet));\n this._updateFromConfig();\n}\n\nDasTier.prototype.getSource = function() {\n return this.featureSource;\n}\n\nDasTier.prototype.getDesiredTypes = function(scale) {\n var sfs = this.getActiveStyleFilters(scale);\n if (sfs)\n return sfs.typeList();\n}\n\nDasTier.prototype.getActiveStyleFilters = function(scale) {\n var ssScale = this.browser.zoomForCurrentScale();\n\n if (this.stylesheet) {\n var styles = new StyleFilterSet();\n var ss = this.stylesheet.styles;\n for (var si = 0; si < ss.length; ++si) {\n var sh = ss[si];\n if (!sh.zoom || sh.zoom == ssScale) {\n styles.add(new StyleFilter(sh.type, sh.method, sh.label));\n }\n }\n return styles;\n }\n}\n\nDasTier.prototype.needsSequence = function(scale) {\n var sourceConfigNeedsSeq = function(s) {\n if (s.bamURI || s.bamBlob || s.bwgURI || s.bwgBlob) {\n return true;\n } else if (s.overlay) {\n return s.overlay.some(sourceConfigNeedsSeq);\n } else {\n return false;\n }\n }\n\n if (this.sequenceSource && scale < 5) {\n return true;\n } else if (sourceConfigNeedsSeq(this.dasSource) && scale < 20) {\n return true\n }\n return false;\n}\n\nDasTier.prototype.setFeatures = function(chr, coverage, scale, features, sequence) {\n this.currentFeatures = features;\n this.currentSequence = sequence; \n this.knownChr = chr;\n this.knownCoverage = coverage;\n \n\n // only notify features loaded, if they are valid\n if (features) {\n sortFeatures(this);\n this.notifyFeaturesLoaded();\n }\n}\n\n\nDasTier.prototype.draw = function() {\n console.log(\"Use browser.getTierRenderer(tier).drawTier(tier)\");\n}\n\nDasTier.prototype.findNextFeature = function(chr, pos, dir, fedge, callback) {\n if (this.quantLeapThreshold) {\n var width = this.browser.viewEnd - this.browser.viewStart + 1;\n pos = (pos + ((width * dir) / 2))|0\n this.featureSource.quantFindNextFeature(chr, pos, dir, this.quantLeapThreshold, callback);\n } else {\n if (this.knownCoverage && pos >= this.knownCoverage.min() && pos <= this.knownCoverage.max()) {\n if (this.currentFeatures) {\n var bestFeature = null;\n for (var fi = 0; fi < this.currentFeatures.length; ++fi) {\n var f = this.currentFeatures[fi];\n if (!f.min || !f.max) {\n continue;\n }\n if (f.parents && f.parents.length > 0) {\n continue;\n }\n if (dir < 0) {\n if (fedge == 1 && f.max >= pos && f.min < pos) {\n if (!bestFeature || f.min > bestFeature.min ||\n (f.min == bestFeature.min && f.max < bestFeature.max)) {\n bestFeature = f;\n }\n } else if (f.max < pos) {\n if (!bestFeature || f.max > bestFeature.max || \n (f.max == bestFeature.max && f.min < bestFeature.min) ||\n (f.min == bestFeature.mmin && bestFeature.max >= pos)) {\n bestFeature = f;\n } \n }\n } else {\n if (fedge == 1 && f.min <= pos && f.max > pos) {\n if (!bestFeature || f.max < bestFeature.max ||\n (f.max == bestFeature.max && f.min > bestFeature.min)) {\n bestFeature = f;\n }\n } else if (f.min > pos) {\n if (!bestFeature || f.min < bestFeature.min ||\n (f.min == bestFeature.min && f.max > bestFeature.max) ||\n (f.max == bestFeature.max && bestFeature.min <= pos)) {\n bestFeature = f;\n }\n }\n }\n }\n if (bestFeature) {\n return callback(bestFeature);\n }\n if (dir < 0) {\n pos = this.browser.knownSpace.min;\n } else {\n pos = this.browser.knownSpace.max;\n }\n }\n }\n\n this.trySourceFNF(chr, pos, dir, callback);\n }\n}\n\nDasTier.prototype.trySourceFNF = function(chr, pos, dir, callback) {\n var self = this;\n this.featureSource.findNextFeature(chr, pos, dir, function(feature) {\n if (!feature)\n callback(feature);\n\n var ss = self.browser.getSequenceSource();\n if (!ss) // We're probably in trouble, but return anyway.\n callback(feature)\n\n ss.getSeqInfo(feature.segment, function(si) {\n if (si)\n callback(feature);\n else\n self.trySourceFNF(feature.segment, dir > 0 ? 10000000000 : 0, dir, callback);\n });\n });\n}\n\n\nDasTier.prototype.updateLabel = function() {\n this.bumpButton.className = this.bumped ? 'fa fa-minus-circle' : 'fa fa-plus-circle';\n if (this.dasSource.collapseSuperGroups) {\n this.bumpButton.style.display = 'inline-block';\n } else {\n this.bumpButton.style.display = 'none';\n }\n}\n\nDasTier.prototype.updateHeight = function() {\n this.currentHeight = Math.max(Math.max(this.layoutHeight, this.label.clientHeight + 2), this.browser.minTierHeight);\n this.row.style.height = '' + this.currentHeight + 'px';\n this.browser.updateHeight();\n }\n\n\nDasTier.prototype.drawOverlay = function() {\n var t = this;\n var b = this.browser;\n var retina = b.retina && window.devicePixelRatio > 1;\n \n t.overlay.height = t.viewport.height;\n t.overlay.width = retina ? b.featurePanelWidth * 2 : b.featurePanelWidth;\n\n var g = t.overlay.getContext('2d');\n if (retina) {\n g.scale(2, 2);\n }\n \n var origin = b.viewStart;\n var visStart = b.viewStart;\n var visEnd = b.viewEnd;\n\n if (this.overlayLabelCanvas) {\n var offset = ((this.glyphCacheOrigin - this.browser.viewStart)*this.browser.scale);\n g.save();\n g.translate(offset, 0);\n var drawStart = -offset + 2;\n if (this.dasSource.tierGroup)\n drawStart += 15;\n this.overlayLabelCanvas.draw(g, drawStart, b.featurePanelWidth-offset);\n g.restore();\n }\n\n for (var hi = 0; hi < b.highlights.length; ++hi) {\n var h = b.highlights[hi];\n if (((h.chr === b.chr) || (h.chr === ('chr' + b.chr))) && h.min < visEnd && h.max > visStart) {\n g.globalAlpha = b.defaultHighlightAlpha;\n g.fillStyle = b.defaultHighlightFill;\n g.fillRect((h.min - origin) * b.scale,\n 0,\n (h.max - h.min) * b.scale,\n t.overlay.height);\n }\n } \n\n // t.oorigin = b.viewStart;\n t.overlay.style.width = b.featurePanelWidth;\n t.overlay.style.height = t.viewport.style.height;\n t.overlay.style.left = '0px';\n}\n\n\nDasTier.prototype.updateStatus = function(status) {\n var self = this;\n if (status) {\n this.status = status;\n this._notifierToStatus();\n var sd = sourceDataURI(this.dasSource);\n if (window.location.protocol === 'https:' && sourceDataURI(this.dasSource).indexOf('http:') == 0 && !this.checkedHTTP) {\n this.checkedHTTP = true;\n this.browser.canFetchPlainHTTP().then(\n function(can) {\n if (!can) {\n self.warnHTTP = true;\n self._notifierToStatus();\n }\n }\n );\n }\n } else {\n if (this.status) {\n this.status = null\n this._notifierToStatus();\n }\n }\n}\n\nDasTier.prototype.notify = function(message, timeout) {\n if (typeof(timeout) !== 'number')\n timeout = 2000;\n\n if (this.notifierFadeTimeout) {\n clearTimeout(this.notifierFadeTimeout);\n this.notifierFadeTimeout = null;\n }\n\n if (message) {\n this._notifierOn(message);\n if (timeout > 0) {\n var thisB = this;\n this.notifierFadeTimeout = setTimeout(function() {\n thisB._notifierToStatus();\n }, timeout);\n }\n } else {\n this._notifierToStatus();\n }\n}\n\nDasTier.prototype._notifierOn = function(message, warnHTTP) {\n removeChildren(this.notifier);\n if (warnHTTP) {\n this.notifier.appendChild(\n makeElement(\n 'span',\n [makeElement('a', '[HTTP Warning] ', {href: this.browser.httpWarningURL, target: \"_blank\"}),\n message]\n )\n );\n } else {\n this.notifier.textContent = message;\n }\n this.notifier.style.opacity = 0.8;\n}\n\nDasTier.prototype._notifierOff = function() {\n this.notifier.style.opacity = 0;\n}\n\nDasTier.prototype._notifierToStatus = function() {\n if (this.status) {\n this._notifierOn(this.status, this.warnHTTP)\n } else {\n this._notifierOff();\n }\n}\n\nDasTier.prototype.setConfig = function(config) {\n this.config = config || {};\n this._updateFromConfig();\n this.notifyTierListeners();\n}\n\nDasTier.prototype.mergeStylesheet = function(newStyle) {\n this.mergeConfig({\n stylesheet: newStyle, \n stylesheetValidity: this.baseStylesheetValidity\n });\n}\n\nDasTier.prototype.mergeConfig = function(newConfig) {\n for (var k in newConfig) {\n this.config[k] = newConfig[k];\n }\n this._updateFromConfig();\n this.notifyTierListeners();\n}\n\nDasTier.prototype._updateFromConfig = function() {\n var needsRefresh = false;\n var needsReorder = false;\n\n if (typeof this.config.name === 'string')\n this.nameElement.textContent = this.config.name;\n else\n this.nameElement.textContent = this.dasSource.name;\n\n var wantedHeight = this.config.height || this.dasSource.forceHeight;\n if (wantedHeight != this.forceHeight) {\n this.forceHeight = wantedHeight;\n needsRefresh = true;\n }\n\n if (this.forceMinDynamic != this.config.forceMinDynamic) {\n this.forceMinDynamic = this.config.forceMinDynamic;\n needsRefresh = true;\n }\n\n var forceMin = this.config.forceMin != undefined ? this.config.forceMin : this.dasSource.forceMin;\n if (this.forceMin != forceMin) {\n this.forceMin = forceMin;\n needsRefresh = true;\n }\n\n if (this.forceMaxDynamic != this.config.forceMaxDynamic) {\n this.forceMaxDynamic = this.config.forceMaxDynamic;\n needsRefresh = true;\n }\n \n var forceMax = this.config.forceMax != undefined ? this.config.forceMax : this.dasSource.forceMax;\n if (this.forceMax != forceMax) {\n this.forceMax = forceMax;\n needsRefresh = true;\n }\n\n var quantLeapThreshold = null;\n if (this.config.quantLeapThreshold !== undefined)\n quantLeapThreshold = this.config.quantLeapThreshold;\n else if (this.dasSource.quantLeapThreshold !== undefined)\n quantLeapThreshold = this.dasSource.quantLeapThreshold;\n if (quantLeapThreshold != this.quantLeapThreshold) {\n this.quantLeapThreshold = quantLeapThreshold;\n needsRefresh = true;\n }\n \n // Possible FIXME -- are there cases where style IDs need to be reassigned?\n var stylesheet = null;\n if (this.config.stylesheetValidity == this.baseStylesheetValidity)\n stylesheet = this.config.stylesheet;\n stylesheet = stylesheet || this.baseStylesheet;\n if (this.stylesheet !== stylesheet) {\n this.stylesheet = stylesheet;\n needsRefresh = true;\n }\n\n var wantedPinned = this.config.pinned !== undefined ? this.config.pinned : this.dasSource.pinned;\n if (wantedPinned !== this.pinned) {\n this.pinned = wantedPinned;\n needsReorder = true;\n }\n\n var wantedSubtierMax = (typeof(this.config.subtierMax === 'number') ? \n this.config.subtierMax : this.dasSource.subtierMax || this.browser.defaultSubtierMax);\n if (wantedSubtierMax != this.subtierMax) {\n this.subtierMax = wantedSubtierMax;\n needsRefresh = true;\n }\n\n var wantedBumped;\n if (this.config.bumped !== undefined) {\n wantedBumped = this.config.bumped;\n } else if (this.dasSource.bumped !== undefined) {\n wantedBumped = this.dasSource.bumped;\n } else {\n wantedBumped = this.dasSource.collapseSuperGroups ? false : true;\n }\n if (wantedBumped !== this.bumped) {\n this.bumped = wantedBumped;\n needsRefresh = true;\n this.updateLabel();\n }\n\n if (needsRefresh)\n this.scheduleRedraw();\n\n if (needsReorder)\n this.browser.reorderTiers();\n}\n\nDasTier.prototype.scheduleRedraw = function() {\n if (!this.currentFeatures)\n return;\n \n var tier = this;\n\n if (!this.redrawTimeout) {\n this.redrawTimeout = setTimeout(function() {\n sortFeatures(tier); // Some render actions mutate the results of this,\n // => need to re-run before refreshing.\n var renderer = tier.browser.getTierRenderer(tier);\n renderer.drawTier(tier);\n tier.redrawTimeout = null;\n }, 10);\n }\n}\nDasTier.prototype.clearTierListeners = function() {\n\tthis.listeners = [];\n}\n\n\nDasTier.prototype.addTierListener = function(l) {\n this.listeners.push(l);\n}\n\nDasTier.prototype.removeTierListener = function(l) {\n var idx = arrayIndexOf(this.listeners, l);\n if (idx >= 0) {\n this.listeners.splice(idx, 1);\n }\n}\n\nDasTier.prototype.notifyTierListeners = function(change) {\n for (var li = 0; li < this.listeners.length; ++li) {\n try {\n this.listeners[li](change);\n } catch (e) {\n console.log(e);\n }\n }\n this.browser.notifyTier();\n}\n\nDasTier.prototype.clearFeaturesLoadedListeners = function() {\n this.featuresLoadedListeners = [];\n}\n\nDasTier.prototype.addFeaturesLoadedListener = function(handler) {\n this.featuresLoadedListeners.push(handler);\n}\n\nDasTier.prototype.removeFeaturesLoadedListener = function(handler) {\n var idx = arrayIndexOf(this.featuresLoadedListeners, handler);\n if (idx >= 0) {\n this.featuresLoadedListeners.splice(idx, 1);\n }\n}\n\nDasTier.prototype.notifyFeaturesLoaded = function() {\n for (var li = 0; li < this.featuresLoadedListeners.length; ++li) {\n try {\n this.featuresLoadedListeners[li].call(this);\n } catch (e) {\n console.log(e);\n }\n }\n}\n\nDasTier.prototype.wasRendered = function() {\n this._resolveFirstRenderPromise();\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n DasTier: DasTier\n };\n\n // Imported for side effects\n var fd = require('./feature-draw');\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// track-adder.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var browser = require('./cbrowser');\n var Browser = browser.Browser;\n\n var sc = require('./sourcecompare');\n var sourcesAreEqual = sc.sourcesAreEqual;\n\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n var removeChildren = utils.removeChildren;\n var Observed = utils.Observed;\n\n var thub = require('./thub');\n var THUB_COMPARE = thub.THUB_COMPARE;\n var connectTrackHub = thub.connectTrackHub;\n\n var domui = require('./domui');\n var makeTreeTableSection = domui.makeTreeTableSection;\n\n var probeResource = require('./probe').probeResource;\n\n\n // Most of this could disappear if we leave all probing to the probe module...\n var bin = require('./bin');\n var URLFetchable = bin.URLFetchable;\n var BlobFetchable = bin.BlobFetchable;\n var readInt = bin.readInt;\n\n var lh3utils = require('./lh3utils');\n var unbgzf = lh3utils.unbgzf;\n\n var bam = require('./bam');\n var BAM_MAGIC = bam.BAM_MAGIC;\n var BAI_MAGIC = bam.BAI_MAGIC;\n\n var tbi = require('./tabix');\n var TABIX_MAGIC = tbi.TABIX_MAGIC;\n\n var das = require('./das');\n var DASSource = das.DASSource;\n var DASSegment = das.DASSegment;\n var DASRegistry = das.DASRegistry;\n var coordsMatch = das.coordsMatch;\n\n var EncodeFetchable = require('./encode').EncodeFetchable;\n}\n\nBrowser.prototype.currentlyActive = function(source) {\n for (var ti = 0; ti < this.tiers.length; ++ti) {\n if (sourcesAreEqual(this.tiers[ti].dasSource, source))\n return this.tiers[ti];\n }\n return false;\n}\n\nBrowser.prototype.makeButton = function(name, tooltip) {\n var regButton = makeElement('a', name, {href: '#'});\n if (tooltip) {\n this.makeTooltip(regButton, tooltip);\n }\n return makeElement('li', regButton);\n}\n\nfunction activateButton(addModeButtons, which) {\n for (var i = 0; i < addModeButtons.length; ++i) {\n var b = addModeButtons[i];\n if (b === which) {\n b.classList.add('active');\n } else {\n b.classList.remove('active');\n }\n }\n}\n\nBrowser.prototype.showTrackAdder = function(ev) {\n if (this.uiMode === 'add') {\n this.hideToolPanel();\n this.setUiMode('none');\n return;\n }\n\n var thisB = this;\n\n var popup = makeElement('div', null, {className: 'dalliance'} , {width: '100%', display: 'inline-block', boxSizing: 'border-box', MozBoxSizing: 'border-box', verticalAlign: 'top', paddingRight: '15px'});\n\n var addModeButtons = [];\n var makeStab, makeStabObserver;\n\n\n if (!this.noRegistryTabs) {\n var regButton = this.makeButton('Registry', 'Browse compatible datasources from the DAS registry');\n addModeButtons.push(regButton);\n \n for (var m in this.mappableSources) {\n var mf = function(mm) {\n var mapButton = thisB.makeButton(thisB.chains[mm].srcTag, 'Browse datasources mapped from ' + thisB.chains[mm].srcTag);\n addModeButtons.push(mapButton);\n mapButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n activateButton(addModeButtons, mapButton);\n makeStab(thisB.mappableSources[mm], mm);\n }, false);\n }; mf(m);\n }\n }\n\n var groupedDefaults = {};\n for (var si = 0; si < this.defaultSources.length; ++si) {\n var s = this.defaultSources[si];\n var g = s.group || 'Defaults';\n if (groupedDefaults[g]) {\n groupedDefaults[g].push(s);\n } else {\n groupedDefaults[g] = [s];\n }\n }\n \n\n var makeHubButton = function(tdb) {\n var hub = tdb.hub;\n var hubMenuButton = makeElement('i', null, {className: 'fa fa-list-alt'}, {cursor: 'context-menu'});\n var label = hub.altLabel || hub.shortLabel || 'Unknown';\n if (tdb.mapping)\n label = label + ' (' + tdb.genome + ')';\n var hbContent = makeElement('span', [label, ' ', hubMenuButton]);\n var hubButton = thisB.makeButton(hbContent, hub.longLabel);\n hubButton.hub = tdb;\n addModeButtons.push(hubButton);\n \n hubButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n activateButton(addModeButtons, hubButton);\n removeChildren(stabHolder);\n var loader = thisB.makeLoader(24);\n loader.style.marginLeft = 'auto';\n loader.style.marginRight = 'auto';\n loader.style.marginTop = '100px';\n stabHolder.appendChild(makeElement('div', loader, null, {textAlign: 'center'}));\n\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n\n tdb.getTracks(function(tracks, err) {\n if (err) {\n console.log(err);\n }\n \n makeHubStab(tracks);\n });\n }, false);\n\n hubMenuButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n \n var removeHubItem = makeElement('li', makeElement('a', 'Remove hub'));\n var allOnItem = makeElement('li', makeElement('a', 'Enable all'));\n var allOffItem = makeElement('li', makeElement('a', 'Disable all'));\n var hubMenu = makeElement('ul', [removeHubItem, allOnItem, allOffItem], {className: 'dropdown-menu'}, {display: 'block'});\n\n var mx = ev.clientX, my = ev.clientY;\n mx += document.documentElement.scrollLeft || document.body.scrollLeft;\n my += document.documentElement.scrollTop || document.body.scrollTop;\n\n hubMenu.style.position = 'absolute';\n hubMenu.style.top = '' + (my+10) + 'px';\n hubMenu.style.left = '' + (mx-30) + 'px';\n thisB.hPopupHolder.appendChild(hubMenu);\n\n var clickCatcher = function(ev) {\n console.log('cc');\n document.body.removeEventListener('click', clickCatcher, true);\n thisB.hPopupHolder.removeChild(hubMenu);\n };\n document.body.addEventListener('click', clickCatcher, true);\n\n removeHubItem.addEventListener('click', function(ev) {\n for (var hi = 0; hi < thisB.hubObjects.length; ++hi) {\n if (thisB.hubObjects[hi].absURL == tdb.absURL) {\n thisB.hubObjects.splice(hi, 1);\n break;\n }\n }\n for (var hi = 0; hi < thisB.hubs.length; ++hi) {\n var hc = thisB.hubs[hi];\n if (typeof hc === 'string')\n hc = {url: hc};\n if (hc.url == tdb.hub.url && !hc.genome || hc.genome == tdb.genome) {\n thisB.hubs.splice(hi, 1);\n break;\n }\n\n }\n\n thisB.notifyTier();\n\n modeButtonHolder.removeChild(hubButton);\n activateButton(addModeButtons, addHubButton);\n switchToHubConnectMode();\n }, false);\n\n\n allOnItem.addEventListener('click', function(ev) {\n tdb.getTracks(function(tracks, err) {\n if (err) {\n console.log(err);\n }\n \n for (var ti = 0; ti < tracks.length; ++ti) {\n var ds = tracks[ti].toDallianceSource();\n if (!thisB.currentlyActive(ds)) {\n thisB.addTier(ds);\n }\n }\n });\n }, false);\n\n allOffItem.addEventListener('click', function(ev) {\n tdb.getTracks(function(tracks, err) {\n if (err) {\n console.log(err);\n }\n \n for (var ti = 0; ti < tracks.length; ++ti) {\n var ds = tracks[ti].toDallianceSource();\n if (thisB.currentlyActive(ds)) {\n thisB.removeTier(ds);\n }\n }\n });\n }, false);\n }, false);\n\n return hubButton;\n }\n\n var firstDefButton = null;\n var firstDefSources = null;\n for (var g in groupedDefaults) {\n (function(g, ds) {\n var defButton = thisB.makeButton(g, 'Browse the default set of data for this browser');\n defButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n activateButton(addModeButtons, defButton);\n makeStab(new Observed(ds));\n }, false);\n addModeButtons.push(defButton);\n\n if (!firstDefButton || thisB.defaultTrackAdderTab && thisB.defaultTrackAdderTab == g) {\n firstDefButton = defButton;\n firstDefSources = ds;\n }\n })(g, groupedDefaults[g]);\n } \n var custButton = this.makeButton('DAS', 'Add data using the DAS protocol');\n addModeButtons.push(custButton);\n var binButton = this.makeButton('Files', 'Add data from files on disk or the web');\n addModeButtons.push(binButton);\n\n\n for (var hi = 0; hi < this.hubObjects.length; ++hi) {\n var hub = this.hubObjects[hi];\n makeHubButton(hub);\n }\n\n var addHubButton = this.makeButton('+', 'Connect to a new track-hub');\n addModeButtons.push(addHubButton);\n\n\n var modeButtonHolder = makeElement('ul', addModeButtons, {className: 'nav nav-tabs'}, {marginBottom: '0px'});\n popup.appendChild(modeButtonHolder);\n \n var custURL, custName, custCS, custQuant, custFile, custUser, custPass;\n var customMode = false;\n var dataToFinalize = null;\n\n var asform = makeElement('form', null, {}, {display: 'inline-block', width: '100%'});\n asform.addEventListener('submit', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n doAdd();\n return false;\n }, true); \n var stabHolder = makeElement('div');\n stabHolder.style.position = 'relative';\n stabHolder.style.overflow = 'scroll';\n // stabHolder.style.height = '500px';\n asform.appendChild(stabHolder);\n\n var __mapping;\n var __sourceHolder;\n\n\n makeStab = function(msources, mapping) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n if (__sourceHolder) {\n __sourceHolder.removeListener(makeStabObserver);\n }\n __mapping = mapping;\n __sourceHolder = msources;\n __sourceHolder.addListenerAndFire(makeStabObserver);\n }\n\n makeStabObserver = function(msources) {\n customMode = false;\n var buttons = [];\n removeChildren(stabHolder);\n if (!msources) {\n stabHolder.appendChild(makeElement('p', 'Dalliance was unable to retrieve data source information from the DAS registry, please try again later'));\n return;\n }\n \n var stabBody = makeElement('tbody', null, {className: 'table table-striped table-condensed'}, {width: '100%'});\n var stab = makeElement('table', stabBody, {className: 'table table-striped table-condensed'}, {width: '100%', tableLayout: 'fixed'}); \n var idx = 0;\n\n var sources = [];\n for (var i = 0; i < msources.length; ++i) {\n sources.push(msources[i]);\n }\n \n sources.sort(function(a, b) {\n return a.name.toLowerCase().trim().localeCompare(b.name.toLowerCase().trim());\n });\n\n for (var i = 0; i < sources.length; ++i) {\n var source = sources[i];\n var r = makeElement('tr');\n\n var bd = makeElement('td', null, {}, {width: '30px'});\n bd.style.textAlign = 'center';\n if (!source.props || source.props.cors) {\n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = source;\n b.id = 'sourcecb' + i;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n // b.checked = thisB.currentlyActive(source);\n bd.appendChild(b);\n buttons.push(b);\n b.addEventListener('change', function(ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n } else {\n bd.appendChild(document.createTextNode('!'));\n thisB.makeTooltip(bd, makeElement('span', [\"This data source isn't accessible because it doesn't support \", makeElement('a', \"CORS\", {href: 'http://www.w3.org/TR/cors/'}), \".\"]));\n }\n r.appendChild(bd);\n var ld = makeElement('label', null, {htmlFor: 'sourcecb' + i});\n ld.appendChild(document.createTextNode(source.name));\n if (source.desc && source.desc.length > 0) {\n thisB.makeTooltip(ld, source.desc);\n }\n r.appendChild(makeElement('td', ld));\n stabBody.appendChild(r);\n ++idx;\n }\n\n var setChecks = function() {\n for (var bi = 0; bi < buttons.length; ++bi) {\n var b = buttons[bi];\n var t = thisB.currentlyActive(b.dalliance_source);\n if (t) {\n b.checked = true;\n } else {\n b.checked = false;\n }\n }\n }\n setChecks();\n thisB.addTierListener(function(l) {\n setChecks();\n });\n\n stabHolder.appendChild(stab);\n };\n\n function makeHubStab(tracks) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'none';\n canButton.style.display = 'none';\n\n customMode = false;\n removeChildren(stabHolder);\n \n let buttonIdSeed = 0;\n\n var ttab = makeElement('div', null, {}, {width: '100%'});\n var sources = [];\n for (var i = 0; i < tracks.length; ++i) {\n sources.push(tracks[i]);\n }\n \n sources.sort(function(a, b) {\n return a.shortLabel.toLowerCase().trim().localeCompare(b.shortLabel.toLowerCase().trim());\n });\n\n var groups = [];\n var tops = [];\n \n for (var ti = 0; ti < sources.length; ++ti) {\n var track = sources[ti];\n if (track.children && track.children.length > 0 && track.container != 'multiWig') {\n groups.push(track);\n } else {\n tops.push(track);\n }\n }\n if (tops.length > 0) {\n groups.push({\n shortLabel: 'Others',\n priority: -100000000,\n children: tops});\n }\n\n groups.sort(THUB_COMPARE);\n \n var buttons = [];\n for (var gi = 0; gi < groups.length; ++gi) {\n var group = groups[gi];\n var dg = group;\n if (!dg.dimensions && dg._parent && dg._parent.dimensions)\n dg = dg._parent;\n\n var dprops = {}\n if (dg.dimensions) {\n var dtoks = dg.dimensions.split(/(\\w+)=(\\w+)/);\n for (var dti = 0; dti < dtoks.length - 2; dti += 3) {\n dprops[dtoks[dti + 1]] = dtoks[dti + 2];\n }\n }\n\n if (dprops.dimX && dprops.dimY) {\n var dimX = dprops.dimX, dimY = dprops.dimY;\n var sgX = dg.subgroups[dimX];\n var sgY = dg.subgroups[dimY];\n \n var trks = {};\n for (var ci = 0; ci < group.children.length; ++ci) {\n var child = group.children[ci];\n var vX = child.sgm[dimX], vY = child.sgm[dimY];\n if (!trks[vX])\n trks[vX] = {};\n trks[vX][vY] = child;\n }\n\n var matrix = makeElement('table', null, {className: 'table table-striped table-condensed'}, {tableLayout: 'fixed'});\n {\n var header = makeElement('tr');\n header.appendChild(makeElement('th', null, {}, {width: '150px', height: '100px'})); // blank corner element\n for (var si = 0; si < sgX.titles.length; ++si) {\n var h = makeElement('th', makeElement('div', sgX.titles[si], {}, {transform: 'rotate(-60deg)', \n transformOrigin: '0% 100%', \n webkitTransform: 'rotate(-60deg) translate(20px,10px)', \n webkitTransformOrigin: '0% 100%',\n textAlign: 'left'}), {}, {width: '35px',\n height: '100px',\n verticalAlign: 'bottom'})\n header.appendChild(h);\n }\n matrix.appendChild(header);\n }\n\n var mbody = makeElement('tbody', null, {className: 'table table-striped table-condensed'})\n for (var yi = 0; yi < sgY.titles.length; ++yi) {\n var vY = sgY.tags[yi];\n var row = makeElement('tr');\n row.appendChild(makeElement('th', sgY.titles[yi]), {});\n \n for (var xi = 0; xi < sgX.titles.length; ++xi) {\n var vX = sgX.tags[xi];\n var cell = makeElement('td');\n if (trks[vX] && trks[vX][vY]) {\n var track = trks[vX][vY];\n var ds = track.toDallianceSource();\n if (!ds)\n continue;\n \n var r = makeElement('tr');\n var bd = makeElement('td');\n bd.style.textAlign = 'center';\n \n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = ds;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n buttons.push(b);\n cell.appendChild(b);\n b.addEventListener('change', function(ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n\n }\n row.appendChild(cell);\n } \n mbody.appendChild(row);\n }\n matrix.appendChild(mbody);\n ttab.appendChild(makeTreeTableSection(group.shortLabel, matrix, gi==0)); \n } else {\n var stabBody = makeElement('tbody', null, {className: 'table table-striped table-condensed'});\n var stab = makeElement('table', stabBody, {className: 'table table-striped table-condensed'}, {width: '100%', tableLayout: 'fixed'}); \n var idx = 0;\n \n group.children.sort(THUB_COMPARE);\n for (var i = 0; i < group.children.length; ++i) {\n const buttonId = 'hb' + (++buttonIdSeed);\n\n var track = group.children[i];\n var ds = track.toDallianceSource();\n if (!ds)\n continue;\n\n var r = makeElement('tr');\n var bd = makeElement('td', null, {}, {width: '30px'});\n bd.style.textAlign = 'center';\n \n var b = makeElement('input');\n b.type = 'checkbox';\n b.dalliance_source = ds;\n b.id = buttonId;\n if (__mapping) {\n b.dalliance_mapping = __mapping;\n }\n buttons.push(b);\n bd.appendChild(b);\n b.addEventListener('change', function(ev) {\n if (ev.target.checked) {\n thisB.addTier(ev.target.dalliance_source);\n } else {\n thisB.removeTier(ev.target.dalliance_source);\n }\n });\n\n r.appendChild(bd);\n var ld = makeElement('label', null, {htmlFor: buttonId});\n ld.appendChild(document.createTextNode(track.shortLabel));\n if (track.longLabel && track.longLabel.length > 0) {\n thisB.makeTooltip(ld, track.longLabel);\n }\n r.appendChild(makeElement('td', ld));\n stabBody.appendChild(r);\n ++idx;\n }\n\n if (groups.length > 1 || group.shortLabel !== 'Others') {\n ttab.appendChild(makeTreeTableSection(group.shortLabel, stab, gi==0));\n } else {\n ttab.appendChild(stab);\n }\n \n }\n }\n\n var setChecks = function() {\n for (var bi = 0; bi < buttons.length; ++bi) {\n var b = buttons[bi];\n var t = thisB.currentlyActive(b.dalliance_source);\n if (t) {\n b.checked = true;\n b.disabled = t.sequenceSource != null;\n } else {\n b.checked = false;\n }\n }\n }\n setChecks();\n thisB.addTierListener(function(l) {\n setChecks();\n });\n \n stabHolder.appendChild(ttab);\n }\n\n if (regButton) {\n regButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n activateButton(addModeButtons, regButton);\n makeStab(thisB.availableSources);\n }, false);\n }\n \n binButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n switchToBinMode();\n }, false);\n addHubButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n switchToHubConnectMode();\n }, false);\n\n\n function switchToBinMode() {\n activateButton(addModeButtons, binButton);\n customMode = 'bin';\n\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n removeChildren(stabHolder);\n var pageHolder = makeElement('div', null, {}, {paddingLeft: '10px', paddingRight: '10px'});\n pageHolder.appendChild(makeElement('h3', 'Add custom URL-based data'));\n pageHolder.appendChild(makeElement('p', ['You can add indexed binary data hosted on an web server that supports CORS (', makeElement('a', 'full details', {href: 'http://www.biodalliance.org/bin.html'}), '). Currently supported formats are bigwig, bigbed, and indexed BAM.']));\n\n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(document.createTextNode('URL: '));\n custURL = makeElement('input', '', {size: 80, value: 'http://www.biodalliance.org/datasets/ensGene.bb'}, {width: '100%'});\n pageHolder.appendChild(custURL);\n \n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(makeElement('b', '- or -'));\n pageHolder.appendChild(makeElement('br'));\n pageHolder.appendChild(document.createTextNode('File: '));\n custFile = makeElement('input', null, {type: 'file', multiple: 'multiple'});\n pageHolder.appendChild(custFile);\n \n pageHolder.appendChild(makeElement('p', 'Clicking the \"Add\" button below will initiate a series of test queries.'));\n\n stabHolder.appendChild(pageHolder);\n custURL.focus();\n }\n\n function switchToHubConnectMode() {\n activateButton(addModeButtons, addHubButton);\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n customMode = 'hub-connect';\n refreshButton.style.visibility = 'hidden';\n\n removeChildren(stabHolder);\n\n var pageHolder = makeElement('div', null, {}, {paddingLeft: '10px', paddingRight: '10px'});\n pageHolder.appendChild(makeElement('h3', 'Connect to a track hub.'));\n pageHolder.appendChild(makeElement('p', ['Enter the top-level URL (usually points to a file called \"hub.txt\") of a UCSC-style track hub']));\n \n custURL = makeElement('input', '', {size: 120, value: 'http://www.biodalliance.org/datasets/testhub/hub.txt'}, {width: '100%'});\n pageHolder.appendChild(custURL);\n \n stabHolder.appendChild(pageHolder);\n \n custURL.focus();\n }\n\n custButton.addEventListener('click', function(ev) {\n ev.preventDefault(); ev.stopPropagation();\n switchToCustomMode();\n }, false);\n\n function switchToCustomMode() {\n activateButton(addModeButtons, custButton);\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'none';\n\n customMode = 'das';\n\n removeChildren(stabHolder);\n\n var customForm = makeElement('div', null, {}, {paddingLeft: '10px', paddingRight: '10px'});\n customForm.appendChild(makeElement('h3', 'Add custom DAS data'));\n customForm.appendChild(makeElement('p', 'This interface is intended for adding custom or lab-specific data. Public data can be added more easily via the registry interface.'));\n \n customForm.appendChild(document.createTextNode('URL: '));\n customForm.appendChild(makeElement('br'));\n custURL = makeElement('input', '', {size: 80, value: 'http://www.derkholm.net:8080/das/medipseq_reads/'}, {width: '100%'});\n customForm.appendChild(custURL);\n\n customForm.appendChild(makeElement('p', 'Clicking the \"Add\" button below will initiate a series of test queries. If the source is password-protected, you may be prompted to enter credentials.'));\n stabHolder.appendChild(customForm);\n\n custURL.focus();\n }\n\n\n\n var addButton = makeElement('button', 'Add', {className: 'btn btn-primary'});\n addButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n doAdd();\n }, false);\n\n function doAdd() {\n if (customMode) {\n if (customMode === 'das') {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n var nds = new DASSource({name: 'temporary', uri: curi});\n tryAddDAS(nds);\n } else if (customMode === 'bin') {\n var fileList = custFile.files;\n\n if (fileList && fileList.length > 0) {\n tryAddMultiple(fileList);\n } else {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n var source = {uri: curi};\n var lcuri = curi.toLowerCase();\n if (lcuri.indexOf(\"https://www.encodeproject.org/\") == 0 &&\n lcuri.indexOf(\"@@download\") >= 0) \n {\n source.transport = 'encode';\n }\n tryAddBin(source);\n }\n } else if (customMode === 'reset') {\n switchToCustomMode();\n } else if (customMode === 'reset-bin') {\n switchToBinMode(); \n } else if (customMode === 'reset-hub') {\n switchToHubConnectMode();\n } else if (customMode === 'prompt-bai') {\n var fileList = custFile.files;\n if (fileList && fileList.length > 0 && fileList[0]) {\n dataToFinalize.baiBlob = fileList[0];\n completeBAM(dataToFinalize);\n } else {\n promptForBAI(dataToFinalize);\n }\n } else if (customMode === 'prompt-tbi') {\n var fileList = custFile.files;\n if (fileList && fileList.length > 0 && fileList[0]) {\n dataToFinalize.indexBlob = fileList[0];\n completeTabixVCF(dataToFinalize);\n } else {\n promptForTabix(dataToFinalize);\n }\n } else if (customMode === 'finalize' || customMode === 'finalize-bin') {\n dataToFinalize.name = custName.value;\n var m = custCS.value;\n if (m != '__default__') {\n dataToFinalize.mapping = m;\n } else {\n dataToFinalize.mapping = undefined;\n }\n if (custQuant) {\n dataToFinalize.maxbins = custQuant.checked;\n }\n\n if (custUser.value.length > 1 && custPass.value.length > 1) {\n dataToFinalize.xUser = custUser.value;\n dataToFinalize.xPass = custPass.value;\n }\n\n thisB.addTier(dataToFinalize);\n\n if (customMode == 'finalize-bin')\n switchToBinMode();\n else\n switchToCustomMode();\n } else if (customMode === 'hub-connect') {\n var curi = custURL.value.trim();\n if (!/^.+:\\/\\//.exec(curi)) {\n curi = 'http://' + curi;\n }\n \n tryAddHub(curi);\n } else if (customMode === 'multiple') {\n for (var mi = 0; mi < multipleSet.length; ++mi) {\n var s = multipleSet[mi];\n if (s.hidden)\n continue;\n\n if (s.tier_type == 'bam' && !s.indexBlob && !s.indexUri)\n continue;\n if (s.tier_type == 'tabix' && !s.indexBlob && !s.indexUri)\n continue;\n\n var nds = makeSourceConfig(s);\n if (nds) {\n nds.noPersist = true;\n thisB.addTier(nds);\n }\n }\n\n switchToBinMode();\n }\n } else {\n thisB.removeAllPopups();\n }\n };\n\n function tryAddHub(curi, opts, retry) {\n opts = opts || {};\n for (var hi = 0; hi < thisB.hubObjects.length; ++hi) {\n var h = thisB.hubObjects[hi];\n if (h.hub.url == curi) {\n for (var bi = 0; bi < addModeButtons.length; ++bi) {\n if (addModeButtons[bi].hub == h) {\n activateButton(addModeButtons, addModeButtons[bi]);\n }\n }\n h.getTracks(function(tracks, err) {\n if (err) {\n console.log(err);\n }\n makeHubStab(tracks);\n });\n return;\n }\n\n }\n \n connectTrackHub(curi, function(hub, err) {\n if (err) {\n if (!retry) {\n return tryAddHub(curi, {credentials: true}, true);\n }\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Error connecting to track hub'))\n stabHolder.appendChild(makeElement('p', err));\n customMode = 'reset-hub';\n return;\n } else {\n var bestHub = null;\n var bestHubButton = null;\n for (var genome in hub.genomes) {\n var mapping = null;\n var okay = false;\n\n if (genome == thisB.coordSystem.ucscName) {\n okay = true;\n } else {\n for (var mid in thisB.chains) {\n var m = thisB.chains[mid];\n if (genome == m.coords.ucscName) {\n mapping = mid;\n okay = true;\n }\n }\n }\n\n if (okay) {\n var hc = {url: curi, genome: genome};\n if (opts.credentials)\n hc.credentials = true;\n if (mapping) {\n hc.mapping = mapping;\n hub.genomes[genome].mapping = mapping;\n }\n thisB.hubs.push(hc);\n thisB.hubObjects.push(hub.genomes[genome]);\n \n var hubButton = makeHubButton(hub.genomes[genome]);\n modeButtonHolder.appendChild(hubButton);\n\n if (!mapping || !bestHub) {\n bestHub = hub.genomes[genome];\n bestHubButton = hubButton;\n }\n }\n }\n\n if (bestHub) {\n thisB.notifyTier();\n activateButton(addModeButtons, bestHubButton);\n bestHub.getTracks(function(tracks, err) {\n makeHubStab(tracks);\n });\n } else {\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'No data for this genome'))\n stabHolder.appendChild(makeElement('p', 'This URL appears to be a valid track-hub, but it doesn\\'t contain any data for the coordinate system of this browser'));\n stabHolder.appendChild(makeElement('p', 'coordSystem.ucscName = ' + thisB.coordSystem.ucscName));\n customMode = 'reset-hub';\n return;\n }\n }\n }, opts);\n }\n\n var tryAddDAS = function(nds, retry) {\n var knownSpace = thisB.knownSpace;\n if (!knownSpace) {\n alert(\"Can't confirm track-addition to an uninit browser.\");\n return;\n }\n var tsm = Math.max(knownSpace.min, (knownSpace.min + knownSpace.max - 100) / 2)|0;\n var testSegment = new DASSegment(knownSpace.chr, tsm, Math.min(tsm + 99, knownSpace.max));\n nds.features(testSegment, {}, function(features, status) {\n if (status) {\n if (!retry) {\n nds.credentials = true;\n tryAddDAS(nds, true);\n } else {\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Custom data not found'));\n stabHolder.appendChild(makeElement('p', 'DAS uri: ' + nds.uri + ' is not answering features requests'));\n customMode = 'reset';\n return;\n }\n } else {\n var nameExtractPattern = new RegExp('/([^/]+)/?$');\n var match = nameExtractPattern.exec(nds.uri);\n if (match) {\n nds.name = match[1];\n }\n\n tryAddDASxSources(nds);\n return;\n }\n });\n }\n\n function tryAddDASxSources(nds, retry) {\n var uri = nds.uri;\n if (retry) {\n var match = /(.+)\\/[^\\/]+\\/?/.exec(uri);\n if (match) {\n uri = match[1] + '/sources';\n }\n }\n function sqfail() {\n if (!retry) {\n return tryAddDASxSources(nds, true);\n } else {\n return addDasCompletionPage(nds);\n }\n }\n new DASRegistry(uri, {credentials: nds.credentials}).sources(\n function(sources) {\n if (!sources || sources.length == 0) {\n return sqfail();\n } \n\n var fs = null;\n if (sources.length == 1) {\n fs = sources[0];\n } else {\n for (var i = 0; i < sources.length; ++i) {\n if (sources[i].uri === nds.uri) {\n fs = sources[i];\n break;\n }\n }\n }\n\n var coordsDetermined = false, quantDetermined = false;\n if (fs) {\n nds.name = fs.name;\n nds.desc = fs.desc;\n if (fs.maxbins) {\n nds.maxbins = true;\n } else {\n nds.maxbins = false;\n }\n if (fs.capabilities) {\n nds.capabilities = fs.capabilities;\n }\n quantDetermined = true\n \n if (fs.coords && fs.coords.length == 1) {\n var coords = fs.coords[0];\n if (coordsMatch(coords, thisB.coordSystem)) {\n coordsDetermined = true;\n } else if (thisB.chains) {\n for (var k in thisB.chains) {\n if (coordsMatch(coords, thisB.chains[k].coords)) {\n nds.mapping = k;\n coordsDetermined = true;\n }\n }\n }\n }\n \n }\n return addDasCompletionPage(nds, coordsDetermined, quantDetermined);\n },\n function() {\n return sqfail();\n }\n );\n }\n\n var makeSourceConfig = function(s) {\n var nds = {name: s.name};\n if (s.credentials)\n nds.credentials = s.credentials;\n \n if (s.mapping && s.mapping != '__default__')\n nds.mapping = s.mapping;\n\n if (s.transport)\n nds.transport = s.transport;\n\n if (s.tier_type == 'bwg') {\n if (s.blob)\n nds.bwgBlob = s.blob;\n else if (s.uri)\n nds.bwgURI = s.uri;\n return nds;\n } else if (s.tier_type == 'bam') {\n if (s.blob) {\n nds.bamBlob = s.blob;\n nds.baiBlob = s.indexBlob;\n } else {\n nds.bamURI = s.uri;\n nds.baiURI = s.indexUri;\n }\n return nds;\n } else if (s.tier_type == 'tabix') {\n nds.tier_type = 'tabix';\n nds.payload = s.payload;\n if (s.blob) {\n nds.blob = s.blob;\n nds.indexBlob = s.indexBlob;\n } else {\n nds.uri = s.uri;\n nds.indexUri = s.indexUri;\n }\n return nds;\n } else if (s.tier_type == 'memstore') {\n nds.tier_type = 'memstore';\n nds.payload = s.payload;\n if (s.blob)\n nds.blob = s.blob;\n else\n nds.uri = s.uri;\n return nds;\n }\n }\n\n var tryAddBin = function(source) {\n probeResource(source, function(source, err) {\n if (err) {\n removeChildren(stabHolder);\n var tabError = makeElement('div');\n tabError.appendChild(makeElement('h2', \"Couldn't access custom data\"));\n tabError.appendChild(makeElement('p', '' + err));\n stabHolder.appendChild(tabError);\n console.log(source);\n if (window.location.protocol === 'https:' && source.uri.indexOf('http:') == 0) {\n thisB.canFetchPlainHTTP().then(\n function(can) {\n if (!can) {\n tabError.appendChild(\n makeElement('p', [\n makeElement('strong', 'HTTP warning: '),\n 'you may not be able to access HTTP resources from an instance of Biodalliance which you are accessing via HTTPS.',\n makeElement('a', '[More info]', {href: thisB.httpWarningURL, target: \"_blank\"})\n ]\n )\n );\n }\n }\n );\n }\n customMode = 'reset-bin';\n } else {\n var nds = makeSourceConfig(source);\n if (source.tier_type == 'bam') {\n return completeBAM(nds);\n } else if (source.tier_type == 'tabix') {\n return completeTabixVCF(nds);\n } else {\n return addDasCompletionPage(nds, false, false, true);\n }\n }\n });\n }\n\n function promptForBAI(nds) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n customMode = 'prompt-bai'\n stabHolder.appendChild(makeElement('h2', 'Select an index file'));\n stabHolder.appendChild(makeElement('p', 'Dalliance requires a BAM index (.bai) file when displaying BAM data. These normally accompany BAM files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file'));\n\n stabHolder.appendChild(document.createTextNode('Index file: '));\n custFile = makeElement('input', null, {type: 'file'});\n stabHolder.appendChild(custFile);\n dataToFinalize = nds;\n }\n\n function promptForTabix(nds) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n customMode = 'prompt-tbi'\n stabHolder.appendChild(makeElement('h2', 'Select an index file'));\n stabHolder.appendChild(makeElement('p', 'Dalliance requires a Tabix index (.tbi) file when displaying VCF data. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file'));\n\n stabHolder.appendChild(document.createTextNode('Index file: '));\n custFile = makeElement('input', null, {type: 'file'});\n stabHolder.appendChild(custFile);\n dataToFinalize = nds;\n }\n\n function completeBAM(nds) {\n var indexF;\n if (nds.baiBlob) \n indexF = new BlobFetchable(nds.baiBlob);\n else if (nds.transport == 'encode')\n indexF = new EncodeFetchable(nds.bamURI + '.bai');\n else\n indexF = new URLFetchable(nds.bamURI + '.bai', {credentials: nds.credentials});\n\n indexF.slice(0, 256).fetch(function(r) {\n var hasBAI = false;\n if (r) {\n var ba = new Uint8Array(r);\n var magic2 = readInt(ba, 0);\n hasBAI = (magic2 == BAI_MAGIC);\n }\n if (hasBAI) {\n return addDasCompletionPage(nds, false, false, true);\n } else {\n return binFormatErrorPage('You have selected a valid BAM file, but a corresponding index (.bai) file was not found. Please index your BAM (samtools index) and place the BAI file in the same directory');\n }\n });\n }\n\n function completeTabixVCF(nds) {\n var indexF;\n if (nds.indexBlob) {\n indexF = new BlobFetchable(nds.indexBlob);\n } else {\n indexF = new URLFetchable(nds.uri + '.tbi');\n }\n indexF.slice(0, 1<<16).fetch(function(r) {\n var hasTabix = false;\n if (r) {\n var ba = new Uint8Array(r);\n if (ba[0] == 31 || ba[1] == 139) {\n var unc = unbgzf(r);\n ba = new Uint8Array(unc);\n var m2 = readInt(ba, 0);\n hasTabix = (m2 == TABIX_MAGIC);\n }\n }\n if (hasTabix) {\n return addDasCompletionPage(nds, false, false, true);\n } else {\n return binFormatErrorPage('You have selected a valid VCF file, but a corresponding index (.tbi) file was not found. Please index your VCF (\"tabix -p vcf -f myfile.vcf.gz\") and place the .tbi file in the same directory');\n }\n });\n }\n\n function binFormatErrorPage(message) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n message = message || 'Custom data format not recognized';\n stabHolder.appendChild(makeElement('h2', 'Error adding custom data'));\n stabHolder.appendChild(makeElement('p', message));\n stabHolder.appendChild(makeElement('p', 'Currently supported formats are bigBed, bigWig, and BAM.'));\n customMode = 'reset-bin';\n return;\n }\n \n var addDasCompletionPage = function(nds, coordsDetermined, quantDetermined, quantIrrelevant) {\n refreshButton.style.display = 'none';\n addButton.style.display = 'inline';\n canButton.style.display = 'inline';\n\n removeChildren(stabHolder);\n stabHolder.appendChild(makeElement('h2', 'Add custom data: step 2'));\n stabHolder.appendChild(document.createTextNode('Label: '));\n custName = makeElement('input', '', {value: nds.name});\n stabHolder.appendChild(custName);\n\n\n // stabHolder.appendChild(document.createTextNode('User: '));\n custUser = makeElement('input', '');\n // stabHolder.appendChild(custUser);\n //stabHolder.appendChild(document.createTextNode('Pass: '));\n custPass = makeElement('input', '');\n // stabHolder.appendChild(custPass);\n \n\n stabHolder.appendChild(makeElement('br'));\n stabHolder.appendChild(makeElement('br'));\n stabHolder.appendChild(makeElement('h4', 'Coordinate system: '));\n custCS = makeElement('select', null);\n custCS.appendChild(makeElement('option', thisB.nameForCoordSystem(thisB.coordSystem), {value: '__default__'}));\n if (thisB.chains) {\n for (var csk in thisB.chains) {\n var cs = thisB.chains[csk].coords;\n custCS.appendChild(makeElement('option', thisB.nameForCoordSystem(cs), {value: csk}));\n }\n }\n custCS.value = nds.mapping || '__default__';\n stabHolder.appendChild(custCS);\n\n if (coordsDetermined) {\n stabHolder.appendChild(makeElement('p', \"(Based on server response, probably doesn't need changing.)\"));\n } else {\n stabHolder.appendChild(makeElement('p', [makeElement('b', 'Warning: '), \"unable to determine the correct value from server responses. Please check carefully.\"]));\n stabHolder.appendChild(makeElement('p', \"If you don't see the mapping you're looking for, please contact [email protected]\"));\n }\n\n if (!quantIrrelevant) {\n stabHolder.appendChild(document.createTextNode('Quantitative: '));\n custQuant = makeElement('input', null, {type: 'checkbox', checked: true});\n if (typeof nds.maxbins !== 'undefined') {\n custQuant.checked = nds.maxbins;\n }\n stabHolder.appendChild(custQuant);\n if (quantDetermined) {\n stabHolder.appendChild(makeElement('p', \"(Based on server response, probably doesn't need changing.)\"));\n } else {\n stabHolder.appendChild(makeElement('p', [makeElement('b', \"Warning: \"), \"unable to determine correct value. If in doubt, leave checked.\"]));\n }\n }\n\n if (nds.bwgBlob) {\n stabHolder.appendChild(makeElement('p', [makeElement('b', 'Warning: '), 'data added from local file. Due to the browser security model, the track will disappear if you reload Dalliance.']));\n }\n\n custName.focus();\n\n if (customMode === 'bin' || customMode === 'prompt-bai' || customMode === 'prompt-tbi')\n customMode = 'finalize-bin';\n else\n customMode = 'finalize';\n dataToFinalize = nds;\n }\n\n var multipleSet = null;\n var tryAddMultiple = function(fileList) {\n var newSources = multipleSet = [];\n customMode = 'multiple';\n for (var fi = 0; fi < fileList.length; ++fi) {\n var f = fileList[fi];\n if (f) {\n newSources.push({blob: f});\n }\n }\n\n for (var fi = 0; fi < newSources.length; ++fi) {\n probeMultiple(newSources[fi]);\n }\n updateMultipleStatus();\n }\n\n var probeMultiple = function(ns) {\n probeResource(ns, function(source, err) {\n if (err) {\n source.error = err;\n }\n\n var usedIndices = [];\n var bams = {}, tabixes = {};\n for (var si = 0; si < multipleSet.length; ++si) {\n var s = multipleSet[si];\n if (s.tier_type == 'bam' && !s.indexBlob) {\n bams[s.blob.name] = s;\n }\n if (s.tier_type == 'tabix' && !s.indexBlob) {\n tabixes[s.blob.name] = s;\n }\n }\n\n for (var si = 0; si < multipleSet.length; ++si) {\n var s = multipleSet[si];\n if (s.tier_type === 'bai') {\n var baiPattern = new RegExp('(.+)\\\\.bai$');\n var match = baiPattern.exec(s.blob.name);\n if (match && bams[match[1]]) {\n bams[match[1]].indexBlob = s.blob;\n usedIndices.push(si);\n }\n } else if (s.tier_type === 'tabix-index') {\n var tbiPattern = new RegExp('(.+)\\\\.tbi$');\n var match = tbiPattern.exec(s.blob.name);\n if (match && tabixes[match[1]]) {\n tabixes[match[1]].indexBlob = s.blob;\n usedIndices.push(si);\n }\n }\n }\n\n for (var bi = usedIndices.length - 1; bi >= 0; --bi) {\n multipleSet.splice(usedIndices[bi], 1);\n }\n\n updateMultipleStatus();\n });\n }\n\n var updateMultipleStatus = function() {\n removeChildren(stabHolder);\n var needsIndex = false;\n var multTable = makeElement('table', multipleSet\n .filter(function(s) {return !s.hidden})\n .map(function(s) {\n var row = makeElement('tr');\n row.appendChild(makeElement('td', s.name || s.blob.name));\n var typeContent;\n if (s.error) {\n typeContent = makeElement('span', 'Error', null, {color: 'red'});\n } else if (s.tier_type) {\n typeContent = s.payload || s.tier_type;\n } else {\n typeContent = thisB.makeLoader(16);\n }\n\n var ccs;\n var state = 'unknown';\n if (s.tier_type == 'bwg' || s.tier_type == 'memstore') {\n state = 'okay';\n } else if (s.tier_type == 'bam') {\n state = s.indexBlob ? 'okay' : 'needs-index';\n } else if (s.tier_type == 'tabix') {\n state = s.indexBlob ? 'okay' : 'needs-index';\n }\n\n if (state == 'okay') {\n ccs = makeElement('select', null, null, {width: '150px'});\n ccs.appendChild(makeElement('option', thisB.nameForCoordSystem(thisB.coordSystem), {value: '__default__'}));\n if (thisB.chains) {\n for (var csk in thisB.chains) {\n var cs = thisB.chains[csk].coords;\n ccs.appendChild(makeElement('option', thisB.nameForCoordSystem(cs), {value: csk}));\n }\n }\n ccs.value = s.mapping || '__default__';\n\n ccs.addEventListener('change', function(ev) {\n s.mapping = ccs.value;\n console.log(s);\n }, false);\n } else if (state == 'needs-index') {\n ccs = makeElement('span', 'Needs index', {}, {color: 'red'});\n needsIndex = true;\n }\n\n return makeElement('tr', [makeElement('td', s.name || s.blob.name),\n makeElement('td', typeContent),\n makeElement('td', ccs)]);\n\n }), {className: 'table table-striped table-condensed'});\n stabHolder.appendChild(multTable);\n\n if (needsIndex) {\n stabHolder.appendChild(makeElement('p', 'Some of these files are missing required index (.bai or .tbi) files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate index file'));\n stabHolder.appendChild(document.createTextNode('Index file(s): '));\n var indexFile = makeElement('input', null, {type: 'file', multiple: 'multiple'});\n stabHolder.appendChild(indexFile);\n indexFile.addEventListener('change', function(ev) {\n console.log('fileset changed');\n var fileList = indexFile.files || [];\n for (var fi = 0; fi < fileList.length; ++fi) {\n var f = fileList[fi];\n if (f) {\n var ns = {blob: f, hidden: true};\n multipleSet.push(ns);\n probeMultiple(ns);\n }\n }\n }, false);\n }\n }\n\n var canButton = makeElement('button', 'Cancel', {className: 'btn'});\n canButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n if (customMode === 'finalize-bin')\n switchToBinMode();\n else\n switchToCustomMode();\n }, false);\n\n var refreshButton = makeElement('button', 'Refresh', {className: 'btn'});\n refreshButton.addEventListener('click', function(ev) {\n ev.stopPropagation(); ev.preventDefault();\n thisB.queryRegistry(__mapping);\n }, false);\n this.makeTooltip(refreshButton, 'Click to re-fetch data from the DAS registry');\n\n var buttonHolder = makeElement('div', [addButton, ' ', canButton, ' ', refreshButton]);\n buttonHolder.style.margin = '10px';\n asform.appendChild(buttonHolder);\n\n popup.appendChild(asform);\n makeStab(thisB.availableSources);\n\n this.showToolPanel(popup);\n this.setUiMode('add');\n\n if (firstDefButton) {\n activateButton(addModeButtons, firstDefButton);\n makeStab(new Observed(firstDefSources));\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// trix.js: UCSC-style free text indices\n//\n\n\"use strict\";\n\nfunction connectTrix(ix, ixx, callback) {\n ixx.fetchAsText(function(ixxData) {\n if (!ixxData) \n return callback(null, \"Couldn't fetch index-index\");\n\n var toks = ixxData.split(/(.+)([0-9A-F]{10})\\n/);\n\n var keys = [];\n var offsets = [];\n for (var ti = 1; ti < toks.length; ti += 3) {\n keys.push(toks[ti]);\n offsets.push(parseInt(toks[ti+1], 16));\n }\n\n return callback(new TrixIndex(keys, offsets, ix));\n });\n}\n\nfunction TrixIndex(keys, offsets, ix) {\n this.keys = keys;\n this.offsets = offsets;\n this.ix = ix;\n}\n\nTrixIndex.prototype.lookup = function(query, callback) {\n var ixslice;\n\n var qtag = (query + ' ').substring(0,5).toLowerCase();\n for (var i = 0; i < this.keys.length; ++i) {\n if (qtag.localeCompare(this.keys[i]) < 0) {\n ixslice = this.ix.slice(this.offsets[i - 1], this.offsets[i] - this.offsets[i - 1]);\n break;\n }\n }\n\n if (!ixslice) {\n ixslice = this.ix.slice(this.offsets[this.offsets.length - 1]);\n }\n\n ixslice.fetchAsText(function(ist) {\n var lines = ist.split('\\n');\n for (var li = 0; li < lines.length; ++li) {\n if (lines[li].indexOf(query.toLowerCase() + ' ') == 0) {\n return callback(lines[li].split(' '));\n }\n }\n return callback(null);\n });\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n connectTrix: connectTrix\n };\n}","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// twoBit.js: packed-binary reference sequences\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var bin = require('./bin');\n var readInt = bin.readInt;\n var readIntBE = bin.readIntBE;\n\n var spans = require('./spans');\n var Range = spans.Range;\n var union = spans.union;\n var intersection = spans.intersection;\n}\n\nvar TWOBIT_MAGIC = 0x1a412743;\nvar TWOBIT_MAGIC_BE = 0x4327411a;\nvar HEADER_BLOCK_SIZE = 12500;\n\nfunction TwoBitFile() {\n}\n\nfunction makeTwoBit(fetchable, cnt) {\n var tb = new TwoBitFile();\n tb.data = fetchable;\n var headerBlockSize = HEADER_BLOCK_SIZE;\n var headerBlocksFetched=0;\n \n tb.data.slice(0, headerBlockSize).fetch(function(r) {\n if (!r) {\n return cnt(null, \"Couldn't access data\");\n }\n var ba = new Uint8Array(r);\n var magic = readInt(ba, 0);\n if (magic == TWOBIT_MAGIC) {\n tb.readInt = readInt;\n } else if (magic == TWOBIT_MAGIC_BE) {\n tb.readInt = readIntBE;\n } else {\n return cnt(null, \"Not a .2bit file, magic=0x\" + magic.toString(16));\n }\n\n var version = tb.readInt(ba, 4);\n if (version != 0) {\n return cnt(null, 'Unsupported version ' + version);\n }\n\n tb.seqCount = tb.readInt(ba, 8);\n tb.seqDict = {};\n\n var p = 16, i=0;\n var o = 0; // Offset of the current block if we need to fetch multiple header blocks.\n\n var parseSeqInfo = function() {\n while (i < tb.seqCount) {\n var ns = ba[p];\n if (p + ns + 6 >= ba.length) {\n headerBlocksFetched += headerBlockSize;\n headerBlockSize = Math.max(HEADER_BLOCK_SIZE,Math.floor(headerBlocksFetched*tb.seqCount/i));\n return tb.data.slice(o + p, headerBlockSize).fetch(function (r) {\n o += p;\n p = 0;\n ba = new Uint8Array(r);\n parseSeqInfo();\n });\n } else {\n ++p;\n var name = '';\n for (var j = 1; j <= ns; ++j) {\n name += String.fromCharCode(ba[p++]);\n }\n var offset = tb.readInt(ba, p);\n p += 4;\n tb.seqDict[name] = new TwoBitSeq(tb, offset);\n ++i;\n }\n }\n return cnt(tb);\n }\n\n parseSeqInfo();\n \n });\n}\n\nTwoBitFile.prototype.getSeq = function(chr) {\n var seq = this.seqDict[chr];\n if (!seq) {\n seq = this.seqDict['chr' + chr];\n }\n return seq;\n}\n\nTwoBitFile.prototype.fetch = function(chr, min, max, cnt) {\n var seq = this.getSeq(chr);\n if (!seq) {\n return cnt(null, \"Couldn't find \" + chr);\n } else if (max <= min) {\n return cnt('');\n } else {\n seq.fetch(min, max, cnt);\n }\n}\n\nfunction TwoBitSeq(tbf, offset) {\n this.tbf = tbf;\n this.offset = offset;\n}\n\nTwoBitSeq.prototype.init = function(cnt) {\n if (this.seqOffset) {\n return cnt();\n }\n\n var thisB = this;\n thisB.tbf.data.slice(thisB.offset, 8).fetch(function(r1) {\n if (!r1) {\n return cnt('Fetch failed');\n }\n var ba = new Uint8Array(r1);\n thisB._length = thisB.tbf.readInt(ba, 0);\n thisB.nBlockCnt = thisB.tbf.readInt(ba, 4);\n thisB.tbf.data.slice(thisB.offset + 8, thisB.nBlockCnt*8 + 4).fetch(function(r2) {\n if (!r2) {\n return cnt('Fetch failed');\n }\n var ba = new Uint8Array(r2);\n var nbs = null;\n for (var b = 0; b < thisB.nBlockCnt; ++b) {\n var nbMin = thisB.tbf.readInt(ba, b * 4);\n var nbLen = thisB.tbf.readInt(ba, (b + thisB.nBlockCnt) * 4);\n var nb = new Range(nbMin, nbMin + nbLen - 1);\n if (!nbs) {\n nbs = nb;\n } else {\n nbs = union(nbs, nb);\n }\n }\n thisB.nBlocks = nbs;\n thisB.mBlockCnt = thisB.tbf.readInt(ba, thisB.nBlockCnt*8);\n thisB.seqLength = ((thisB._length + 3)/4)|0;\n thisB.seqOffset = thisB.offset + 16 + ((thisB.nBlockCnt + thisB.mBlockCnt) * 8);\n return cnt();\n });\n });\n}\n\nvar TWOBIT_TABLE = ['T', 'C', 'A', 'G'];\n\nTwoBitSeq.prototype.fetch = function(min, max, cnt) {\n --min; --max; // Switch to zero-based.\n var thisB = this;\n this.init(function(error) {\n if (error) {\n return cnt(null, error);\n }\n\n var fetchMin = min >> 2;\n var fetchMax = max + 3 >> 2;\n if (fetchMin < 0 || fetchMax > thisB.seqLength) {\n return cnt('Coordinates out of bounds: ' + min + ':' + max);\n }\n\n thisB.tbf.data.slice(thisB.seqOffset + fetchMin, fetchMax - fetchMin).salted().fetch(function(r) {\n if (r == null) {\n return cnt('SeqFetch failed');\n }\n var seqData = new Uint8Array(r);\n\n var nSpans = [];\n if (thisB.nBlocks) {\n var intr = intersection(new Range(min, max), thisB.nBlocks);\n if (intr) {\n nSpans = intr.ranges();\n }\n }\n \n var seqstr = '';\n var ptr = min;\n function fillSeq(fsm) {\n while (ptr <= fsm) {\n var bb = (ptr >> 2) - fetchMin;\n var ni = ptr & 0x3;\n var bv = seqData[bb];\n var n;\n if (ni == 0) {\n n = (bv >> 6) & 0x3;\n } else if (ni == 1) {\n n = (bv >> 4) & 0x3;\n } else if (ni == 2) {\n n = (bv >> 2) & 0x3;\n } else {\n n = (bv) & 0x3;\n }\n seqstr += TWOBIT_TABLE[n];\n ++ptr;\n }\n }\n \n for (var b = 0; b < nSpans.length; ++b) {\n var nb = nSpans[b];\n if (ptr > nb.min()) {\n throw 'N mismatch...';\n }\n if (ptr < nb.min()) {\n fillSeq(nb.min() - 1);\n }\n while (ptr <= nb.max()) {\n seqstr += 'N';\n ++ptr;\n }\n }\n if (ptr <= max) {\n fillSeq(max);\n }\n return cnt(seqstr);\n });\n });\n}\n\nTwoBitSeq.prototype.length = function(cnt) {\n var thisB = this;\n this.init(function(error) {\n if (error) {\n return cnt(null, error);\n } else {\n return cnt(thisB._length);\n }\n });\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n makeTwoBit: makeTwoBit\n };\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// utils.js: odds, sods, and ends.\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sha1 = require('./sha1');\n var b64_sha1 = sha1.b64_sha1;\n}\n\nvar NUM_REGEXP = new RegExp('[0-9]+');\n\nfunction stringToNumbersArray(str) {\n var nums = new Array();\n var m;\n while (m = NUM_REGEXP.exec(str)) {\n nums.push(m[0]);\n str=str.substring(m.index + (m[0].length));\n }\n return nums;\n}\n\nvar STRICT_NUM_REGEXP = new RegExp('^[0-9]+$');\n\nfunction stringToInt(str) {\n str = str.replace(new RegExp(',', 'g'), '');\n if (!STRICT_NUM_REGEXP.test(str)) {\n return null;\n }\n return str|0;\n}\n\nfunction pushnew(a, v) {\n for (var i = 0; i < a.length; ++i) {\n if (a[i] == v) {\n return;\n }\n }\n a.push(v);\n}\n\nfunction pusho(obj, k, v) {\n if (obj[k]) {\n obj[k].push(v);\n } else {\n obj[k] = [v];\n }\n}\n\nfunction pushnewo(obj, k, v) {\n var a = obj[k];\n if (a) {\n for (var i = 0; i < a.length; ++i) { // indexOf requires JS16 :-(.\n if (a[i] == v) {\n return;\n }\n }\n a.push(v);\n } else {\n obj[k] = [v];\n }\n}\n\n\nfunction pick(a, b, c, d)\n{\n if (a) {\n return a;\n } else if (b) {\n return b;\n } else if (c) {\n return c;\n } else if (d) {\n return d;\n }\n}\n\nfunction pushnew(l, o)\n{\n for (var i = 0; i < l.length; ++i) {\n if (l[i] == o) {\n return;\n }\n }\n l.push(o);\n}\n\n\n\nfunction arrayIndexOf(a, x) {\n if (!a) {\n return -1;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] === x) {\n return i;\n }\n }\n return -1;\n}\n\nfunction arrayRemove(a, x) {\n var i = arrayIndexOf(a, x);\n if (i >= 0) {\n a.splice(i, 1);\n return true;\n }\n return false;\n}\n\n//\n// DOM utilities\n//\n\n\nfunction makeElement(tag, children, attribs, styles)\n{\n var ele = document.createElement(tag);\n if (children) {\n if (! (children instanceof Array)) {\n children = [children];\n }\n for (var i = 0; i < children.length; ++i) {\n var c = children[i];\n if (c) {\n if (typeof c == 'string') {\n c = document.createTextNode(c);\n } else if (typeof c == 'number') {\n c = document.createTextNode('' + c);\n }\n ele.appendChild(c);\n }\n }\n }\n \n if (attribs) {\n for (var l in attribs) {\n try {\n ele[l] = attribs[l];\n } catch (e) {\n console.log('error setting ' + l);\n throw(e);\n }\n }\n }\n if (styles) {\n for (var l in styles) {\n ele.style[l] = styles[l];\n }\n }\n return ele;\n}\n\nfunction makeElementNS(namespace, tag, children, attribs)\n{\n var ele = document.createElementNS(namespace, tag);\n if (children) {\n if (! (children instanceof Array)) {\n children = [children];\n }\n for (var i = 0; i < children.length; ++i) {\n var c = children[i];\n if (typeof c == 'string') {\n c = document.createTextNode(c);\n }\n ele.appendChild(c);\n }\n }\n \n setAttrs(ele, attribs);\n return ele;\n}\n\nvar attr_name_cache = {};\n\nfunction setAttr(node, key, value)\n{\n var attr = attr_name_cache[key];\n if (!attr) {\n var _attr = '';\n for (var c = 0; c < key.length; ++c) {\n var cc = key.substring(c, c+1);\n var lcc = cc.toLowerCase();\n if (lcc != cc) {\n _attr = _attr + '-' + lcc;\n } else {\n _attr = _attr + cc;\n }\n }\n attr_name_cache[key] = _attr;\n attr = _attr;\n }\n node.setAttribute(attr, value);\n}\n\nfunction setAttrs(node, attribs)\n{\n if (attribs) {\n for (var l in attribs) {\n setAttr(node, l, attribs[l]);\n }\n }\n}\n\n\n\nfunction removeChildren(node)\n{\n if (!node || !node.childNodes) {\n return;\n }\n\n while (node.childNodes.length > 0) {\n node.removeChild(node.firstChild);\n }\n}\n\n\n\n//\n// WARNING: not for general use!\n//\n\nfunction miniJSONify(o, exc) {\n if (typeof o === 'undefined') {\n return 'undefined';\n } else if (o == null) {\n return 'null';\n } else if (typeof o == 'string') {\n return \"'\" + o + \"'\";\n } else if (typeof o == 'number') {\n return \"\" + o;\n } else if (typeof o == 'boolean') {\n return \"\" + o;\n } else if (typeof o == 'object') {\n if (o instanceof Array) {\n var s = null;\n for (var i = 0; i < o.length; ++i) {\n s = (s == null ? '' : (s + ', ')) + miniJSONify(o[i], exc);\n }\n return '[' + (s?s:'') + ']';\n } else {\n exc = exc || {};\n var s = null;\n for (var k in o) {\n if (exc[k])\n continue;\n if (k != undefined && typeof(o[k]) != 'function') {\n s = (s == null ? '' : (s + ', ')) + k + ': ' + miniJSONify(o[k], exc);\n }\n }\n return '{' + (s?s:'') + '}';\n }\n } else {\n return (typeof o);\n }\n}\n\nfunction shallowCopy(o) {\n var n = {};\n for (var k in o) {\n n[k] = o[k];\n }\n return n;\n}\n\nfunction Observed(x) {\n this.value = x;\n this.listeners = [];\n}\n\nObserved.prototype.addListener = function(f) {\n this.listeners.push(f);\n}\n\nObserved.prototype.addListenerAndFire = function(f) {\n this.listeners.push(f);\n f(this.value);\n}\n\nObserved.prototype.removeListener = function(f) {\n arrayRemove(this.listeners, f);\n}\n\nObserved.prototype.get = function() {\n return this.value;\n}\n\nObserved.prototype.set = function(x) {\n this.value = x;\n for (var i = 0; i < this.listeners.length; ++i) {\n this.listeners[i](x);\n }\n}\n\nfunction Awaited() {\n this.queue = [];\n}\n\nAwaited.prototype.provide = function(x) {\n if (this.res !== undefined) {\n throw \"Resource has already been provided.\";\n }\n\n this.res = x;\n for (var i = 0; i < this.queue.length; ++i) {\n this.queue[i](x);\n }\n this.queue = null; // avoid leaking closures.\n}\n\nAwaited.prototype.await = function(f) {\n if (this.res !== undefined) {\n f(this.res);\n return this.res;\n } else {\n this.queue.push(f);\n }\n}\n\nvar __dalliance_saltSeed = 0;\n\nfunction saltURL(url) {\n return url + '?salt=' + b64_sha1('' + Date.now() + ',' + (++__dalliance_saltSeed));\n}\n\nfunction textXHR(url, callback, opts) {\n if (opts && opts.salt) \n url = saltURL(url);\n\n try {\n var timeout;\n if (opts && opts.timeout) {\n timeout = setTimeout(\n function() {\n console.log('timing out ' + url);\n req.abort();\n return callback(null, 'Timeout');\n },\n opts.timeout\n );\n }\n\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n \t if (req.readyState == 4) {\n if (timeout)\n clearTimeout(timeout);\n \t if (req.status < 200 || req.status >= 300) {\n \t\t callback(null, 'Error code ' + req.status);\n \t } else {\n \t\t callback(req.responseText);\n \t }\n \t }\n };\n \n req.open('GET', url, true);\n req.responseType = 'text';\n\n if (opts && opts.credentials) {\n req.withCredentials = true;\n }\n req.send();\n } catch (e) {\n callback(null, 'Exception ' + e);\n }\n}\n\nfunction relativeURL(base, rel) {\n // FIXME quite naive -- good enough for trackhubs?\n\n if (rel.indexOf('http:') == 0 || rel.indexOf('https:') == 0) {\n return rel;\n }\n\n var li = base.lastIndexOf('/');\n if (li >= 0) {\n return base.substr(0, li + 1) + rel;\n } else {\n return rel;\n }\n}\n\nvar AMINO_ACID_TRANSLATION = {\n 'TTT': 'F',\n 'TTC': 'F',\n 'TTA': 'L',\n 'TTG': 'L',\n 'CTT': 'L',\n 'CTC': 'L',\n 'CTA': 'L',\n 'CTG': 'L',\n 'ATT': 'I',\n 'ATC': 'I',\n 'ATA': 'I',\n 'ATG': 'M',\n 'GTT': 'V',\n 'GTC': 'V',\n 'GTA': 'V',\n 'GTG': 'V',\n 'TCT': 'S',\n 'TCC': 'S',\n 'TCA': 'S',\n 'TCG': 'S',\n 'CCT': 'P',\n 'CCC': 'P',\n 'CCA': 'P',\n 'CCG': 'P',\n 'ACT': 'T',\n 'ACC': 'T',\n 'ACA': 'T',\n 'ACG': 'T',\n 'GCT': 'A',\n 'GCC': 'A',\n 'GCA': 'A',\n 'GCG': 'A',\n 'TAT': 'Y',\n 'TAC': 'Y',\n 'TAA': '*', // stop\n 'TAG': '*', // stop\n 'CAT': 'H',\n 'CAC': 'H',\n 'CAA': 'Q',\n 'CAG': 'Q',\n 'AAT': 'N',\n 'AAC': 'N',\n 'AAA': 'K',\n 'AAG': 'K',\n 'GAT': 'D',\n 'GAC': 'D',\n 'GAA': 'E',\n 'GAG': 'E',\n 'TGT': 'C',\n 'TGC': 'C',\n 'TGA': '*', // stop\n 'TGG': 'W',\n 'CGT': 'R',\n 'CGC': 'R',\n 'CGA': 'R',\n 'CGG': 'R',\n 'AGT': 'S',\n 'AGC': 'S',\n 'AGA': 'R',\n 'AGG': 'R',\n 'GGT': 'G',\n 'GGC': 'G',\n 'GGA': 'G',\n 'GGG': 'G'\n}\n\nfunction resolveUrlToPage(rel) {\n return makeElement('a', null, {href: rel}).href;\n}\n\n//\n// Missing APIs\n// \n\nif (!('trim' in String.prototype)) {\n String.prototype.trim = function() {\n return this.replace(/^\\s+/, '').replace(/\\s+$/, '');\n };\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n textXHR: textXHR,\n relativeURL: relativeURL,\n resolveUrlToPage: resolveUrlToPage,\n shallowCopy: shallowCopy,\n pusho: pusho,\n pushnew: pushnew,\n pushnewo: pushnewo,\n arrayIndexOf: arrayIndexOf,\n pick: pick,\n\n makeElement: makeElement,\n makeElementNS: makeElementNS,\n removeChildren: removeChildren,\n\n miniJSONify: miniJSONify,\n\n Observed: Observed,\n Awaited: Awaited,\n\n AMINO_ACID_TRANSLATION: AMINO_ACID_TRANSLATION\n }\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// vcf.js\n//\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var sa = require('./sourceadapters');\n var dalliance_registerParserFactory = sa.registerParserFactory;\n\n var das = require('./das');\n var DASStylesheet = das.DASStylesheet;\n var DASStyle = das.DASStyle;\n var DASFeature = das.DASFeature;\n var DASGroup = das.DASGroup;\n}\n\nfunction VCFParser() {\n this.info = [];\n}\n\nvar VCF_INFO_RE = /([^;=]+)(=([^;]+))?;?/;\nvar VCF_INFO_HEADER = /##INFO=<([^>]+)>/;\nvar VCF_INFO_HEADER_TOK = /([^,=]+)=([^,]+|\"[^\"]+\"),?/\n\nVCFParser.prototype.createSession = function(sink) {\n return new VCFParseSession(this, sink);\n}\n\nfunction VCFParseSession(parser, sink) {\n this.parser = parser;\n this.sink = sink;\n}\n\nVCFParseSession.prototype.parse = function(line) {\n if (line.length == 0)\n return;\n if (line[0] == '#') {\n if (line.length > 1 && line[1] == '#') {\n var m = VCF_INFO_HEADER.exec(line);\n if (m) {\n var toks = m[1].split(VCF_INFO_HEADER_TOK);\n var id = null, desc = null;\n for (var ti = 0; ti < toks.length - 1; ti += 3) {\n var key = toks[ti + 1];\n var value = toks[ti + 2].replace(/\"/g, '');\n if (key == 'ID') {\n id = value;\n } else if (key == 'Description') {\n desc = value;\n }\n }\n if (id && desc) {\n this.parser.info.push(\n {id: id,\n desc: desc}\n );\n }\n }\n return;\n } else {\n return;\n }\n }\n\n var toks = line.split('\\t');\n var f = new DASFeature();\n f.segment = toks[0];\n f.id = toks[2]\n f.refAllele = toks[3];\n f.altAlleles = toks[4].split(',');\n f.min = parseInt(toks[1]);\n f.max = f.min + f.refAllele.length - 1;\n\n var infoToks = toks[7].split(VCF_INFO_RE);\n f.info = {};\n for (var ti = 0; ti < infoToks.length; ti += 4) {\n f.info[infoToks[ti + 1]] = infoToks[ti + 3];\n }\n\n\n var alt = f.altAlleles[0];\n var ref = f.refAllele;\n if (alt.length > ref.length) {\n f.type = \"insertion\";\n if (alt.indexOf(ref) == 0) {\n f.insertion = alt.substr(ref.length);\n f.min += ref.length;\n f.max = f.min - 1; // Effectively \"between\" bases.\n } else {\n f.insertion = alt;\n }\n } else if (alt.length < ref.length) {\n f.type = \"deletion\";\n } else {\n f.type = 'substitution';\n }\n\n this.sink(f);\n}\n\nVCFParseSession.prototype.flush = function() {};\n\nVCFParser.prototype.getStyleSheet = function(callback) {\n var stylesheet = new DASStylesheet();\n\n {\n var varStyle = new DASStyle();\n varStyle.glyph = '__INSERTION';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(50,80,255)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({type: 'insertion'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(255, 60, 60)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({type: 'deletion'}, null, varStyle);\n }\n {\n var varStyle = new DASStyle();\n varStyle.glyph = 'PLIMSOLL';\n varStyle.BUMP = 'yes';\n varStyle.LABEL = 'no';\n varStyle.FGCOLOR = 'rgb(50,80,255)';\n varStyle.BGCOLOR = '#888888';\n varStyle.STROKECOLOR = 'black';\n stylesheet.pushStyle({type: 'default'}, null, varStyle);\n }\n\n return callback(stylesheet);\n}\n\nVCFParser.prototype.getDefaultFIPs = function(callback) {\n var self = this;\n var fip = function(feature, featureInfo) {\n featureInfo.add(\"Ref. allele\", feature.refAllele);\n featureInfo.add(\"Alt. alleles\", feature.altAlleles.join(','));\n\n if (feature.info) {\n for (var ii = 0; ii < self.info.length; ++ii) {\n var info = self.info[ii];\n var val = feature.info[info.id];\n if (val !== undefined) {\n featureInfo.add(info.desc, val);\n }\n }\n }\n };\n callback(fip);\n}\n\ndalliance_registerParserFactory('vcf', function() {return new VCFParser()});\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2010\n//\n// version.js\n//\n\n\"use strict\";\n\nvar VERSION = {\n CONFIG: 5,\n MAJOR: 0,\n MINOR: 13,\n MICRO: 7,\n BRANCH: 'MOLGENIS'\n};\n\nVERSION.toString = function() {\n var vs = '' + this.MAJOR + '.' + this.MINOR + '.' + this.MICRO;\n if (this.PATCH) {\n vs = vs + this.PATCH;\n }\n if (this.BRANCH && this.BRANCH != '') {\n vs = vs + '-' + this.BRANCH;\n }\n return vs;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = VERSION;\n}\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Dalliance Genome Explorer\n// (c) Thomas Down 2006-2014\n//\n// zoomslider.js: custom slider component\n//\n\n\n\"use strict\";\n\nif (typeof(require) !== 'undefined') {\n var utils = require('./utils');\n var makeElement = utils.makeElement;\n}\n\nfunction makeZoomSlider(opts) {\n opts = opts || {};\n \n var minPos = 0, maxPos = opts.width || 200;\n var min = 0, max = 200;\n var pos = 50, pos2 = 100;\n var labels = [];\n var track = makeElement('hr', null, {className: 'slider-track'}, {width: '' + (maxPos|0) + 'px'});\n var thumb = makeElement('hr', null, {className: 'slider-thumb active'});\n var thumb2 = makeElement('hr', null, {className: 'slider-thumb'});\n var slider = makeElement('div', [track, thumb, thumb2], {className: 'slider'}, {width: '' + ((maxPos|0) + 10) + 'px'});\n\n slider.removeLabels = function() {\n for (var li = 0; li < labels.length; ++li) {\n slider.removeChild(labels[li]);\n }\n labels = [];\n }\n\n slider.addLabel = function(val, txt) {\n var pos = (minPos + ((val - min) * (maxPos - minPos))/(max-min))|0;\n var label = makeElement('div', txt, {className: 'slider-label'}, {\n left: '' + ((minPos + ((val - min) * (maxPos - minPos))/(max-min))|0) + 'px'\n });\n slider.appendChild(label);\n labels.push(label);\n }\n\n var onChange = document.createEvent('HTMLEvents');\n onChange.initEvent('change', true, false);\n\n function setPos(np) {\n np = Math.min(np, maxPos);\n np = Math.max(np, minPos);\n pos = np;\n thumb.style.left = '' + pos + 'px';\n }\n\n function setPos2(np) {\n np = Math.min(np, maxPos);\n np = Math.max(np, minPos);\n pos2 = np;\n thumb2.style.left = '' + pos2 + 'px';\n }\n\n Object.defineProperty(slider, 'value', {\n get: function() {return min + (((pos-minPos) * (max-min)) / (maxPos - minPos));},\n set: function(v) {\n var np = minPos + ((v-min) * (maxPos-minPos))/(max-min);\n setPos(np);\n }\n });\n\n Object.defineProperty(slider, 'value2', {\n get: function() {return min + (((pos2-minPos) * (max-min)) / (maxPos - minPos));},\n set: function(v) {\n var np = minPos + ((v-min) * (maxPos-minPos))/(max-min);\n setPos2(np);\n }\n });\n\n Object.defineProperty(slider, 'active', {\n get: function() {return thumb.classList.contains('active') ? 1 : 2},\n set: function(x) {\n if (x == 1) {\n thumb.classList.add('active');\n thumb2.classList.remove('active');\n } else {\n thumb2.classList.add('active');\n thumb.classList.remove('active');\n }\n }\n });\n\n Object.defineProperty(slider, 'min', {\n get: function() {return min},\n set: function(v) {min = v}\n });\n\n Object.defineProperty(slider, 'max', {\n get: function() {return max},\n set: function(v) {max = v}\n });\n\n var offset;\n var which;\n\n var thumbMouseDown = function(ev) {\n which = this == thumb ? 1 : 2;\n if (which != slider.active) {\n slider.active = which;\n slider.dispatchEvent(onChange);\n }\n ev.stopPropagation(); ev.preventDefault();\n window.addEventListener('mousemove', thumbDragHandler, false);\n window.addEventListener('mouseup', thumbDragEndHandler, false);\n offset = ev.clientX - (which == 1 ? pos : pos2);\n };\n\n thumb.addEventListener('mousedown', thumbMouseDown, false);\n thumb2.addEventListener('mousedown', thumbMouseDown, false);\n\n var thumbDragHandler = function(ev) {\n if (which == 1)\n setPos(ev.clientX - offset);\n else\n setPos2(ev.clientX - offset);\n slider.dispatchEvent(onChange);\n };\n\n var thumbDragEndHandler = function(ev) {\n window.removeEventListener('mousemove', thumbDragHandler, false);\n window.removeEventListener('mouseup', thumbDragEndHandler, false);\n }\n\n return slider;\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = makeZoomSlider;\n}\n","\"use strict\";\n\nrequire(\"core-js/shim\");\n\nrequire(\"regenerator-runtime/runtime\");\n\nrequire(\"core-js/fn/regexp/escape\");\n\nif (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = \"defineProperty\";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, \"padLeft\", \"\".padStart);\ndefine(String.prototype, \"padRight\", \"\".padEnd);\n\n\"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\".split(\",\").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});","require('../../modules/core.regexp.escape');\nmodule.exports = require('../../modules/_core').RegExp.escape;\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n","'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = false;\n","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n","// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var Map = require('./es6.map');\nvar $export = require('./_export');\nvar shared = require('./_shared')('metadata');\nvar store = shared.store || (shared.store = new (require('./es6.weak-map'))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if (Observer) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","'use strict';\n// Forced replacement prototype accessors methods\nmodule.exports = require('./_library') || !require('./_fails')(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete require('./_global')[K];\n});\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","var getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n","var $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","var $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n","module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// https://github.com/benjamingr/RexExp.escape\nvar $export = require('./_export');\nvar $re = require('./_replacer')(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n","'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n","'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n","// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('./_set-species')('Array');\n","// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n","// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n","var TO_PRIMITIVE = require('./_wks')('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));\n","var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n require('./_redefine')(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n","// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n","'use strict';\nvar isObject = require('./_is-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar HAS_INSTANCE = require('./_wks')('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n","// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n","// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n","// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n","// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n","// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n","// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n","// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n","// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n","// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n","// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n","// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n","'use strict';\nvar global = require('./_global');\nvar has = require('./_has');\nvar cof = require('./_cof');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar toPrimitive = require('./_to-primitive');\nvar fails = require('./_fails');\nvar gOPN = require('./_object-gopn').f;\nvar gOPD = require('./_object-gopd').f;\nvar dP = require('./_object-dp').f;\nvar $trim = require('./_string-trim').trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = require('./_descriptors') ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n require('./_redefine')(global, NUMBER, $Number);\n}\n","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n","'use strict';\nvar $export = require('./_export');\nvar toInteger = require('./_to-integer');\nvar aNumberValue = require('./_a-number-value');\nvar repeat = require('./_string-repeat');\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !require('./_fails')(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $fails = require('./_fails');\nvar aNumberValue = require('./_a-number-value');\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value);\n if (domain) domain.exit();\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n if (promise._h == 1) return false;\n var chain = promise._a || promise._c;\n var i = 0;\n var reaction;\n while (chain.length > i) {\n reaction = chain[i++];\n if (reaction.fail || !isUnhandled(reaction.promise)) return false;\n } return true;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n","'use strict';\n// 26.1.5 Reflect.enumerate(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\nrequire('./_iter-create')(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n","// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n","// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n","// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n","// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n","var global = require('./_global');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar dP = require('./_object-dp').f;\nvar gOPN = require('./_object-gopn').f;\nvar isRegExp = require('./_is-regexp');\nvar $flags = require('./_flags');\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () {\n re2[require('./_wks')('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n require('./_redefine')(global, 'RegExp', $RegExp);\n}\n\nrequire('./_set-species')('RegExp');\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","'use strict';\n// B.2.3.2 String.prototype.anchor(name)\nrequire('./_string-html')('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n","'use strict';\n// B.2.3.3 String.prototype.big()\nrequire('./_string-html')('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n","'use strict';\n// B.2.3.4 String.prototype.blink()\nrequire('./_string-html')('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n","'use strict';\n// B.2.3.5 String.prototype.bold()\nrequire('./_string-html')('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","'use strict';\n// B.2.3.6 String.prototype.fixed()\nrequire('./_string-html')('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n","'use strict';\n// B.2.3.7 String.prototype.fontcolor(color)\nrequire('./_string-html')('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n","'use strict';\n// B.2.3.8 String.prototype.fontsize(size)\nrequire('./_string-html')('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\n// B.2.3.9 String.prototype.italics()\nrequire('./_string-html')('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// B.2.3.10 String.prototype.link(url)\nrequire('./_string-html')('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n","'use strict';\n// B.2.3.11 String.prototype.small()\nrequire('./_string-html')('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","'use strict';\n// B.2.3.12 String.prototype.strike()\nrequire('./_string-html')('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n","'use strict';\n// B.2.3.13 String.prototype.sub()\nrequire('./_string-html')('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n","'use strict';\n// B.2.3.14 String.prototype.sup()\nrequire('./_string-html')('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n","'use strict';\n// 21.1.3.25 String.prototype.trim()\nrequire('./_string-trim')('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n replacer = args[1];\n if (typeof replacer == 'function') $replacer = replacer;\n if ($replacer || !isArray(replacer)) replacer = function (key, value) {\n if ($replacer) value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var final = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < final) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n","var $export = require('./_export');\n$export($export.G + $export.W + $export.F * !require('./_typed').ABV, {\n DataView: require('./_typed-buffer').DataView\n});\n","require('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar aFunction = require('./_a-function');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatMap');\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar toInteger = require('./_to-integer');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatten');\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = require('./_export');\nvar microtask = require('./_microtask')();\nvar process = require('./_global').process;\nvar isNode = require('./_cof')(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n","// https://github.com/ljharb/proposal-is-error\nvar $export = require('./_export');\nvar cof = require('./_cof');\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.G, { global: require('./_global') });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\nrequire('./_set-collection-from')('Map');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\nrequire('./_set-collection-of')('Map');\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar scale = require('./_math-scale');\nvar fround = require('./_math-fround');\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { scale: require('./_math-scale') });\n","// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","'use strict';\n// https://github.com/zenparsing/es-observable\nvar $export = require('./_export');\nvar global = require('./_global');\nvar core = require('./_core');\nvar microtask = require('./_microtask')();\nvar OBSERVABLE = require('./_wks')('observable');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar anInstance = require('./_an-instance');\nvar redefineAll = require('./_redefine-all');\nvar hide = require('./_hide');\nvar forOf = require('./_for-of');\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\nrequire('./_set-species')('Observable');\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n","var Set = require('./es6.set');\nvar from = require('./_array-from-iterable');\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var $metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n","'use strict';\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = require('./_export');\nvar $at = require('./_string-at')(true);\n\n$export($export.P, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n","'use strict';\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = require('./_export');\nvar defined = require('./_defined');\nvar toLength = require('./_to-length');\nvar isRegExp = require('./_is-regexp');\nvar getFlags = require('./_flags');\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\nrequire('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.S, 'System', { global: require('./_global') });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\nrequire('./_set-collection-from')('WeakSet');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\nrequire('./_set-collection-of')('WeakSet');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n","// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar navigator = global.navigator;\nvar slice = [].slice;\nvar MSIE = !!navigator && /MSIE .\\./.test(navigator.userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n","require('./modules/es6.symbol');\nrequire('./modules/es6.object.create');\nrequire('./modules/es6.object.define-property');\nrequire('./modules/es6.object.define-properties');\nrequire('./modules/es6.object.get-own-property-descriptor');\nrequire('./modules/es6.object.get-prototype-of');\nrequire('./modules/es6.object.keys');\nrequire('./modules/es6.object.get-own-property-names');\nrequire('./modules/es6.object.freeze');\nrequire('./modules/es6.object.seal');\nrequire('./modules/es6.object.prevent-extensions');\nrequire('./modules/es6.object.is-frozen');\nrequire('./modules/es6.object.is-sealed');\nrequire('./modules/es6.object.is-extensible');\nrequire('./modules/es6.object.assign');\nrequire('./modules/es6.object.is');\nrequire('./modules/es6.object.set-prototype-of');\nrequire('./modules/es6.object.to-string');\nrequire('./modules/es6.function.bind');\nrequire('./modules/es6.function.name');\nrequire('./modules/es6.function.has-instance');\nrequire('./modules/es6.parse-int');\nrequire('./modules/es6.parse-float');\nrequire('./modules/es6.number.constructor');\nrequire('./modules/es6.number.to-fixed');\nrequire('./modules/es6.number.to-precision');\nrequire('./modules/es6.number.epsilon');\nrequire('./modules/es6.number.is-finite');\nrequire('./modules/es6.number.is-integer');\nrequire('./modules/es6.number.is-nan');\nrequire('./modules/es6.number.is-safe-integer');\nrequire('./modules/es6.number.max-safe-integer');\nrequire('./modules/es6.number.min-safe-integer');\nrequire('./modules/es6.number.parse-float');\nrequire('./modules/es6.number.parse-int');\nrequire('./modules/es6.math.acosh');\nrequire('./modules/es6.math.asinh');\nrequire('./modules/es6.math.atanh');\nrequire('./modules/es6.math.cbrt');\nrequire('./modules/es6.math.clz32');\nrequire('./modules/es6.math.cosh');\nrequire('./modules/es6.math.expm1');\nrequire('./modules/es6.math.fround');\nrequire('./modules/es6.math.hypot');\nrequire('./modules/es6.math.imul');\nrequire('./modules/es6.math.log10');\nrequire('./modules/es6.math.log1p');\nrequire('./modules/es6.math.log2');\nrequire('./modules/es6.math.sign');\nrequire('./modules/es6.math.sinh');\nrequire('./modules/es6.math.tanh');\nrequire('./modules/es6.math.trunc');\nrequire('./modules/es6.string.from-code-point');\nrequire('./modules/es6.string.raw');\nrequire('./modules/es6.string.trim');\nrequire('./modules/es6.string.iterator');\nrequire('./modules/es6.string.code-point-at');\nrequire('./modules/es6.string.ends-with');\nrequire('./modules/es6.string.includes');\nrequire('./modules/es6.string.repeat');\nrequire('./modules/es6.string.starts-with');\nrequire('./modules/es6.string.anchor');\nrequire('./modules/es6.string.big');\nrequire('./modules/es6.string.blink');\nrequire('./modules/es6.string.bold');\nrequire('./modules/es6.string.fixed');\nrequire('./modules/es6.string.fontcolor');\nrequire('./modules/es6.string.fontsize');\nrequire('./modules/es6.string.italics');\nrequire('./modules/es6.string.link');\nrequire('./modules/es6.string.small');\nrequire('./modules/es6.string.strike');\nrequire('./modules/es6.string.sub');\nrequire('./modules/es6.string.sup');\nrequire('./modules/es6.date.now');\nrequire('./modules/es6.date.to-json');\nrequire('./modules/es6.date.to-iso-string');\nrequire('./modules/es6.date.to-string');\nrequire('./modules/es6.date.to-primitive');\nrequire('./modules/es6.array.is-array');\nrequire('./modules/es6.array.from');\nrequire('./modules/es6.array.of');\nrequire('./modules/es6.array.join');\nrequire('./modules/es6.array.slice');\nrequire('./modules/es6.array.sort');\nrequire('./modules/es6.array.for-each');\nrequire('./modules/es6.array.map');\nrequire('./modules/es6.array.filter');\nrequire('./modules/es6.array.some');\nrequire('./modules/es6.array.every');\nrequire('./modules/es6.array.reduce');\nrequire('./modules/es6.array.reduce-right');\nrequire('./modules/es6.array.index-of');\nrequire('./modules/es6.array.last-index-of');\nrequire('./modules/es6.array.copy-within');\nrequire('./modules/es6.array.fill');\nrequire('./modules/es6.array.find');\nrequire('./modules/es6.array.find-index');\nrequire('./modules/es6.array.species');\nrequire('./modules/es6.array.iterator');\nrequire('./modules/es6.regexp.constructor');\nrequire('./modules/es6.regexp.to-string');\nrequire('./modules/es6.regexp.flags');\nrequire('./modules/es6.regexp.match');\nrequire('./modules/es6.regexp.replace');\nrequire('./modules/es6.regexp.search');\nrequire('./modules/es6.regexp.split');\nrequire('./modules/es6.promise');\nrequire('./modules/es6.map');\nrequire('./modules/es6.set');\nrequire('./modules/es6.weak-map');\nrequire('./modules/es6.weak-set');\nrequire('./modules/es6.typed.array-buffer');\nrequire('./modules/es6.typed.data-view');\nrequire('./modules/es6.typed.int8-array');\nrequire('./modules/es6.typed.uint8-array');\nrequire('./modules/es6.typed.uint8-clamped-array');\nrequire('./modules/es6.typed.int16-array');\nrequire('./modules/es6.typed.uint16-array');\nrequire('./modules/es6.typed.int32-array');\nrequire('./modules/es6.typed.uint32-array');\nrequire('./modules/es6.typed.float32-array');\nrequire('./modules/es6.typed.float64-array');\nrequire('./modules/es6.reflect.apply');\nrequire('./modules/es6.reflect.construct');\nrequire('./modules/es6.reflect.define-property');\nrequire('./modules/es6.reflect.delete-property');\nrequire('./modules/es6.reflect.enumerate');\nrequire('./modules/es6.reflect.get');\nrequire('./modules/es6.reflect.get-own-property-descriptor');\nrequire('./modules/es6.reflect.get-prototype-of');\nrequire('./modules/es6.reflect.has');\nrequire('./modules/es6.reflect.is-extensible');\nrequire('./modules/es6.reflect.own-keys');\nrequire('./modules/es6.reflect.prevent-extensions');\nrequire('./modules/es6.reflect.set');\nrequire('./modules/es6.reflect.set-prototype-of');\nrequire('./modules/es7.array.includes');\nrequire('./modules/es7.array.flat-map');\nrequire('./modules/es7.array.flatten');\nrequire('./modules/es7.string.at');\nrequire('./modules/es7.string.pad-start');\nrequire('./modules/es7.string.pad-end');\nrequire('./modules/es7.string.trim-left');\nrequire('./modules/es7.string.trim-right');\nrequire('./modules/es7.string.match-all');\nrequire('./modules/es7.symbol.async-iterator');\nrequire('./modules/es7.symbol.observable');\nrequire('./modules/es7.object.get-own-property-descriptors');\nrequire('./modules/es7.object.values');\nrequire('./modules/es7.object.entries');\nrequire('./modules/es7.object.define-getter');\nrequire('./modules/es7.object.define-setter');\nrequire('./modules/es7.object.lookup-getter');\nrequire('./modules/es7.object.lookup-setter');\nrequire('./modules/es7.map.to-json');\nrequire('./modules/es7.set.to-json');\nrequire('./modules/es7.map.of');\nrequire('./modules/es7.set.of');\nrequire('./modules/es7.weak-map.of');\nrequire('./modules/es7.weak-set.of');\nrequire('./modules/es7.map.from');\nrequire('./modules/es7.set.from');\nrequire('./modules/es7.weak-map.from');\nrequire('./modules/es7.weak-set.from');\nrequire('./modules/es7.global');\nrequire('./modules/es7.system.global');\nrequire('./modules/es7.error.is-error');\nrequire('./modules/es7.math.clamp');\nrequire('./modules/es7.math.deg-per-rad');\nrequire('./modules/es7.math.degrees');\nrequire('./modules/es7.math.fscale');\nrequire('./modules/es7.math.iaddh');\nrequire('./modules/es7.math.isubh');\nrequire('./modules/es7.math.imulh');\nrequire('./modules/es7.math.rad-per-deg');\nrequire('./modules/es7.math.radians');\nrequire('./modules/es7.math.scale');\nrequire('./modules/es7.math.umulh');\nrequire('./modules/es7.math.signbit');\nrequire('./modules/es7.promise.finally');\nrequire('./modules/es7.promise.try');\nrequire('./modules/es7.reflect.define-metadata');\nrequire('./modules/es7.reflect.delete-metadata');\nrequire('./modules/es7.reflect.get-metadata');\nrequire('./modules/es7.reflect.get-metadata-keys');\nrequire('./modules/es7.reflect.get-own-metadata');\nrequire('./modules/es7.reflect.get-own-metadata-keys');\nrequire('./modules/es7.reflect.has-metadata');\nrequire('./modules/es7.reflect.has-own-metadata');\nrequire('./modules/es7.reflect.metadata');\nrequire('./modules/es7.asap');\nrequire('./modules/es7.observable');\nrequire('./modules/web.timers');\nrequire('./modules/web.immediate');\nrequire('./modules/web.dom.iterable');\nmodule.exports = require('./modules/_core');\n","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE\n * @version 3.0.2\n */\n\n(function() {\n \"use strict\";\n function lib$es6$promise$utils$$objectOrFunction(x) {\n return typeof x === 'function' || (typeof x === 'object' && x !== null);\n }\n\n function lib$es6$promise$utils$$isFunction(x) {\n return typeof x === 'function';\n }\n\n function lib$es6$promise$utils$$isMaybeThenable(x) {\n return typeof x === 'object' && x !== null;\n }\n\n var lib$es6$promise$utils$$_isArray;\n if (!Array.isArray) {\n lib$es6$promise$utils$$_isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n } else {\n lib$es6$promise$utils$$_isArray = Array.isArray;\n }\n\n var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;\n var lib$es6$promise$asap$$len = 0;\n var lib$es6$promise$asap$$toString = {}.toString;\n var lib$es6$promise$asap$$vertxNext;\n var lib$es6$promise$asap$$customSchedulerFn;\n\n var lib$es6$promise$asap$$asap = function asap(callback, arg) {\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;\n lib$es6$promise$asap$$len += 2;\n if (lib$es6$promise$asap$$len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (lib$es6$promise$asap$$customSchedulerFn) {\n lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);\n } else {\n lib$es6$promise$asap$$scheduleFlush();\n }\n }\n }\n\n function lib$es6$promise$asap$$setScheduler(scheduleFn) {\n lib$es6$promise$asap$$customSchedulerFn = scheduleFn;\n }\n\n function lib$es6$promise$asap$$setAsap(asapFn) {\n lib$es6$promise$asap$$asap = asapFn;\n }\n\n var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined;\n var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};\n var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;\n var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n // test for web worker but not in IE10\n var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&\n typeof importScripts !== 'undefined' &&\n typeof MessageChannel !== 'undefined';\n\n // node\n function lib$es6$promise$asap$$useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function() {\n process.nextTick(lib$es6$promise$asap$$flush);\n };\n }\n\n // vertx\n function lib$es6$promise$asap$$useVertxTimer() {\n return function() {\n lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);\n };\n }\n\n function lib$es6$promise$asap$$useMutationObserver() {\n var iterations = 0;\n var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function() {\n node.data = (iterations = ++iterations % 2);\n };\n }\n\n // web worker\n function lib$es6$promise$asap$$useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = lib$es6$promise$asap$$flush;\n return function () {\n channel.port2.postMessage(0);\n };\n }\n\n function lib$es6$promise$asap$$useSetTimeout() {\n return function() {\n setTimeout(lib$es6$promise$asap$$flush, 1);\n };\n }\n\n var lib$es6$promise$asap$$queue = new Array(1000);\n function lib$es6$promise$asap$$flush() {\n for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) {\n var callback = lib$es6$promise$asap$$queue[i];\n var arg = lib$es6$promise$asap$$queue[i+1];\n\n callback(arg);\n\n lib$es6$promise$asap$$queue[i] = undefined;\n lib$es6$promise$asap$$queue[i+1] = undefined;\n }\n\n lib$es6$promise$asap$$len = 0;\n }\n\n function lib$es6$promise$asap$$attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return lib$es6$promise$asap$$useVertxTimer();\n } catch(e) {\n return lib$es6$promise$asap$$useSetTimeout();\n }\n }\n\n var lib$es6$promise$asap$$scheduleFlush;\n // Decide what async method to use to triggering processing of queued callbacks:\n if (lib$es6$promise$asap$$isNode) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();\n } else if (lib$es6$promise$asap$$BrowserMutationObserver) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();\n } else if (lib$es6$promise$asap$$isWorker) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();\n } else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();\n } else {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();\n }\n\n function lib$es6$promise$$internal$$noop() {}\n\n var lib$es6$promise$$internal$$PENDING = void 0;\n var lib$es6$promise$$internal$$FULFILLED = 1;\n var lib$es6$promise$$internal$$REJECTED = 2;\n\n var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n }\n\n function lib$es6$promise$$internal$$cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n }\n\n function lib$es6$promise$$internal$$getThen(promise) {\n try {\n return promise.then;\n } catch(error) {\n lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;\n return lib$es6$promise$$internal$$GET_THEN_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch(e) {\n return e;\n }\n }\n\n function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {\n lib$es6$promise$asap$$asap(function(promise) {\n var sealed = false;\n var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) {\n if (sealed) { return; }\n sealed = true;\n if (thenable !== value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }, function(reason) {\n if (sealed) { return; }\n sealed = true;\n\n lib$es6$promise$$internal$$reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n lib$es6$promise$$internal$$reject(promise, error);\n }\n }, promise);\n }\n\n function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {\n if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, thenable._result);\n } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, thenable._result);\n } else {\n lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n }\n }\n\n function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {\n if (maybeThenable.constructor === promise.constructor) {\n lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);\n } else {\n var then = lib$es6$promise$$internal$$getThen(maybeThenable);\n\n if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);\n } else if (then === undefined) {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n } else if (lib$es6$promise$utils$$isFunction(then)) {\n lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n }\n }\n }\n\n function lib$es6$promise$$internal$$resolve(promise, value) {\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());\n } else if (lib$es6$promise$utils$$objectOrFunction(value)) {\n lib$es6$promise$$internal$$handleMaybeThenable(promise, value);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n lib$es6$promise$$internal$$publish(promise);\n }\n\n function lib$es6$promise$$internal$$fulfill(promise, value) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }\n\n promise._result = value;\n promise._state = lib$es6$promise$$internal$$FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);\n }\n }\n\n function lib$es6$promise$$internal$$reject(promise, reason) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }\n promise._state = lib$es6$promise$$internal$$REJECTED;\n promise._result = reason;\n\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);\n }\n\n function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n parent._onerror = null;\n\n subscribers[length] = child;\n subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;\n subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);\n }\n }\n\n function lib$es6$promise$$internal$$publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) { return; }\n\n var child, callback, detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function lib$es6$promise$$internal$$ErrorObject() {\n this.error = null;\n }\n\n var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch(e) {\n lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;\n return lib$es6$promise$$internal$$TRY_CATCH_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {\n var hasCallback = lib$es6$promise$utils$$isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n value = lib$es6$promise$$internal$$tryCatch(callback, detail);\n\n if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());\n return;\n }\n\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== lib$es6$promise$$internal$$PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else if (failed) {\n lib$es6$promise$$internal$$reject(promise, error);\n } else if (settled === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, value);\n } else if (settled === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value){\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function rejectPromise(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n } catch(e) {\n lib$es6$promise$$internal$$reject(promise, e);\n }\n }\n\n function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {\n var enumerator = this;\n\n enumerator._instanceConstructor = Constructor;\n enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop);\n\n if (enumerator._validateInput(input)) {\n enumerator._input = input;\n enumerator.length = input.length;\n enumerator._remaining = input.length;\n\n enumerator._init();\n\n if (enumerator.length === 0) {\n lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);\n } else {\n enumerator.length = enumerator.length || 0;\n enumerator._enumerate();\n if (enumerator._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);\n }\n }\n } else {\n lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());\n }\n }\n\n lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) {\n return lib$es6$promise$utils$$isArray(input);\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() {\n return new Error('Array Methods must be provided an Array');\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._init = function() {\n this._result = new Array(this.length);\n };\n\n var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;\n\n lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() {\n var enumerator = this;\n\n var length = enumerator.length;\n var promise = enumerator.promise;\n var input = enumerator._input;\n\n for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {\n enumerator._eachEntry(input[i], i);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {\n var enumerator = this;\n var c = enumerator._instanceConstructor;\n\n if (lib$es6$promise$utils$$isMaybeThenable(entry)) {\n if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) {\n entry._onerror = null;\n enumerator._settledAt(entry._state, i, entry._result);\n } else {\n enumerator._willSettleAt(c.resolve(entry), i);\n }\n } else {\n enumerator._remaining--;\n enumerator._result[i] = entry;\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {\n var enumerator = this;\n var promise = enumerator.promise;\n\n if (promise._state === lib$es6$promise$$internal$$PENDING) {\n enumerator._remaining--;\n\n if (state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n } else {\n enumerator._result[i] = value;\n }\n }\n\n if (enumerator._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(promise, enumerator._result);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {\n var enumerator = this;\n\n lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) {\n enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);\n }, function(reason) {\n enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);\n });\n };\n function lib$es6$promise$promise$all$$all(entries) {\n return new lib$es6$promise$enumerator$$default(this, entries).promise;\n }\n var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;\n function lib$es6$promise$promise$race$$race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n\n if (!lib$es6$promise$utils$$isArray(entries)) {\n lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));\n return promise;\n }\n\n var length = entries.length;\n\n function onFulfillment(value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }\n\n function onRejection(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n }\n\n for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {\n lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);\n }\n\n return promise;\n }\n var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;\n function lib$es6$promise$promise$resolve$$resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$resolve(promise, object);\n return promise;\n }\n var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;\n function lib$es6$promise$promise$reject$$reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$reject(promise, reason);\n return promise;\n }\n var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;\n\n var lib$es6$promise$promise$$counter = 0;\n\n function lib$es6$promise$promise$$needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n function lib$es6$promise$promise$$needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n */\n function lib$es6$promise$promise$$Promise(resolver) {\n this._id = lib$es6$promise$promise$$counter++;\n this._state = undefined;\n this._result = undefined;\n this._subscribers = [];\n\n if (lib$es6$promise$$internal$$noop !== resolver) {\n if (!lib$es6$promise$utils$$isFunction(resolver)) {\n lib$es6$promise$promise$$needsResolver();\n }\n\n if (!(this instanceof lib$es6$promise$promise$$Promise)) {\n lib$es6$promise$promise$$needsNew();\n }\n\n lib$es6$promise$$internal$$initializePromise(this, resolver);\n }\n }\n\n lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;\n lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;\n lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;\n lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;\n lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;\n lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;\n lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;\n\n lib$es6$promise$promise$$Promise.prototype = {\n constructor: lib$es6$promise$promise$$Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n\n Chaining\n --------\n\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n\n Assimilation\n ------------\n\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n\n If the assimliated promise rejects, then the downstream promise will also reject.\n\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n\n Simple Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var result;\n\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n\n Advanced Example\n --------------\n\n Synchronous Example\n\n ```javascript\n var author, books;\n\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n\n Errback Example\n\n ```js\n\n function foundBooks(books) {\n\n }\n\n function failure(reason) {\n\n }\n\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n\n Promise Example;\n\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: function(onFulfillment, onRejection) {\n var parent = this;\n var state = parent._state;\n\n if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) {\n return this;\n }\n\n var child = new this.constructor(lib$es6$promise$$internal$$noop);\n var result = parent._result;\n\n if (state) {\n var callback = arguments[state - 1];\n lib$es6$promise$asap$$asap(function(){\n lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);\n });\n } else {\n lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n },\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function(onRejection) {\n return this.then(null, onRejection);\n }\n };\n function lib$es6$promise$polyfill$$polyfill() {\n var local;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {\n return;\n }\n\n local.Promise = lib$es6$promise$promise$$default;\n }\n var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;\n\n var lib$es6$promise$umd$$ES6Promise = {\n 'Promise': lib$es6$promise$promise$$default,\n 'polyfill': lib$es6$promise$polyfill$$default\n };\n\n /* global define:true module:true window: true */\n if (typeof define === 'function' && define['amd']) {\n define(function() { return lib$es6$promise$umd$$ES6Promise; });\n } else if (typeof module !== 'undefined' && module['exports']) {\n module['exports'] = lib$es6$promise$umd$$ES6Promise;\n } else if (typeof this !== 'undefined') {\n this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;\n }\n\n lib$es6$promise$polyfill$$default();\n}).call(this);\n\n","/* -*- mode: javascript; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n\n// \n// Javascript ZLib\n// By Thomas Down 2010-2011\n//\n// Based very heavily on portions of jzlib (by [email protected]), who in\n// turn credits Jean-loup Gailly and Mark Adler for the original zlib code.\n//\n// inflate.js: ZLib inflate code\n//\n\n//\n// Shared constants\n//\n\nvar MAX_WBITS=15; // 32K LZ77 window\nvar DEF_WBITS=MAX_WBITS;\nvar MAX_MEM_LEVEL=9;\nvar MANY=1440;\nvar BMAX = 15;\n\n// preset dictionary flag in zlib header\nvar PRESET_DICT=0x20;\n\nvar Z_NO_FLUSH=0;\nvar Z_PARTIAL_FLUSH=1;\nvar Z_SYNC_FLUSH=2;\nvar Z_FULL_FLUSH=3;\nvar Z_FINISH=4;\n\nvar Z_DEFLATED=8;\n\nvar Z_OK=0;\nvar Z_STREAM_END=1;\nvar Z_NEED_DICT=2;\nvar Z_ERRNO=-1;\nvar Z_STREAM_ERROR=-2;\nvar Z_DATA_ERROR=-3;\nvar Z_MEM_ERROR=-4;\nvar Z_BUF_ERROR=-5;\nvar Z_VERSION_ERROR=-6;\n\nvar METHOD=0; // waiting for method byte\nvar FLAG=1; // waiting for flag byte\nvar DICT4=2; // four dictionary check bytes to go\nvar DICT3=3; // three dictionary check bytes to go\nvar DICT2=4; // two dictionary check bytes to go\nvar DICT1=5; // one dictionary check byte to go\nvar DICT0=6; // waiting for inflateSetDictionary\nvar BLOCKS=7; // decompressing blocks\nvar CHECK4=8; // four check bytes to go\nvar CHECK3=9; // three check bytes to go\nvar CHECK2=10; // two check bytes to go\nvar CHECK1=11; // one check byte to go\nvar DONE=12; // finished check, done\nvar BAD=13; // got an error--stay here\n\nvar inflate_mask = [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff];\n\nvar IB_TYPE=0; // get type bits (3, including end bit)\nvar IB_LENS=1; // get lengths for stored\nvar IB_STORED=2;// processing stored block\nvar IB_TABLE=3; // get table lengths\nvar IB_BTREE=4; // get bit lengths tree for a dynamic block\nvar IB_DTREE=5; // get length, distance trees for a dynamic block\nvar IB_CODES=6; // processing fixed or dynamic block\nvar IB_DRY=7; // output remaining window bytes\nvar IB_DONE=8; // finished last block, done\nvar IB_BAD=9; // ot a data error--stuck here\n\nvar fixed_bl = 9;\nvar fixed_bd = 5;\n\nvar fixed_tl = [\n 96,7,256, 0,8,80, 0,8,16, 84,8,115,\n 82,7,31, 0,8,112, 0,8,48, 0,9,192,\n 80,7,10, 0,8,96, 0,8,32, 0,9,160,\n 0,8,0, 0,8,128, 0,8,64, 0,9,224,\n 80,7,6, 0,8,88, 0,8,24, 0,9,144,\n 83,7,59, 0,8,120, 0,8,56, 0,9,208,\n 81,7,17, 0,8,104, 0,8,40, 0,9,176,\n 0,8,8, 0,8,136, 0,8,72, 0,9,240,\n 80,7,4, 0,8,84, 0,8,20, 85,8,227,\n 83,7,43, 0,8,116, 0,8,52, 0,9,200,\n 81,7,13, 0,8,100, 0,8,36, 0,9,168,\n 0,8,4, 0,8,132, 0,8,68, 0,9,232,\n 80,7,8, 0,8,92, 0,8,28, 0,9,152,\n 84,7,83, 0,8,124, 0,8,60, 0,9,216,\n 82,7,23, 0,8,108, 0,8,44, 0,9,184,\n 0,8,12, 0,8,140, 0,8,76, 0,9,248,\n 80,7,3, 0,8,82, 0,8,18, 85,8,163,\n 83,7,35, 0,8,114, 0,8,50, 0,9,196,\n 81,7,11, 0,8,98, 0,8,34, 0,9,164,\n 0,8,2, 0,8,130, 0,8,66, 0,9,228,\n 80,7,7, 0,8,90, 0,8,26, 0,9,148,\n 84,7,67, 0,8,122, 0,8,58, 0,9,212,\n 82,7,19, 0,8,106, 0,8,42, 0,9,180,\n 0,8,10, 0,8,138, 0,8,74, 0,9,244,\n 80,7,5, 0,8,86, 0,8,22, 192,8,0,\n 83,7,51, 0,8,118, 0,8,54, 0,9,204,\n 81,7,15, 0,8,102, 0,8,38, 0,9,172,\n 0,8,6, 0,8,134, 0,8,70, 0,9,236,\n 80,7,9, 0,8,94, 0,8,30, 0,9,156,\n 84,7,99, 0,8,126, 0,8,62, 0,9,220,\n 82,7,27, 0,8,110, 0,8,46, 0,9,188,\n 0,8,14, 0,8,142, 0,8,78, 0,9,252,\n 96,7,256, 0,8,81, 0,8,17, 85,8,131,\n 82,7,31, 0,8,113, 0,8,49, 0,9,194,\n 80,7,10, 0,8,97, 0,8,33, 0,9,162,\n 0,8,1, 0,8,129, 0,8,65, 0,9,226,\n 80,7,6, 0,8,89, 0,8,25, 0,9,146,\n 83,7,59, 0,8,121, 0,8,57, 0,9,210,\n 81,7,17, 0,8,105, 0,8,41, 0,9,178,\n 0,8,9, 0,8,137, 0,8,73, 0,9,242,\n 80,7,4, 0,8,85, 0,8,21, 80,8,258,\n 83,7,43, 0,8,117, 0,8,53, 0,9,202,\n 81,7,13, 0,8,101, 0,8,37, 0,9,170,\n 0,8,5, 0,8,133, 0,8,69, 0,9,234,\n 80,7,8, 0,8,93, 0,8,29, 0,9,154,\n 84,7,83, 0,8,125, 0,8,61, 0,9,218,\n 82,7,23, 0,8,109, 0,8,45, 0,9,186,\n 0,8,13, 0,8,141, 0,8,77, 0,9,250,\n 80,7,3, 0,8,83, 0,8,19, 85,8,195,\n 83,7,35, 0,8,115, 0,8,51, 0,9,198,\n 81,7,11, 0,8,99, 0,8,35, 0,9,166,\n 0,8,3, 0,8,131, 0,8,67, 0,9,230,\n 80,7,7, 0,8,91, 0,8,27, 0,9,150,\n 84,7,67, 0,8,123, 0,8,59, 0,9,214,\n 82,7,19, 0,8,107, 0,8,43, 0,9,182,\n 0,8,11, 0,8,139, 0,8,75, 0,9,246,\n 80,7,5, 0,8,87, 0,8,23, 192,8,0,\n 83,7,51, 0,8,119, 0,8,55, 0,9,206,\n 81,7,15, 0,8,103, 0,8,39, 0,9,174,\n 0,8,7, 0,8,135, 0,8,71, 0,9,238,\n 80,7,9, 0,8,95, 0,8,31, 0,9,158,\n 84,7,99, 0,8,127, 0,8,63, 0,9,222,\n 82,7,27, 0,8,111, 0,8,47, 0,9,190,\n 0,8,15, 0,8,143, 0,8,79, 0,9,254,\n 96,7,256, 0,8,80, 0,8,16, 84,8,115,\n 82,7,31, 0,8,112, 0,8,48, 0,9,193,\n\n 80,7,10, 0,8,96, 0,8,32, 0,9,161,\n 0,8,0, 0,8,128, 0,8,64, 0,9,225,\n 80,7,6, 0,8,88, 0,8,24, 0,9,145,\n 83,7,59, 0,8,120, 0,8,56, 0,9,209,\n 81,7,17, 0,8,104, 0,8,40, 0,9,177,\n 0,8,8, 0,8,136, 0,8,72, 0,9,241,\n 80,7,4, 0,8,84, 0,8,20, 85,8,227,\n 83,7,43, 0,8,116, 0,8,52, 0,9,201,\n 81,7,13, 0,8,100, 0,8,36, 0,9,169,\n 0,8,4, 0,8,132, 0,8,68, 0,9,233,\n 80,7,8, 0,8,92, 0,8,28, 0,9,153,\n 84,7,83, 0,8,124, 0,8,60, 0,9,217,\n 82,7,23, 0,8,108, 0,8,44, 0,9,185,\n 0,8,12, 0,8,140, 0,8,76, 0,9,249,\n 80,7,3, 0,8,82, 0,8,18, 85,8,163,\n 83,7,35, 0,8,114, 0,8,50, 0,9,197,\n 81,7,11, 0,8,98, 0,8,34, 0,9,165,\n 0,8,2, 0,8,130, 0,8,66, 0,9,229,\n 80,7,7, 0,8,90, 0,8,26, 0,9,149,\n 84,7,67, 0,8,122, 0,8,58, 0,9,213,\n 82,7,19, 0,8,106, 0,8,42, 0,9,181,\n 0,8,10, 0,8,138, 0,8,74, 0,9,245,\n 80,7,5, 0,8,86, 0,8,22, 192,8,0,\n 83,7,51, 0,8,118, 0,8,54, 0,9,205,\n 81,7,15, 0,8,102, 0,8,38, 0,9,173,\n 0,8,6, 0,8,134, 0,8,70, 0,9,237,\n 80,7,9, 0,8,94, 0,8,30, 0,9,157,\n 84,7,99, 0,8,126, 0,8,62, 0,9,221,\n 82,7,27, 0,8,110, 0,8,46, 0,9,189,\n 0,8,14, 0,8,142, 0,8,78, 0,9,253,\n 96,7,256, 0,8,81, 0,8,17, 85,8,131,\n 82,7,31, 0,8,113, 0,8,49, 0,9,195,\n 80,7,10, 0,8,97, 0,8,33, 0,9,163,\n 0,8,1, 0,8,129, 0,8,65, 0,9,227,\n 80,7,6, 0,8,89, 0,8,25, 0,9,147,\n 83,7,59, 0,8,121, 0,8,57, 0,9,211,\n 81,7,17, 0,8,105, 0,8,41, 0,9,179,\n 0,8,9, 0,8,137, 0,8,73, 0,9,243,\n 80,7,4, 0,8,85, 0,8,21, 80,8,258,\n 83,7,43, 0,8,117, 0,8,53, 0,9,203,\n 81,7,13, 0,8,101, 0,8,37, 0,9,171,\n 0,8,5, 0,8,133, 0,8,69, 0,9,235,\n 80,7,8, 0,8,93, 0,8,29, 0,9,155,\n 84,7,83, 0,8,125, 0,8,61, 0,9,219,\n 82,7,23, 0,8,109, 0,8,45, 0,9,187,\n 0,8,13, 0,8,141, 0,8,77, 0,9,251,\n 80,7,3, 0,8,83, 0,8,19, 85,8,195,\n 83,7,35, 0,8,115, 0,8,51, 0,9,199,\n 81,7,11, 0,8,99, 0,8,35, 0,9,167,\n 0,8,3, 0,8,131, 0,8,67, 0,9,231,\n 80,7,7, 0,8,91, 0,8,27, 0,9,151,\n 84,7,67, 0,8,123, 0,8,59, 0,9,215,\n 82,7,19, 0,8,107, 0,8,43, 0,9,183,\n 0,8,11, 0,8,139, 0,8,75, 0,9,247,\n 80,7,5, 0,8,87, 0,8,23, 192,8,0,\n 83,7,51, 0,8,119, 0,8,55, 0,9,207,\n 81,7,15, 0,8,103, 0,8,39, 0,9,175,\n 0,8,7, 0,8,135, 0,8,71, 0,9,239,\n 80,7,9, 0,8,95, 0,8,31, 0,9,159,\n 84,7,99, 0,8,127, 0,8,63, 0,9,223,\n 82,7,27, 0,8,111, 0,8,47, 0,9,191,\n 0,8,15, 0,8,143, 0,8,79, 0,9,255\n];\nvar fixed_td = [\n 80,5,1, 87,5,257, 83,5,17, 91,5,4097,\n 81,5,5, 89,5,1025, 85,5,65, 93,5,16385,\n 80,5,3, 88,5,513, 84,5,33, 92,5,8193,\n 82,5,9, 90,5,2049, 86,5,129, 192,5,24577,\n 80,5,2, 87,5,385, 83,5,25, 91,5,6145,\n 81,5,7, 89,5,1537, 85,5,97, 93,5,24577,\n 80,5,4, 88,5,769, 84,5,49, 92,5,12289,\n 82,5,13, 90,5,3073, 86,5,193, 192,5,24577\n];\n\n // Tables for deflate from PKZIP's appnote.txt.\n var cplens = [ // Copy lengths for literal codes 257..285\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n ];\n\n // see note #13 above about 258\n var cplext = [ // Extra bits for literal codes 257..285\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,\n 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid\n ];\n\n var cpdist = [ // Copy offsets for distance codes 0..29\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577\n ];\n\n var cpdext = [ // Extra bits for distance codes\n 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,\n 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,\n 12, 12, 13, 13];\n\n//\n// ZStream.java\n//\n\nfunction ZStream() {\n}\n\n\nZStream.prototype.inflateInit = function(w, nowrap) {\n if (!w) {\n\tw = DEF_WBITS;\n }\n if (nowrap) {\n\tnowrap = false;\n }\n this.istate = new Inflate();\n return this.istate.inflateInit(this, nowrap?-w:w);\n}\n\nZStream.prototype.inflate = function(f) {\n if(this.istate==null) return Z_STREAM_ERROR;\n return this.istate.inflate(this, f);\n}\n\nZStream.prototype.inflateEnd = function(){\n if(this.istate==null) return Z_STREAM_ERROR;\n var ret=istate.inflateEnd(this);\n this.istate = null;\n return ret;\n}\nZStream.prototype.inflateSync = function(){\n // if(istate == null) return Z_STREAM_ERROR;\n return istate.inflateSync(this);\n}\nZStream.prototype.inflateSetDictionary = function(dictionary, dictLength){\n // if(istate == null) return Z_STREAM_ERROR;\n return istate.inflateSetDictionary(this, dictionary, dictLength);\n}\n\n/*\n\n public int deflateInit(int level){\n return deflateInit(level, MAX_WBITS);\n }\n public int deflateInit(int level, boolean nowrap){\n return deflateInit(level, MAX_WBITS, nowrap);\n }\n public int deflateInit(int level, int bits){\n return deflateInit(level, bits, false);\n }\n public int deflateInit(int level, int bits, boolean nowrap){\n dstate=new Deflate();\n return dstate.deflateInit(this, level, nowrap?-bits:bits);\n }\n public int deflate(int flush){\n if(dstate==null){\n return Z_STREAM_ERROR;\n }\n return dstate.deflate(this, flush);\n }\n public int deflateEnd(){\n if(dstate==null) return Z_STREAM_ERROR;\n int ret=dstate.deflateEnd();\n dstate=null;\n return ret;\n }\n public int deflateParams(int level, int strategy){\n if(dstate==null) return Z_STREAM_ERROR;\n return dstate.deflateParams(this, level, strategy);\n }\n public int deflateSetDictionary (byte[] dictionary, int dictLength){\n if(dstate == null)\n return Z_STREAM_ERROR;\n return dstate.deflateSetDictionary(this, dictionary, dictLength);\n }\n\n*/\n\n/*\n // Flush as much pending output as possible. All deflate() output goes\n // through this function so some applications may wish to modify it\n // to avoid allocating a large strm->next_out buffer and copying into it.\n // (See also read_buf()).\n void flush_pending(){\n int len=dstate.pending;\n\n if(len>avail_out) len=avail_out;\n if(len==0) return;\n\n if(dstate.pending_buf.length<=dstate.pending_out ||\n next_out.length<=next_out_index ||\n dstate.pending_buf.length<(dstate.pending_out+len) ||\n next_out.length<(next_out_index+len)){\n System.out.println(dstate.pending_buf.length+\", \"+dstate.pending_out+\n\t\t\t \", \"+next_out.length+\", \"+next_out_index+\", \"+len);\n System.out.println(\"avail_out=\"+avail_out);\n }\n\n System.arraycopy(dstate.pending_buf, dstate.pending_out,\n\t\t next_out, next_out_index, len);\n\n next_out_index+=len;\n dstate.pending_out+=len;\n total_out+=len;\n avail_out-=len;\n dstate.pending-=len;\n if(dstate.pending==0){\n dstate.pending_out=0;\n }\n }\n\n // Read a new buffer from the current input stream, update the adler32\n // and total number of bytes read. All deflate() input goes through\n // this function so some applications may wish to modify it to avoid\n // allocating a large strm->next_in buffer and copying from it.\n // (See also flush_pending()).\n int read_buf(byte[] buf, int start, int size) {\n int len=avail_in;\n\n if(len>size) len=size;\n if(len==0) return 0;\n\n avail_in-=len;\n\n if(dstate.noheader==0) {\n adler=_adler.adler32(adler, next_in, next_in_index, len);\n }\n System.arraycopy(next_in, next_in_index, buf, start, len);\n next_in_index += len;\n total_in += len;\n return len;\n }\n\n public void free(){\n next_in=null;\n next_out=null;\n msg=null;\n _adler=null;\n }\n}\n*/\n\n\n//\n// Inflate.java\n//\n\nfunction Inflate() {\n this.was = [0];\n}\n\nInflate.prototype.inflateReset = function(z) {\n if(z == null || z.istate == null) return Z_STREAM_ERROR;\n \n z.total_in = z.total_out = 0;\n z.msg = null;\n z.istate.mode = z.istate.nowrap!=0 ? BLOCKS : METHOD;\n z.istate.blocks.reset(z, null);\n return Z_OK;\n}\n\nInflate.prototype.inflateEnd = function(z){\n if(this.blocks != null)\n this.blocks.free(z);\n this.blocks=null;\n return Z_OK;\n}\n\nInflate.prototype.inflateInit = function(z, w){\n z.msg = null;\n this.blocks = null;\n\n // handle undocumented nowrap option (no zlib header or check)\n nowrap = 0;\n if(w < 0){\n w = - w;\n nowrap = 1;\n }\n\n // set window size\n if(w<8 ||w>15){\n this.inflateEnd(z);\n return Z_STREAM_ERROR;\n }\n this.wbits=w;\n\n z.istate.blocks=new InfBlocks(z, \n\t\t\t\t z.istate.nowrap!=0 ? null : this,\n\t\t\t\t 1<>4)+8>z.istate.wbits){\n z.istate.mode = BAD;\n z.msg=\"invalid window size\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n z.istate.mode=FLAG;\n case FLAG:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n b = (z.next_in[z.next_in_index++])&0xff;\n\n if((((z.istate.method << 8)+b) % 31)!=0){\n z.istate.mode = BAD;\n z.msg = \"incorrect header check\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n\n if((b&PRESET_DICT)==0){\n z.istate.mode = BLOCKS;\n break;\n }\n z.istate.mode = DICT4;\n case DICT4:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000;\n z.istate.mode=DICT3;\n case DICT3:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000;\n z.istate.mode=DICT2;\n case DICT2:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00;\n z.istate.mode=DICT1;\n case DICT1:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need += (z.next_in[z.next_in_index++]&0xff);\n z.adler = z.istate.need;\n z.istate.mode = DICT0;\n return Z_NEED_DICT;\n case DICT0:\n z.istate.mode = BAD;\n z.msg = \"need dictionary\";\n z.istate.marker = 0; // can try inflateSync\n return Z_STREAM_ERROR;\n case BLOCKS:\n\n r = z.istate.blocks.proc(z, r);\n if(r == Z_DATA_ERROR){\n z.istate.mode = BAD;\n z.istate.marker = 0; // can try inflateSync\n break;\n }\n if(r == Z_OK){\n r = f;\n }\n if(r != Z_STREAM_END){\n return r;\n }\n r = f;\n z.istate.blocks.reset(z, z.istate.was);\n if(z.istate.nowrap!=0){\n z.istate.mode=DONE;\n break;\n }\n z.istate.mode=CHECK4;\n case CHECK4:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000;\n z.istate.mode=CHECK3;\n case CHECK3:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000;\n z.istate.mode = CHECK2;\n case CHECK2:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00;\n z.istate.mode = CHECK1;\n case CHECK1:\n\n if(z.avail_in==0)return r;r=f;\n\n z.avail_in--; z.total_in++;\n z.istate.need+=(z.next_in[z.next_in_index++]&0xff);\n\n if(((z.istate.was[0])) != ((z.istate.need))){\n z.istate.mode = BAD;\n z.msg = \"incorrect data check\";\n z.istate.marker = 5; // can't try inflateSync\n break;\n }\n\n z.istate.mode = DONE;\n case DONE:\n return Z_STREAM_END;\n case BAD:\n return Z_DATA_ERROR;\n default:\n return Z_STREAM_ERROR;\n }\n }\n }\n\n\nInflate.prototype.inflateSetDictionary = function(z, dictionary, dictLength) {\n var index=0;\n var length = dictLength;\n if(z==null || z.istate == null|| z.istate.mode != DICT0)\n return Z_STREAM_ERROR;\n\n if(z._adler.adler32(1, dictionary, 0, dictLength)!=z.adler){\n return Z_DATA_ERROR;\n }\n\n z.adler = z._adler.adler32(0, null, 0, 0);\n\n if(length >= (1<>> 1){\n case 0: // stored \n {b>>>=(3);k-=(3);}\n t = k & 7; // go to byte boundary\n\n {b>>>=(t);k-=(t);}\n this.mode = IB_LENS; // get length of stored block\n break;\n case 1: // fixed\n {\n var bl=new Int32Array(1);\n\t var bd=new Int32Array(1);\n var tl=[];\n\t var td=[];\n\n\t inflate_trees_fixed(bl, bd, tl, td, z);\n this.codes.init(bl[0], bd[0], tl[0], 0, td[0], 0, z);\n }\n\n {b>>>=(3);k-=(3);}\n\n this.mode = IB_CODES;\n break;\n case 2: // dynamic\n\n {b>>>=(3);k-=(3);}\n\n this.mode = IB_TABLE;\n break;\n case 3: // illegal\n\n {b>>>=(3);k-=(3);}\n this.mode = BAD;\n z.msg = \"invalid block type\";\n r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\tbreak;\n case IB_LENS:\n\twhile(k<(32)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>> 16) & 0xffff) != (b & 0xffff)){\n\t this.mode = BAD;\n\t z.msg = \"invalid stored block lengths\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\tthis.left = (b & 0xffff);\n\tb = k = 0; // dump bits\n\tthis.mode = this.left!=0 ? IB_STORED : (this.last!=0 ? IB_DRY : IB_TYPE);\n\tbreak;\n case IB_STORED:\n\tif (n == 0){\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\n\tif(m==0){\n\t if(q==end&&read!=0){\n\t q=0; m=(qn) t = n;\n\tif(t>m) t = m;\n\tarrayCopy(z.next_in, p, this.window, q, t);\n\tp += t; n -= t;\n\tq += t; m -= t;\n\tif ((this.left -= t) != 0)\n\t break;\n\tthis.mode = (this.last != 0 ? IB_DRY : IB_TYPE);\n\tbreak;\n case IB_TABLE:\n\n\twhile(k<(14)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)< 29 || ((t >> 5) & 0x1f) > 29)\n\t {\n\t this.mode = IB_BAD;\n\t z.msg = \"too many length or distance symbols\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\tt = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n\tif(this.blens==null || this.blens.length>>=(14);k-=(14);}\n\n\tthis.index = 0;\n\tmode = IB_BTREE;\n case IB_BTREE:\n\twhile (this.index < 4 + (this.table >>> 10)){\n\t while(k<(3)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(3);k-=(3);}\n\t}\n\n\twhile(this.index < 19){\n\t this.blens[INFBLOCKS_BORDER[this.index++]] = 0;\n\t}\n\n\tthis.bb[0] = 7;\n\tt = this.inftree.inflate_trees_bits(this.blens, this.bb, this.tb, this.hufts, z);\n\tif (t != Z_OK){\n\t r = t;\n\t if (r == Z_DATA_ERROR){\n\t this.blens=null;\n\t this.mode = IB_BAD;\n\t }\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t write=q;\n\t return this.inflate_flush(z,r);\n\t}\n\n\tthis.index = 0;\n\tthis.mode = IB_DTREE;\n case IB_DTREE:\n\twhile (true){\n\t t = this.table;\n\t if(!(this.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))){\n\t break;\n\t }\n\n\t var h; //int[]\n\t var i, j, c;\n\n\t t = this.bb[0];\n\n\t while(k<(t)){\n\t if(n!=0){\n\t r=Z_OK;\n\t }\n\t else{\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;\n\t z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t);\n\t this.blens[this.index++] = c;\n\t }\n\t else { // c == 16..18\n\t i = c == 18 ? 7 : c - 14;\n\t j = c == 18 ? 11 : 3;\n\n\t while(k<(t+i)){\n\t if(n!=0){\n\t\tr=Z_OK;\n\t }\n\t else{\n\t\tthis.bitb=b; this.bitk=k; \n\t\tz.avail_in=n;\n\t\tz.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t\tthis.write=q;\n\t\treturn this.inflate_flush(z,r);\n\t };\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t);\n\n\t j += (b & inflate_mask[i]);\n\n\t b>>>=(i);k-=(i);\n\n\t i = this.index;\n\t t = this.table;\n\t if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||\n\t\t(c == 16 && i < 1)){\n\t this.blens=null;\n\t this.mode = IB_BAD;\n\t z.msg = \"invalid bit length repeat\";\n\t r = Z_DATA_ERROR;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\n\t c = c == 16 ? this.blens[i-1] : 0;\n\t do{\n\t this.blens[i++] = c;\n\t }\n\t while (--j!=0);\n\t this.index = i;\n\t }\n\t}\n\n\tthis.tb[0]=-1;\n\t{\n\t var bl=new Int32Array(1);\n\t var bd=new Int32Array(1);\n\t var tl=new Int32Array(1);\n\t var td=new Int32Array(1);\n\t bl[0] = 9; // must be <= 9 for lookahead assumptions\n\t bd[0] = 6; // must be <= 9 for lookahead assumptions\n\n\t t = this.table;\n\t t = this.inftree.inflate_trees_dynamic(257 + (t & 0x1f), \n\t\t\t\t\t 1 + ((t >> 5) & 0x1f),\n\t\t\t\t\t this.blens, bl, bd, tl, td, this.hufts, z);\n\n\t if (t != Z_OK){\n\t if (t == Z_DATA_ERROR){\n\t this.blens=null;\n\t this.mode = BAD;\n\t }\n\t r = t;\n\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z,r);\n\t }\n\t this.codes.init(bl[0], bd[0], this.hufts, tl[0], this.hufts, td[0], z);\n\t}\n\tthis.mode = IB_CODES;\n case IB_CODES:\n\tthis.bitb=b; this.bitk=k;\n\tz.avail_in=n; z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\n\tif ((r = this.codes.proc(this, z, r)) != Z_STREAM_END){\n\t return this.inflate_flush(z, r);\n\t}\n\tr = Z_OK;\n\tthis.codes.free(z);\n\n\tp=z.next_in_index; n=z.avail_in;b=this.bitb;k=this.bitk;\n\tq=this.write;m = (q < this.read ? this.read-q-1 : this.end-q);\n\n\tif (this.last==0){\n\t this.mode = IB_TYPE;\n\t break;\n\t}\n\tthis.mode = IB_DRY;\n case IB_DRY:\n\tthis.write=q; \n\tr = this.inflate_flush(z, r); \n\tq=this.write; m = (q < this.read ? this.read-q-1 : this.end-q);\n\tif (this.read != this.write){\n\t this.bitb=b; this.bitk=k; \n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t this.write=q;\n\t return this.inflate_flush(z, r);\n\t}\n\tmode = DONE;\n case IB_DONE:\n\tr = Z_STREAM_END;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n case IB_BAD:\n\tr = Z_DATA_ERROR;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n\n default:\n\tr = Z_STREAM_ERROR;\n\n\tthis.bitb=b; this.bitk=k; \n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\tthis.write=q;\n\treturn this.inflate_flush(z, r);\n }\n }\n }\n\nInfBlocks.prototype.free = function(z){\n this.reset(z, null);\n this.window=null;\n this.hufts=null;\n}\n\nInfBlocks.prototype.set_dictionary = function(d, start, n){\n arrayCopy(d, start, window, 0, n);\n this.read = this.write = n;\n}\n\n // Returns true if inflate is currently at the end of a block generated\n // by Z_SYNC_FLUSH or Z_FULL_FLUSH. \nInfBlocks.prototype.sync_point = function(){\n return this.mode == IB_LENS;\n}\n\n // copy as much as possible from the sliding window to the output area\nInfBlocks.prototype.inflate_flush = function(z, r){\n var n;\n var p;\n var q;\n\n // local copies of source and destination pointers\n p = z.next_out_index;\n q = this.read;\n\n // compute number of bytes to copy as far as end of window\n n = ((q <= this.write ? this.write : this.end) - q);\n if (n > z.avail_out) n = z.avail_out;\n if (n!=0 && r == Z_BUF_ERROR) r = Z_OK;\n\n // update counters\n z.avail_out -= n;\n z.total_out += n;\n\n // update check information\n if(this.checkfn != null)\n z.adler=this.check=z._adler.adler32(this.check, this.window, q, n);\n\n // copy as far as end of window\n arrayCopy(this.window, q, z.next_out, p, n);\n p += n;\n q += n;\n\n // see if more to copy at beginning of window\n if (q == this.end){\n // wrap pointers\n q = 0;\n if (this.write == this.end)\n this.write = 0;\n\n // compute bytes to copy\n n = this.write - q;\n if (n > z.avail_out) n = z.avail_out;\n if (n!=0 && r == Z_BUF_ERROR) r = Z_OK;\n\n // update counters\n z.avail_out -= n;\n z.total_out += n;\n\n // update check information\n if(this.checkfn != null)\n\tz.adler=this.check=z._adler.adler32(this.check, this.window, q, n);\n\n // copy\n arrayCopy(this.window, q, z.next_out, p, n);\n p += n;\n q += n;\n }\n\n // update pointers\n z.next_out_index = p;\n this.read = q;\n\n // done\n return r;\n }\n\n//\n// InfCodes.java\n//\n\nvar IC_START=0; // x: set up for LEN\nvar IC_LEN=1; // i: get length/literal/eob next\nvar IC_LENEXT=2; // i: getting length extra (have base)\nvar IC_DIST=3; // i: get distance next\nvar IC_DISTEXT=4;// i: getting distance extra\nvar IC_COPY=5; // o: copying bytes in window, waiting for space\nvar IC_LIT=6; // o: got literal, waiting for output space\nvar IC_WASH=7; // o: got eob, possibly still output waiting\nvar IC_END=8; // x: got eob and all data flushed\nvar IC_BADCODE=9;// x: got error\n\nfunction InfCodes() {\n}\n\nInfCodes.prototype.init = function(bl, bd, tl, tl_index, td, td_index, z) {\n this.mode=IC_START;\n this.lbits=bl;\n this.dbits=bd;\n this.ltree=tl;\n this.ltree_index=tl_index;\n this.dtree = td;\n this.dtree_index=td_index;\n this.tree=null;\n}\n\nInfCodes.prototype.proc = function(s, z, r){ \n var j; // temporary storage\n var t; // temporary pointer (int[])\n var tindex; // temporary pointer\n var e; // extra bits or operation\n var b=0; // bit buffer\n var k=0; // bits in bit buffer\n var p=0; // input data pointer\n var n; // bytes available there\n var q; // output window write pointer\n var m; // bytes to end of window or read pointer\n var f; // pointer to copy strings from\n\n // copy input/output information to locals (UPDATE macro restores)\n p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk;\n q=s.write;m=q= 258 && n >= 10){\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t r = this.inflate_fast(this.lbits, this.dbits, \n\t\t\t this.ltree, this.ltree_index, \n\t\t\t this.dtree, this.dtree_index,\n\t\t\t s, z);\n\n\t p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk;\n\t q=s.write;m=q>>=(this.tree[tindex+1]);\n\tk-=(this.tree[tindex+1]);\n\n\te=this.tree[tindex];\n\n\tif(e == 0){ // literal\n\t this.lit = this.tree[tindex+2];\n\t this.mode = IC_LIT;\n\t break;\n\t}\n\tif((e & 16)!=0 ){ // length\n\t this.get = e & 15;\n\t this.len = this.tree[tindex+2];\n\t this.mode = IC_LENEXT;\n\t break;\n\t}\n\tif ((e & 64) == 0){ // next table\n\t this.need = e;\n\t this.tree_index = tindex/3 + this.tree[tindex+2];\n\t break;\n\t}\n\tif ((e & 32)!=0){ // end of block\n\t this.mode = IC_WASH;\n\t break;\n\t}\n\tthis.mode = IC_BADCODE; // invalid code\n\tz.msg = \"invalid literal/length code\";\n\tr = Z_DATA_ERROR;\n\n\ts.bitb=b;s.bitk=k;\n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\ts.write=q;\n\treturn s.inflate_flush(z,r);\n\n case IC_LENEXT: // i: getting length extra (have base)\n\tj = this.get;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=j;\n\tk-=j;\n\n\tthis.need = this.dbits;\n\tthis.tree = this.dtree;\n\tthis.tree_index = this.dtree_index;\n\tthis.mode = IC_DIST;\n case IC_DIST: // i: get distance next\n\tj = this.need;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=this.tree[tindex+1];\n\tk-=this.tree[tindex+1];\n\n\te = (this.tree[tindex]);\n\tif((e & 16)!=0){ // distance\n\t this.get = e & 15;\n\t this.dist = this.tree[tindex+2];\n\t this.mode = IC_DISTEXT;\n\t break;\n\t}\n\tif ((e & 64) == 0){ // next table\n\t this.need = e;\n\t this.tree_index = tindex/3 + this.tree[tindex+2];\n\t break;\n\t}\n\tthis.mode = IC_BADCODE; // invalid code\n\tz.msg = \"invalid distance code\";\n\tr = Z_DATA_ERROR;\n\n\ts.bitb=b;s.bitk=k;\n\tz.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\ts.write=q;\n\treturn s.inflate_flush(z,r);\n\n case IC_DISTEXT: // i: getting distance extra\n\tj = this.get;\n\n\twhile(k<(j)){\n\t if(n!=0)r=Z_OK;\n\t else{\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\t return s.inflate_flush(z,r);\n\t }\n\t n--; b|=(z.next_in[p++]&0xff)<>=j;\n\tk-=j;\n\n\tthis.mode = IC_COPY;\n case IC_COPY: // o: copying bytes in window, waiting for space\n f = q - this.dist;\n while(f < 0){ // modulo window size-\"while\" instead\n f += s.end; // of \"if\" handles invalid distances\n\t}\n\twhile (this.len!=0){\n\n\t if(m==0){\n\t if(q==s.end&&s.read!=0){q=0;m=q 7){ // return unused byte, if any\n\t k -= 8;\n\t n++;\n\t p--; // can always return one\n\t}\n\n\ts.write=q; r=s.inflate_flush(z,r);\n\tq=s.write;m=q= 258 && n >= 10\n // get literal/length code\n while(k<(20)){ // max bits for literal/length code\n\tn--;\n\tb|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\ts.window[q++] = tp[tp_index_t_3+2];\n\tm--;\n\tcontinue;\n }\n do {\n\n\tb>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\tif((e&16)!=0){\n\t e &= 15;\n\t c = tp[tp_index_t_3+2] + (b & inflate_mask[e]);\n\n\t b>>=e; k-=e;\n\n\t // decode distance base of block to copy\n\t while(k<(15)){ // max bits for distance code\n\t n--;\n\t b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\t if((e&16)!=0){\n\t // get extra bits to add to distance base\n\t e &= 15;\n\t while(k<(e)){ // get extra bits (up to 13)\n\t\tn--;\n\t\tb|=(z.next_in[p++]&0xff)<>=(e); k-=(e);\n\n\t // do the copy\n\t m -= c;\n\t if (q >= d){ // offset before dest\n\t\t// just copy\n\t\tr=q-d;\n\t\tif(q-r>0 && 2>(q-r)){ \n\t\t s.window[q++]=s.window[r++]; // minimum count is three,\n\t\t s.window[q++]=s.window[r++]; // so unroll loop a little\n\t\t c-=2;\n\t\t}\n\t\telse{\n\t\t s.window[q++]=s.window[r++]; // minimum count is three,\n\t\t s.window[q++]=s.window[r++]; // so unroll loop a little\n\t\t c-=2;\n\t\t}\n\t }\n\t else{ // else offset after destination\n r=q-d;\n do{\n r+=s.end; // force pointer in window\n }while(r<0); // covers invalid distances\n\t\te=s.end-r;\n\t\tif(c>e){ // if source crosses,\n\t\t c-=e; // wrapped copy\n\t\t if(q-r>0 && e>(q-r)){ \n\t\t do{s.window[q++] = s.window[r++];}\n\t\t while(--e!=0);\n\t\t }\n\t\t else{\n\t\t arrayCopy(s.window, r, s.window, q, e);\n\t\t q+=e; r+=e; e=0;\n\t\t }\n\t\t r = 0; // copy rest from start of window\n\t\t}\n\n\t }\n\n\t // copy all or what's left\n do{s.window[q++] = s.window[r++];}\n\t\twhile(--c!=0);\n\t break;\n\t }\n\t else if((e&64)==0){\n\t t+=tp[tp_index_t_3+2];\n\t t+=(b&inflate_mask[e]);\n\t tp_index_t_3=(tp_index+t)*3;\n\t e=tp[tp_index_t_3];\n\t }\n\t else{\n\t z.msg = \"invalid distance code\";\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_DATA_ERROR;\n\t }\n\t }\n\t while(true);\n\t break;\n\t}\n\n\tif((e&64)==0){\n\t t+=tp[tp_index_t_3+2];\n\t t+=(b&inflate_mask[e]);\n\t tp_index_t_3=(tp_index+t)*3;\n\t if((e=tp[tp_index_t_3])==0){\n\n\t b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]);\n\n\t s.window[q++]=tp[tp_index_t_3+2];\n\t m--;\n\t break;\n\t }\n\t}\n\telse if((e&32)!=0){\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n \n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_STREAM_END;\n\t}\n\telse{\n\t z.msg=\"invalid literal/length code\";\n\n\t c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n\t s.bitb=b;s.bitk=k;\n\t z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n\t s.write=q;\n\n\t return Z_DATA_ERROR;\n\t}\n } \n while(true);\n } \n while(m>=258 && n>= 10);\n\n // not enough input or output--restore pointers and return\n c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3;\n\n s.bitb=b;s.bitk=k;\n z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p;\n s.write=q;\n\n return Z_OK;\n}\n\n//\n// InfTree.java\n//\n\nfunction InfTree() {\n}\n\nInfTree.prototype.huft_build = function(b, bindex, n, s, d, e, t, m, hp, hn, v) {\n\n // Given a list of code lengths and a maximum table size, make a set of\n // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR\n // if the given code set is incomplete (the tables are still built in this\n // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of\n // lengths), or Z_MEM_ERROR if not enough memory.\n\n var a; // counter for codes of length k\n var f; // i repeats in table every f entries\n var g; // maximum code length\n var h; // table level\n var i; // counter, current code\n var j; // counter\n var k; // number of bits in current code\n var l; // bits per table (returned in m)\n var mask; // (1 << w) - 1, to avoid cc -O bug on HP\n var p; // pointer into c[], b[], or v[]\n var q; // points to current table\n var w; // bits before this table == (l * h)\n var xp; // pointer into x\n var y; // number of dummy codes added\n var z; // number of entries in current table\n\n // Generate counts for each bit length\n\n p = 0; i = n;\n do {\n this.c[b[bindex+p]]++; p++; i--; // assume all entries <= BMAX\n }while(i!=0);\n\n if(this.c[0] == n){ // null input--all zero length codes\n t[0] = -1;\n m[0] = 0;\n return Z_OK;\n }\n\n // Find minimum and maximum length, bound *m by those\n l = m[0];\n for (j = 1; j <= BMAX; j++)\n if(this.c[j]!=0) break;\n k = j; // minimum code length\n if(l < j){\n l = j;\n }\n for (i = BMAX; i!=0; i--){\n if(this.c[i]!=0) break;\n }\n g = i; // maximum code length\n if(l > i){\n l = i;\n }\n m[0] = l;\n\n // Adjust last length count to fill out codes, if needed\n for (y = 1 << j; j < i; j++, y <<= 1){\n if ((y -= this.c[j]) < 0){\n return Z_DATA_ERROR;\n }\n }\n if ((y -= this.c[i]) < 0){\n return Z_DATA_ERROR;\n }\n this.c[i] += y;\n\n // Generate starting offsets into the value table for each length\n this.x[1] = j = 0;\n p = 1; xp = 2;\n while (--i!=0) { // note that i == g from above\n this.x[xp] = (j += this.c[p]);\n xp++;\n p++;\n }\n\n // Make a table of values in order of bit lengths\n i = 0; p = 0;\n do {\n if ((j = b[bindex+p]) != 0){\n this.v[this.x[j]++] = i;\n }\n p++;\n }\n while (++i < n);\n n = this.x[g]; // set n to length of v\n\n // Generate the Huffman codes and for each, make the table entries\n this.x[0] = i = 0; // first Huffman code is zero\n p = 0; // grab values in bit order\n h = -1; // no tables yet--level -1\n w = -l; // bits decoded == (l * h)\n this.u[0] = 0; // just to keep compilers happy\n q = 0; // ditto\n z = 0; // ditto\n\n // go through the bit lengths (k already is bits in shortest code)\n for (; k <= g; k++){\n a = this.c[k];\n while (a--!=0){\n\t// here i is the Huffman code of length k bits for value *p\n\t// make tables up to required level\n while (k > w + l){\n h++;\n w += l; // previous table always l bits\n\t // compute minimum size table less than or equal to l bits\n z = g - w;\n z = (z > l) ? l : z; // table size upper limit\n if((f=1<<(j=k-w))>a+1){ // try a k-w bit table\n // too few codes for k-w bit table\n f -= a + 1; // deduct codes from patterns left\n xp = k;\n if(j < z){\n while (++j < z){ // try smaller tables up to z bits\n if((f <<= 1) <= this.c[++xp])\n break; // enough codes to use up j bits\n f -= this.c[xp]; // else deduct codes from patterns\n }\n\t }\n }\n z = 1 << j; // table entries for j-bit table\n\n\t // allocate new table\n if (this.hn[0] + z > MANY){ // (note: doesn't matter for fixed)\n return Z_DATA_ERROR; // overflow of MANY\n }\n this.u[h] = q = /*hp+*/ this.hn[0]; // DEBUG\n this.hn[0] += z;\n \n\t // connect to last table, if there is one\n\t if(h!=0){\n this.x[h]=i; // save pattern for backing up\n this.r[0]=j; // bits in this table\n this.r[1]=l; // bits to dump before this table\n j=i>>>(w - l);\n this.r[2] = (q - this.u[h-1] - j); // offset to this table\n arrayCopy(this.r, 0, hp, (this.u[h-1]+j)*3, 3); // connect to last table\n }\n else{\n t[0] = q; // first table is returned result\n\t }\n }\n\n\t// set up table entry in r\n this.r[1] = (k - w);\n if (p >= n){\n this.r[0] = 128 + 64; // out of values--invalid code\n\t}\n else if (v[p] < s){\n this.r[0] = (this.v[p] < 256 ? 0 : 32 + 64); // 256 is end-of-block\n this.r[2] = this.v[p++]; // simple code is just the value\n }\n else{\n this.r[0]=(e[this.v[p]-s]+16+64); // non-simple--look up in lists\n this.r[2]=d[this.v[p++] - s];\n }\n\n // fill code-like entries with r\n f=1<<(k-w);\n for (j=i>>>w;j>>= 1){\n i ^= j;\n\t}\n i ^= j;\n\n\t// backup over finished tables\n mask = (1 << w) - 1; // needed on HP, cc -O bug\n while ((i & mask) != this.x[h]){\n h--; // don't need to update q\n w -= l;\n mask = (1 << w) - 1;\n }\n }\n }\n // Return Z_BUF_ERROR if we were given an incomplete table\n return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n}\n\nInfTree.prototype.inflate_trees_bits = function(c, bb, tb, hp, z) {\n var result;\n this.initWorkArea(19);\n this.hn[0]=0;\n result = this.huft_build(c, 0, 19, 19, null, null, tb, bb, hp, this.hn, this.v);\n\n if(result == Z_DATA_ERROR){\n z.msg = \"oversubscribed dynamic bit lengths tree\";\n }\n else if(result == Z_BUF_ERROR || bb[0] == 0){\n z.msg = \"incomplete dynamic bit lengths tree\";\n result = Z_DATA_ERROR;\n }\n return result;\n}\n\nInfTree.prototype.inflate_trees_dynamic = function(nl, nd, c, bl, bd, tl, td, hp, z) {\n var result;\n\n // build literal/length tree\n this.initWorkArea(288);\n this.hn[0]=0;\n result = this.huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, this.hn, this.v);\n if (result != Z_OK || bl[0] == 0){\n if(result == Z_DATA_ERROR){\n z.msg = \"oversubscribed literal/length tree\";\n }\n else if (result != Z_MEM_ERROR){\n z.msg = \"incomplete literal/length tree\";\n result = Z_DATA_ERROR;\n }\n return result;\n }\n\n // build distance tree\n this.initWorkArea(288);\n result = this.huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, this.hn, this.v);\n\n if (result != Z_OK || (bd[0] == 0 && nl > 257)){\n if (result == Z_DATA_ERROR){\n z.msg = \"oversubscribed distance tree\";\n }\n else if (result == Z_BUF_ERROR) {\n z.msg = \"incomplete distance tree\";\n result = Z_DATA_ERROR;\n }\n else if (result != Z_MEM_ERROR){\n z.msg = \"empty distance tree with lengths\";\n result = Z_DATA_ERROR;\n }\n return result;\n }\n\n return Z_OK;\n}\n/*\n static int inflate_trees_fixed(int[] bl, //literal desired/actual bit depth\n int[] bd, //distance desired/actual bit depth\n int[][] tl,//literal/length tree result\n int[][] td,//distance tree result \n ZStream z //for memory allocation\n\t\t\t\t ){\n\n*/\n\nfunction inflate_trees_fixed(bl, bd, tl, td, z) {\n bl[0]=fixed_bl;\n bd[0]=fixed_bd;\n tl[0]=fixed_tl;\n td[0]=fixed_td;\n return Z_OK;\n}\n\nInfTree.prototype.initWorkArea = function(vsize){\n if(this.hn==null){\n this.hn=new Int32Array(1);\n this.v=new Int32Array(vsize);\n this.c=new Int32Array(BMAX+1);\n this.r=new Int32Array(3);\n this.u=new Int32Array(BMAX);\n this.x=new Int32Array(BMAX+1);\n }\n if(this.v.length 100) {\n arrayCopy_fast(new Uint8Array(src.buffer, src.byteOffset + srcOffset, count), dest, destOffset);\n } else { \n arrayCopy_slow(src, srcOffset, dest, destOffset, count);\n }\n\n}\n\nfunction arrayCopy_slow(src, srcOffset, dest, destOffset, count) {\n\n // dlog('_slow call: srcOffset=' + srcOffset + '; destOffset=' + destOffset + '; count=' + count);\n\n for (var i = 0; i < count; ++i) {\n dest[destOffset + i] = src[srcOffset + i];\n }\n}\n\nfunction arrayCopy_fast(src, dest, destOffset) {\n dest.set(src, destOffset);\n}\n\n\n // largest prime smaller than 65536\nvar ADLER_BASE=65521; \n // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1\nvar ADLER_NMAX=5552;\n\nfunction adler32(adler, /* byte[] */ buf, index, len){\n if(buf == null){ return 1; }\n\n var s1=adler&0xffff;\n var s2=(adler>>16)&0xffff;\n var k;\n\n while(len > 0) {\n k=len=16){\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n s1+=buf[index++]&0xff; s2+=s1;\n k-=16;\n }\n if(k!=0){\n do{\n s1+=buf[index++]&0xff; s2+=s1;\n }\n while(--k!=0);\n }\n s1%=ADLER_BASE;\n s2%=ADLER_BASE;\n }\n return (s2<<16)|s1;\n}\n\n\n\nfunction jszlib_inflate_buffer(buffer, start, length, afterUncOffset) {\n if (!start) {\n buffer = new Uint8Array(buffer);\n } else if (!length) {\n buffer = new Uint8Array(buffer, start, buffer.byteLength - start);\n } else {\n buffer = new Uint8Array(buffer, start, length);\n }\n\n var z = new ZStream();\n z.inflateInit(DEF_WBITS, true);\n z.next_in = buffer;\n z.next_in_index = 0;\n z.avail_in = buffer.length;\n\n var oBlockList = [];\n var totalSize = 0;\n while (true) {\n var obuf = new Uint8Array(32000);\n z.next_out = obuf;\n z.next_out_index = 0;\n z.avail_out = obuf.length;\n var status = z.inflate(Z_NO_FLUSH);\n if (status != Z_OK && status != Z_STREAM_END && status != Z_BUF_ERROR) {\n throw z.msg;\n }\n if (z.avail_out != 0) {\n var newob = new Uint8Array(obuf.length - z.avail_out);\n arrayCopy(obuf, 0, newob, 0, (obuf.length - z.avail_out));\n obuf = newob;\n }\n oBlockList.push(obuf);\n totalSize += obuf.length;\n if (status == Z_STREAM_END || status == Z_BUF_ERROR) {\n break;\n }\n }\n\n if (afterUncOffset) {\n afterUncOffset[0] = (start || 0) + z.next_in_index;\n }\n\n if (oBlockList.length == 1) {\n return oBlockList[0].buffer;\n } else {\n var out = new Uint8Array(totalSize);\n var cursor = 0;\n for (var i = 0; i < oBlockList.length; ++i) {\n var b = oBlockList[i];\n arrayCopy(b, 0, out, cursor, b.length);\n cursor += b.length;\n }\n return out.buffer;\n }\n}\n\nif (typeof(module) !== 'undefined') {\n module.exports = {\n inflateBuffer: jszlib_inflate_buffer,\n arrayCopy: arrayCopy\n };\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","// Ramda v0.21.0\n// https://github.com/ramda/ramda\n// (c) 2013-2016 Scott Sauyet, Michael Hurley, and David Chambers\n// Ramda may be freely distributed under the MIT license.\n\n;(function() {\n\n 'use strict';\n\n /**\n * A special placeholder value used to specify \"gaps\" within curried functions,\n * allowing partial application of any combination of arguments, regardless of\n * their positions.\n *\n * If `g` is a curried ternary function and `_` is `R.__`, the following are\n * equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2, _)(1, 3)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @constant\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @example\n *\n * var greet = R.replace('{name}', R.__, 'Hello, {name}!');\n * greet('Alice'); //=> 'Hello, Alice!'\n */\n var __ = { '@@functional/placeholder': true };\n\n /* eslint-disable no-unused-vars */\n var _arity = function _arity(n, fn) {\n /* eslint-disable no-unused-vars */\n switch (n) {\n case 0:\n return function () {\n return fn.apply(this, arguments);\n };\n case 1:\n return function (a0) {\n return fn.apply(this, arguments);\n };\n case 2:\n return function (a0, a1) {\n return fn.apply(this, arguments);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.apply(this, arguments);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.apply(this, arguments);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.apply(this, arguments);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.apply(this, arguments);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.apply(this, arguments);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.apply(this, arguments);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.apply(this, arguments);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.apply(this, arguments);\n };\n default:\n throw new Error('First argument to _arity must be a non-negative integer no greater than ten');\n }\n };\n\n var _arrayFromIterator = function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n };\n\n var _arrayOf = function _arrayOf() {\n return Array.prototype.slice.call(arguments);\n };\n\n var _cloneRegExp = function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n };\n\n var _complement = function _complement(f) {\n return function () {\n return !f.apply(this, arguments);\n };\n };\n\n /**\n * Private `concat` function to merge two array-like objects.\n *\n * @private\n * @param {Array|Arguments} [set1=[]] An array-like object.\n * @param {Array|Arguments} [set2=[]] An array-like object.\n * @return {Array} A new, merged array.\n * @example\n *\n * _concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]\n */\n var _concat = function _concat(set1, set2) {\n set1 = set1 || [];\n set2 = set2 || [];\n var idx;\n var len1 = set1.length;\n var len2 = set2.length;\n var result = [];\n idx = 0;\n while (idx < len1) {\n result[result.length] = set1[idx];\n idx += 1;\n }\n idx = 0;\n while (idx < len2) {\n result[result.length] = set2[idx];\n idx += 1;\n }\n return result;\n };\n\n var _containsWith = function _containsWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n };\n\n var _filter = function _filter(fn, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n while (idx < len) {\n if (fn(list[idx])) {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n return result;\n };\n\n var _forceReduced = function _forceReduced(x) {\n return {\n '@@transducer/value': x,\n '@@transducer/reduced': true\n };\n };\n\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var _functionName = function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n };\n\n var _has = function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n };\n\n var _identity = function _identity(x) {\n return x;\n };\n\n var _isArguments = function () {\n var toString = Object.prototype.toString;\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n }();\n\n /**\n * Tests whether or not an object is an array.\n *\n * @private\n * @param {*} val The object to test.\n * @return {Boolean} `true` if `val` is an array, `false` otherwise.\n * @example\n *\n * _isArray([]); //=> true\n * _isArray(null); //=> false\n * _isArray({}); //=> false\n */\n var _isArray = Array.isArray || function _isArray(val) {\n return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';\n };\n\n var _isFunction = function _isNumber(x) {\n return Object.prototype.toString.call(x) === '[object Function]';\n };\n\n /**\n * Determine if the passed argument is an integer.\n *\n * @private\n * @param {*} n\n * @category Type\n * @return {Boolean}\n */\n var _isInteger = Number.isInteger || function _isInteger(n) {\n return n << 0 === n;\n };\n\n var _isNumber = function _isNumber(x) {\n return Object.prototype.toString.call(x) === '[object Number]';\n };\n\n var _isObject = function _isObject(x) {\n return Object.prototype.toString.call(x) === '[object Object]';\n };\n\n var _isPlaceholder = function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n };\n\n var _isRegExp = function _isRegExp(x) {\n return Object.prototype.toString.call(x) === '[object RegExp]';\n };\n\n var _isString = function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n };\n\n var _isTransformer = function _isTransformer(obj) {\n return typeof obj['@@transducer/step'] === 'function';\n };\n\n var _map = function _map(fn, functor) {\n var idx = 0;\n var len = functor.length;\n var result = Array(len);\n while (idx < len) {\n result[idx] = fn(functor[idx]);\n idx += 1;\n }\n return result;\n };\n\n // Based on https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n var _objectAssign = function _objectAssign(target) {\n if (target == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n var output = Object(target);\n var idx = 1;\n var length = arguments.length;\n while (idx < length) {\n var source = arguments[idx];\n if (source != null) {\n for (var nextKey in source) {\n if (_has(nextKey, source)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n idx += 1;\n }\n return output;\n };\n\n var _of = function _of(x) {\n return [x];\n };\n\n var _pipe = function _pipe(f, g) {\n return function () {\n return g.call(this, f.apply(this, arguments));\n };\n };\n\n var _pipeP = function _pipeP(f, g) {\n return function () {\n var ctx = this;\n return f.apply(ctx, arguments).then(function (x) {\n return g.call(ctx, x);\n });\n };\n };\n\n // \\b matches word boundary; [\\b] matches backspace\n var _quote = function _quote(s) {\n var escaped = s.replace(/\\\\/g, '\\\\\\\\').replace(/[\\b]/g, '\\\\b') // \\b matches word boundary; [\\b] matches backspace\n .replace(/\\f/g, '\\\\f').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t').replace(/\\v/g, '\\\\v').replace(/\\0/g, '\\\\0');\n return '\"' + escaped.replace(/\"/g, '\\\\\"') + '\"';\n };\n\n var _reduced = function _reduced(x) {\n return x && x['@@transducer/reduced'] ? x : {\n '@@transducer/value': x,\n '@@transducer/reduced': true\n };\n };\n\n /**\n * An optimized, private array `slice` implementation.\n *\n * @private\n * @param {Arguments|Array} args The array or arguments object to consider.\n * @param {Number} [from=0] The array index to slice from, inclusive.\n * @param {Number} [to=args.length] The array index to slice to, exclusive.\n * @return {Array} A new, sliced array.\n * @example\n *\n * _slice([1, 2, 3, 4, 5], 1, 3); //=> [2, 3]\n *\n * var firstThreeArgs = function(a, b, c, d) {\n * return _slice(arguments, 0, 3);\n * };\n * firstThreeArgs(1, 2, 3, 4); //=> [1, 2, 3]\n */\n var _slice = function _slice(args, from, to) {\n switch (arguments.length) {\n case 1:\n return _slice(args, 0, args.length);\n case 2:\n return _slice(args, from, args.length);\n default:\n var list = [];\n var idx = 0;\n var len = Math.max(0, Math.min(args.length, to) - from);\n while (idx < len) {\n list[idx] = args[from + idx];\n idx += 1;\n }\n return list;\n }\n };\n\n /**\n * Polyfill from .\n */\n var _toISOString = function () {\n var pad = function pad(n) {\n return (n < 10 ? '0' : '') + n;\n };\n return typeof Date.prototype.toISOString === 'function' ? function _toISOString(d) {\n return d.toISOString();\n } : function _toISOString(d) {\n return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + 'Z';\n };\n }();\n\n var _xfBase = {\n init: function () {\n return this.xf['@@transducer/init']();\n },\n result: function (result) {\n return this.xf['@@transducer/result'](result);\n }\n };\n\n var _xwrap = function () {\n function XWrap(fn) {\n this.f = fn;\n }\n XWrap.prototype['@@transducer/init'] = function () {\n throw new Error('init not implemented on XWrap');\n };\n XWrap.prototype['@@transducer/result'] = function (acc) {\n return acc;\n };\n XWrap.prototype['@@transducer/step'] = function (acc, x) {\n return this.f(acc, x);\n };\n return function _xwrap(fn) {\n return new XWrap(fn);\n };\n }();\n\n var _aperture = function _aperture(n, list) {\n var idx = 0;\n var limit = list.length - (n - 1);\n var acc = new Array(limit >= 0 ? limit : 0);\n while (idx < limit) {\n acc[idx] = _slice(list, idx, idx + n);\n idx += 1;\n }\n return acc;\n };\n\n var _assign = typeof Object.assign === 'function' ? Object.assign : _objectAssign;\n\n /**\n * Similar to hasMethod, this checks whether a function has a [methodname]\n * function. If it isn't an array it will execute that function otherwise it\n * will default to the ramda implementation.\n *\n * @private\n * @param {Function} fn ramda implemtation\n * @param {String} methodname property to check for a custom implementation\n * @return {Object} Whatever the return value of the method is.\n */\n var _checkForMethod = function _checkForMethod(methodname, fn) {\n return function () {\n var length = arguments.length;\n if (length === 0) {\n return fn();\n }\n var obj = arguments[length - 1];\n return _isArray(obj) || typeof obj[methodname] !== 'function' ? fn.apply(this, arguments) : obj[methodname].apply(obj, _slice(arguments, 0, length - 1));\n };\n };\n\n /**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry1 = function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n };\n\n /**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry2 = function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n };\n\n /**\n * Optimized internal three-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curry3 = function _curry3(fn) {\n return function f3(a, b, c) {\n switch (arguments.length) {\n case 0:\n return f3;\n case 1:\n return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n });\n case 2:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _curry1(function (_c) {\n return fn(a, b, _c);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {\n return fn(_a, _b, c);\n }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b, c);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b, c);\n }) : _isPlaceholder(c) ? _curry1(function (_c) {\n return fn(a, b, _c);\n }) : fn(a, b, c);\n }\n };\n };\n\n /**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Number} length The arity of the curried function.\n * @param {Array} received An array of arguments received thus far.\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\n var _curryN = function _curryN(length, received, fn) {\n return function () {\n var combined = [];\n var argsIdx = 0;\n var left = length;\n var combinedIdx = 0;\n while (combinedIdx < received.length || argsIdx < arguments.length) {\n var result;\n if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {\n result = received[combinedIdx];\n } else {\n result = arguments[argsIdx];\n argsIdx += 1;\n }\n combined[combinedIdx] = result;\n if (!_isPlaceholder(result)) {\n left -= 1;\n }\n combinedIdx += 1;\n }\n return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));\n };\n };\n\n /**\n * Returns a function that dispatches with different strategies based on the\n * object in list position (last argument). If it is an array, executes [fn].\n * Otherwise, if it has a function with [methodname], it will execute that\n * function (functor case). Otherwise, if it is a transformer, uses transducer\n * [xf] to return a new transformer (transducer case). Otherwise, it will\n * default to executing [fn].\n *\n * @private\n * @param {String} methodname property to check for a custom implementation\n * @param {Function} xf transducer to initialize if object is transformer\n * @param {Function} fn default ramda implementation\n * @return {Function} A function that dispatches on object in list position\n */\n var _dispatchable = function _dispatchable(methodname, xf, fn) {\n return function () {\n var length = arguments.length;\n if (length === 0) {\n return fn();\n }\n var obj = arguments[length - 1];\n if (!_isArray(obj)) {\n var args = _slice(arguments, 0, length - 1);\n if (typeof obj[methodname] === 'function') {\n return obj[methodname].apply(obj, args);\n }\n if (_isTransformer(obj)) {\n var transducer = xf.apply(null, args);\n return transducer(obj);\n }\n }\n return fn.apply(this, arguments);\n };\n };\n\n var _dropLastWhile = function dropLastWhile(pred, list) {\n var idx = list.length - 1;\n while (idx >= 0 && pred(list[idx])) {\n idx -= 1;\n }\n return _slice(list, 0, idx + 1);\n };\n\n var _xall = function () {\n function XAll(f, xf) {\n this.xf = xf;\n this.f = f;\n this.all = true;\n }\n XAll.prototype['@@transducer/init'] = _xfBase.init;\n XAll.prototype['@@transducer/result'] = function (result) {\n if (this.all) {\n result = this.xf['@@transducer/step'](result, true);\n }\n return this.xf['@@transducer/result'](result);\n };\n XAll.prototype['@@transducer/step'] = function (result, input) {\n if (!this.f(input)) {\n this.all = false;\n result = _reduced(this.xf['@@transducer/step'](result, false));\n }\n return result;\n };\n return _curry2(function _xall(f, xf) {\n return new XAll(f, xf);\n });\n }();\n\n var _xany = function () {\n function XAny(f, xf) {\n this.xf = xf;\n this.f = f;\n this.any = false;\n }\n XAny.prototype['@@transducer/init'] = _xfBase.init;\n XAny.prototype['@@transducer/result'] = function (result) {\n if (!this.any) {\n result = this.xf['@@transducer/step'](result, false);\n }\n return this.xf['@@transducer/result'](result);\n };\n XAny.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.any = true;\n result = _reduced(this.xf['@@transducer/step'](result, true));\n }\n return result;\n };\n return _curry2(function _xany(f, xf) {\n return new XAny(f, xf);\n });\n }();\n\n var _xaperture = function () {\n function XAperture(n, xf) {\n this.xf = xf;\n this.pos = 0;\n this.full = false;\n this.acc = new Array(n);\n }\n XAperture.prototype['@@transducer/init'] = _xfBase.init;\n XAperture.prototype['@@transducer/result'] = function (result) {\n this.acc = null;\n return this.xf['@@transducer/result'](result);\n };\n XAperture.prototype['@@transducer/step'] = function (result, input) {\n this.store(input);\n return this.full ? this.xf['@@transducer/step'](result, this.getCopy()) : result;\n };\n XAperture.prototype.store = function (input) {\n this.acc[this.pos] = input;\n this.pos += 1;\n if (this.pos === this.acc.length) {\n this.pos = 0;\n this.full = true;\n }\n };\n XAperture.prototype.getCopy = function () {\n return _concat(_slice(this.acc, this.pos), _slice(this.acc, 0, this.pos));\n };\n return _curry2(function _xaperture(n, xf) {\n return new XAperture(n, xf);\n });\n }();\n\n var _xdrop = function () {\n function XDrop(n, xf) {\n this.xf = xf;\n this.n = n;\n }\n XDrop.prototype['@@transducer/init'] = _xfBase.init;\n XDrop.prototype['@@transducer/result'] = _xfBase.result;\n XDrop.prototype['@@transducer/step'] = function (result, input) {\n if (this.n > 0) {\n this.n -= 1;\n return result;\n }\n return this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdrop(n, xf) {\n return new XDrop(n, xf);\n });\n }();\n\n var _xdropLast = function () {\n function XDropLast(n, xf) {\n this.xf = xf;\n this.pos = 0;\n this.full = false;\n this.acc = new Array(n);\n }\n XDropLast.prototype['@@transducer/init'] = _xfBase.init;\n XDropLast.prototype['@@transducer/result'] = function (result) {\n this.acc = null;\n return this.xf['@@transducer/result'](result);\n };\n XDropLast.prototype['@@transducer/step'] = function (result, input) {\n if (this.full) {\n result = this.xf['@@transducer/step'](result, this.acc[this.pos]);\n }\n this.store(input);\n return result;\n };\n XDropLast.prototype.store = function (input) {\n this.acc[this.pos] = input;\n this.pos += 1;\n if (this.pos === this.acc.length) {\n this.pos = 0;\n this.full = true;\n }\n };\n return _curry2(function _xdropLast(n, xf) {\n return new XDropLast(n, xf);\n });\n }();\n\n var _xdropRepeatsWith = function () {\n function XDropRepeatsWith(pred, xf) {\n this.xf = xf;\n this.pred = pred;\n this.lastValue = undefined;\n this.seenFirstValue = false;\n }\n XDropRepeatsWith.prototype['@@transducer/init'] = function () {\n return this.xf['@@transducer/init']();\n };\n XDropRepeatsWith.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](result);\n };\n XDropRepeatsWith.prototype['@@transducer/step'] = function (result, input) {\n var sameAsLast = false;\n if (!this.seenFirstValue) {\n this.seenFirstValue = true;\n } else if (this.pred(this.lastValue, input)) {\n sameAsLast = true;\n }\n this.lastValue = input;\n return sameAsLast ? result : this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdropRepeatsWith(pred, xf) {\n return new XDropRepeatsWith(pred, xf);\n });\n }();\n\n var _xdropWhile = function () {\n function XDropWhile(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XDropWhile.prototype['@@transducer/init'] = _xfBase.init;\n XDropWhile.prototype['@@transducer/result'] = _xfBase.result;\n XDropWhile.prototype['@@transducer/step'] = function (result, input) {\n if (this.f) {\n if (this.f(input)) {\n return result;\n }\n this.f = null;\n }\n return this.xf['@@transducer/step'](result, input);\n };\n return _curry2(function _xdropWhile(f, xf) {\n return new XDropWhile(f, xf);\n });\n }();\n\n var _xfilter = function () {\n function XFilter(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XFilter.prototype['@@transducer/init'] = _xfBase.init;\n XFilter.prototype['@@transducer/result'] = _xfBase.result;\n XFilter.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.xf['@@transducer/step'](result, input) : result;\n };\n return _curry2(function _xfilter(f, xf) {\n return new XFilter(f, xf);\n });\n }();\n\n var _xfind = function () {\n function XFind(f, xf) {\n this.xf = xf;\n this.f = f;\n this.found = false;\n }\n XFind.prototype['@@transducer/init'] = _xfBase.init;\n XFind.prototype['@@transducer/result'] = function (result) {\n if (!this.found) {\n result = this.xf['@@transducer/step'](result, void 0);\n }\n return this.xf['@@transducer/result'](result);\n };\n XFind.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.found = true;\n result = _reduced(this.xf['@@transducer/step'](result, input));\n }\n return result;\n };\n return _curry2(function _xfind(f, xf) {\n return new XFind(f, xf);\n });\n }();\n\n var _xfindIndex = function () {\n function XFindIndex(f, xf) {\n this.xf = xf;\n this.f = f;\n this.idx = -1;\n this.found = false;\n }\n XFindIndex.prototype['@@transducer/init'] = _xfBase.init;\n XFindIndex.prototype['@@transducer/result'] = function (result) {\n if (!this.found) {\n result = this.xf['@@transducer/step'](result, -1);\n }\n return this.xf['@@transducer/result'](result);\n };\n XFindIndex.prototype['@@transducer/step'] = function (result, input) {\n this.idx += 1;\n if (this.f(input)) {\n this.found = true;\n result = _reduced(this.xf['@@transducer/step'](result, this.idx));\n }\n return result;\n };\n return _curry2(function _xfindIndex(f, xf) {\n return new XFindIndex(f, xf);\n });\n }();\n\n var _xfindLast = function () {\n function XFindLast(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XFindLast.prototype['@@transducer/init'] = _xfBase.init;\n XFindLast.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.last));\n };\n XFindLast.prototype['@@transducer/step'] = function (result, input) {\n if (this.f(input)) {\n this.last = input;\n }\n return result;\n };\n return _curry2(function _xfindLast(f, xf) {\n return new XFindLast(f, xf);\n });\n }();\n\n var _xfindLastIndex = function () {\n function XFindLastIndex(f, xf) {\n this.xf = xf;\n this.f = f;\n this.idx = -1;\n this.lastIdx = -1;\n }\n XFindLastIndex.prototype['@@transducer/init'] = _xfBase.init;\n XFindLastIndex.prototype['@@transducer/result'] = function (result) {\n return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.lastIdx));\n };\n XFindLastIndex.prototype['@@transducer/step'] = function (result, input) {\n this.idx += 1;\n if (this.f(input)) {\n this.lastIdx = this.idx;\n }\n return result;\n };\n return _curry2(function _xfindLastIndex(f, xf) {\n return new XFindLastIndex(f, xf);\n });\n }();\n\n var _xmap = function () {\n function XMap(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XMap.prototype['@@transducer/init'] = _xfBase.init;\n XMap.prototype['@@transducer/result'] = _xfBase.result;\n XMap.prototype['@@transducer/step'] = function (result, input) {\n return this.xf['@@transducer/step'](result, this.f(input));\n };\n return _curry2(function _xmap(f, xf) {\n return new XMap(f, xf);\n });\n }();\n\n var _xtake = function () {\n function XTake(n, xf) {\n this.xf = xf;\n this.n = n;\n }\n XTake.prototype['@@transducer/init'] = _xfBase.init;\n XTake.prototype['@@transducer/result'] = _xfBase.result;\n XTake.prototype['@@transducer/step'] = function (result, input) {\n if (this.n === 0) {\n return _reduced(result);\n } else {\n this.n -= 1;\n return this.xf['@@transducer/step'](result, input);\n }\n };\n return _curry2(function _xtake(n, xf) {\n return new XTake(n, xf);\n });\n }();\n\n var _xtakeWhile = function () {\n function XTakeWhile(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XTakeWhile.prototype['@@transducer/init'] = _xfBase.init;\n XTakeWhile.prototype['@@transducer/result'] = _xfBase.result;\n XTakeWhile.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.xf['@@transducer/step'](result, input) : _reduced(result);\n };\n return _curry2(function _xtakeWhile(f, xf) {\n return new XTakeWhile(f, xf);\n });\n }();\n\n /**\n * Adds two values.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a\n * @param {Number} b\n * @return {Number}\n * @see R.subtract\n * @example\n *\n * R.add(2, 3); //=> 5\n * R.add(7)(10); //=> 17\n */\n var add = _curry2(function add(a, b) {\n return Number(a) + Number(b);\n });\n\n /**\n * Applies a function to the value at the given index of an array, returning a\n * new copy of the array with the element at the given index replaced with the\n * result of the function application.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig (a -> a) -> Number -> [a] -> [a]\n * @param {Function} fn The function to apply.\n * @param {Number} idx The index.\n * @param {Array|Arguments} list An array-like object whose value\n * at the supplied index will be replaced.\n * @return {Array} A copy of the supplied array-like object with\n * the element at index `idx` replaced with the value\n * returned by applying `fn` to the existing element.\n * @see R.update\n * @example\n *\n * R.adjust(R.add(10), 1, [0, 1, 2]); //=> [0, 11, 2]\n * R.adjust(R.add(10))(1)([0, 1, 2]); //=> [0, 11, 2]\n */\n var adjust = _curry3(function adjust(fn, idx, list) {\n if (idx >= list.length || idx < -list.length) {\n return list;\n }\n var start = idx < 0 ? list.length : 0;\n var _idx = start + idx;\n var _list = _concat(list);\n _list[_idx] = fn(list[_idx]);\n return _list;\n });\n\n /**\n * Returns `true` if all elements of the list match the predicate, `false` if\n * there are any that don't.\n *\n * Dispatches to the `all` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is satisfied by every element, `false`\n * otherwise.\n * @see R.any, R.none, R.transduce\n * @example\n *\n * var lessThan2 = R.flip(R.lt)(2);\n * var lessThan3 = R.flip(R.lt)(3);\n * R.all(lessThan2)([1, 2]); //=> false\n * R.all(lessThan3)([1, 2]); //=> true\n */\n var all = _curry2(_dispatchable('all', _xall, function all(fn, list) {\n var idx = 0;\n while (idx < list.length) {\n if (!fn(list[idx])) {\n return false;\n }\n idx += 1;\n }\n return true;\n }));\n\n /**\n * Returns a function that always returns the given value. Note that for\n * non-primitives the value returned is a reference to the original value.\n *\n * This function is known as `const`, `constant`, or `K` (for K combinator) in\n * other languages and libraries.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> (* -> a)\n * @param {*} val The value to wrap in a function\n * @return {Function} A Function :: * -> val.\n * @example\n *\n * var t = R.always('Tee');\n * t(); //=> 'Tee'\n */\n var always = _curry1(function always(val) {\n return function () {\n return val;\n };\n });\n\n /**\n * Returns `true` if both arguments are `true`; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> * -> *\n * @param {Boolean} a A boolean value\n * @param {Boolean} b A boolean value\n * @return {Boolean} `true` if both arguments are `true`, `false` otherwise\n * @see R.both\n * @example\n *\n * R.and(true, true); //=> true\n * R.and(true, false); //=> false\n * R.and(false, true); //=> false\n * R.and(false, false); //=> false\n */\n var and = _curry2(function and(a, b) {\n return a && b;\n });\n\n /**\n * Returns `true` if at least one of elements of the list match the predicate,\n * `false` otherwise.\n *\n * Dispatches to the `any` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is satisfied by at least one element, `false`\n * otherwise.\n * @see R.all, R.none, R.transduce\n * @example\n *\n * var lessThan0 = R.flip(R.lt)(0);\n * var lessThan2 = R.flip(R.lt)(2);\n * R.any(lessThan0)([1, 2]); //=> false\n * R.any(lessThan2)([1, 2]); //=> true\n */\n var any = _curry2(_dispatchable('any', _xany, function any(fn, list) {\n var idx = 0;\n while (idx < list.length) {\n if (fn(list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n }));\n\n /**\n * Returns a new list, composed of n-tuples of consecutive elements If `n` is\n * greater than the length of the list, an empty list is returned.\n *\n * Dispatches to the `aperture` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig Number -> [a] -> [[a]]\n * @param {Number} n The size of the tuples to create\n * @param {Array} list The list to split into `n`-tuples\n * @return {Array} The new list.\n * @see R.transduce\n * @example\n *\n * R.aperture(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [2, 3], [3, 4], [4, 5]]\n * R.aperture(3, [1, 2, 3, 4, 5]); //=> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]\n * R.aperture(7, [1, 2, 3, 4, 5]); //=> []\n */\n var aperture = _curry2(_dispatchable('aperture', _xaperture, _aperture));\n\n /**\n * Returns a new list containing the contents of the given list, followed by\n * the given element.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} el The element to add to the end of the new list.\n * @param {Array} list The list whose contents will be added to the beginning of the output\n * list.\n * @return {Array} A new list containing the contents of the old list followed by `el`.\n * @see R.prepend\n * @example\n *\n * R.append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']\n * R.append('tests', []); //=> ['tests']\n * R.append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]\n */\n var append = _curry2(function append(el, list) {\n return _concat(list, [el]);\n });\n\n /**\n * Applies function `fn` to the argument list `args`. This is useful for\n * creating a fixed-arity function from a variadic function. `fn` should be a\n * bound function if context is significant.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig (*... -> a) -> [*] -> a\n * @param {Function} fn\n * @param {Array} args\n * @return {*}\n * @see R.call, R.unapply\n * @example\n *\n * var nums = [1, 2, 3, -99, 42, 6, 7];\n * R.apply(Math.max, nums); //=> 42\n */\n var apply = _curry2(function apply(fn, args) {\n return fn.apply(this, args);\n });\n\n /**\n * Makes a shallow clone of an object, setting or overriding the specified\n * property with the given value. Note that this copies and flattens prototype\n * properties onto the new object as well. All non-primitive properties are\n * copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig String -> a -> {k: v} -> {k: v}\n * @param {String} prop the property name to set\n * @param {*} val the new value\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original except for the specified property.\n * @see R.dissoc\n * @example\n *\n * R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}\n */\n var assoc = _curry3(function assoc(prop, val, obj) {\n var result = {};\n for (var p in obj) {\n result[p] = obj[p];\n }\n result[prop] = val;\n return result;\n });\n\n /**\n * Makes a shallow clone of an object, setting or overriding the nodes required\n * to create the given path, and placing the specific value at the tail end of\n * that path. Note that this copies and flattens prototype properties onto the\n * new object as well. All non-primitive properties are copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig [String] -> a -> {k: v} -> {k: v}\n * @param {Array} path the path to set\n * @param {*} val the new value\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original except along the specified path.\n * @see R.dissocPath\n * @example\n *\n * R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}\n */\n var assocPath = _curry3(function assocPath(path, val, obj) {\n switch (path.length) {\n case 0:\n return val;\n case 1:\n return assoc(path[0], val, obj);\n default:\n return assoc(path[0], assocPath(_slice(path, 1), val, Object(obj[path[0]])), obj);\n }\n });\n\n /**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n */\n var bind = _curry2(function bind(fn, thisObj) {\n return _arity(fn.length, function () {\n return fn.apply(thisObj, arguments);\n });\n });\n\n /**\n * Restricts a number to be within a range.\n *\n * Also works for other ordered types such as Strings and Dates.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Relation\n * @sig Ord a => a -> a -> a -> a\n * @param {Number} minimum number\n * @param {Number} maximum number\n * @param {Number} value to be clamped\n * @return {Number} Returns the clamped value\n * @example\n *\n * R.clamp(1, 10, -1) // => 1\n * R.clamp(1, 10, 11) // => 10\n * R.clamp(1, 10, 4) // => 4\n */\n var clamp = _curry3(function clamp(min, max, value) {\n if (min > max) {\n throw new Error('min must not be greater than max in clamp(min, max, value)');\n }\n return value < min ? min : value > max ? max : value;\n });\n\n /**\n * Makes a comparator function out of a function that reports whether the first\n * element is less than the second.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a, b -> Boolean) -> (a, b -> Number)\n * @param {Function} pred A predicate function of arity two.\n * @return {Function} A Function :: a -> b -> Int that returns `-1` if a < b, `1` if b < a, otherwise `0`.\n * @example\n *\n * var cmp = R.comparator((a, b) => a.age < b.age);\n * var people = [\n * // ...\n * ];\n * R.sort(cmp, people);\n */\n var comparator = _curry1(function comparator(pred) {\n return function (a, b) {\n return pred(a, b) ? -1 : pred(b, a) ? 1 : 0;\n };\n });\n\n /**\n * Returns a curried equivalent of the provided function, with the specified\n * arity. The curried function has two unusual capabilities. First, its\n * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value `R.__` may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is `R.__`, the\n * following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curry\n * @example\n *\n * var sumArgs = (...args) => R.sum(args);\n *\n * var curriedAddFourNumbers = R.curryN(4, sumArgs);\n * var f = curriedAddFourNumbers(1, 2);\n * var g = f(3);\n * g(4); //=> 10\n */\n var curryN = _curry2(function curryN(length, fn) {\n if (length === 1) {\n return _curry1(fn);\n }\n return _arity(length, _curryN(length, [], fn));\n });\n\n /**\n * Decrements its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @see R.inc\n * @example\n *\n * R.dec(42); //=> 41\n */\n var dec = add(-1);\n\n /**\n * Returns the second argument if it is not `null`, `undefined` or `NaN`\n * otherwise the first argument is returned.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Logic\n * @sig a -> b -> a | b\n * @param {a} val The default value.\n * @param {b} val The value to return if it is not null or undefined\n * @return {*} The the second value or the default value\n * @example\n *\n * var defaultTo42 = R.defaultTo(42);\n *\n * defaultTo42(null); //=> 42\n * defaultTo42(undefined); //=> 42\n * defaultTo42('Ramda'); //=> 'Ramda'\n * defaultTo42(parseInt('string')); //=> 42\n */\n var defaultTo = _curry2(function defaultTo(d, v) {\n return v == null || v !== v ? d : v;\n });\n\n /**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list. Duplication is determined according to the\n * value returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.difference\n * @example\n *\n * var cmp = (x, y) => x.a === y.a;\n * var l1 = [{a: 1}, {a: 2}, {a: 3}];\n * var l2 = [{a: 3}, {a: 4}];\n * R.differenceWith(cmp, l1, l2); //=> [{a: 1}, {a: 2}]\n */\n var differenceWith = _curry3(function differenceWith(pred, first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n while (idx < firstLen) {\n if (!_containsWith(pred, first[idx], second) && !_containsWith(pred, first[idx], out)) {\n out.push(first[idx]);\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new object that does not contain a `prop` property.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Object\n * @sig String -> {k: v} -> {k: v}\n * @param {String} prop the name of the property to dissociate\n * @param {Object} obj the object to clone\n * @return {Object} a new object similar to the original but without the specified property\n * @see R.assoc\n * @example\n *\n * R.dissoc('b', {a: 1, b: 2, c: 3}); //=> {a: 1, c: 3}\n */\n var dissoc = _curry2(function dissoc(prop, obj) {\n var result = {};\n for (var p in obj) {\n if (p !== prop) {\n result[p] = obj[p];\n }\n }\n return result;\n });\n\n /**\n * Makes a shallow clone of an object, omitting the property at the given path.\n * Note that this copies and flattens prototype properties onto the new object\n * as well. All non-primitive properties are copied by reference.\n *\n * @func\n * @memberOf R\n * @since v0.11.0\n * @category Object\n * @sig [String] -> {k: v} -> {k: v}\n * @param {Array} path the path to set\n * @param {Object} obj the object to clone\n * @return {Object} a new object without the property at path\n * @see R.assocPath\n * @example\n *\n * R.dissocPath(['a', 'b', 'c'], {a: {b: {c: 42}}}); //=> {a: {b: {}}}\n */\n var dissocPath = _curry2(function dissocPath(path, obj) {\n switch (path.length) {\n case 0:\n return obj;\n case 1:\n return dissoc(path[0], obj);\n default:\n var head = path[0];\n var tail = _slice(path, 1);\n return obj[head] == null ? obj : assoc(head, dissocPath(tail, obj[head]), obj);\n }\n });\n\n /**\n * Divides two numbers. Equivalent to `a / b`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a / b`.\n * @see R.multiply\n * @example\n *\n * R.divide(71, 100); //=> 0.71\n *\n * var half = R.divide(R.__, 2);\n * half(42); //=> 21\n *\n * var reciprocal = R.divide(1);\n * reciprocal(4); //=> 0.25\n */\n var divide = _curry2(function divide(a, b) {\n return a / b;\n });\n\n /**\n * Returns a new list containing the last `n` elements of a given list, passing\n * each value to the supplied predicate function, skipping elements while the\n * predicate function returns `true`. The predicate function is passed one\n * argument: *(value)*.\n *\n * Dispatches to the `dropWhile` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.takeWhile, R.transduce, R.addIndex\n * @example\n *\n * var lteTwo = x => x <= 2;\n *\n * R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]\n */\n var dropWhile = _curry2(_dispatchable('dropWhile', _xdropWhile, function dropWhile(pred, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len && pred(list[idx])) {\n idx += 1;\n }\n return _slice(list, idx);\n }));\n\n /**\n * Returns the empty value of its argument's type. Ramda defines the empty\n * value of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other\n * types are supported if they define `.empty` and/or\n * `.prototype.empty`.\n *\n * Dispatches to the `empty` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig a -> a\n * @param {*} x\n * @return {*}\n * @example\n *\n * R.empty(Just(42)); //=> Nothing()\n * R.empty([1, 2, 3]); //=> []\n * R.empty('unicorns'); //=> ''\n * R.empty({x: 1, y: 2}); //=> {}\n */\n // else\n var empty = _curry1(function empty(x) {\n return x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {\n return arguments;\n }() : // else\n void 0;\n });\n\n /**\n * Creates a new object by recursively evolving a shallow copy of `object`,\n * according to the `transformation` functions. All non-primitive properties\n * are copied by reference.\n *\n * A `transformation` function will not be invoked if its corresponding key\n * does not exist in the evolved object.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {k: (v -> v)} -> {k: v} -> {k: v}\n * @param {Object} transformations The object specifying transformation functions to apply\n * to the object.\n * @param {Object} object The object to be transformed.\n * @return {Object} The transformed object.\n * @example\n *\n * var tomato = {firstName: ' Tomato ', data: {elapsed: 100, remaining: 1400}, id:123};\n * var transformations = {\n * firstName: R.trim,\n * lastName: R.trim, // Will not get invoked.\n * data: {elapsed: R.add(1), remaining: R.add(-1)}\n * };\n * R.evolve(transformations, tomato); //=> {firstName: 'Tomato', data: {elapsed: 101, remaining: 1399}, id:123}\n */\n var evolve = _curry2(function evolve(transformations, object) {\n var result = {};\n var transformation, key, type;\n for (key in object) {\n transformation = transformations[key];\n type = typeof transformation;\n result[key] = type === 'function' ? transformation(object[key]) : type === 'object' ? evolve(transformations[key], object[key]) : object[key];\n }\n return result;\n });\n\n /**\n * Returns the first element of the list which matches the predicate, or\n * `undefined` if no element matches.\n *\n * Dispatches to the `find` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> a | undefined\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Object} The element found, or `undefined`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1}, {a: 2}, {a: 3}];\n * R.find(R.propEq('a', 2))(xs); //=> {a: 2}\n * R.find(R.propEq('a', 4))(xs); //=> undefined\n */\n var find = _curry2(_dispatchable('find', _xfind, function find(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (fn(list[idx])) {\n return list[idx];\n }\n idx += 1;\n }\n }));\n\n /**\n * Returns the index of the first element of the list which matches the\n * predicate, or `-1` if no element matches.\n *\n * Dispatches to the `findIndex` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> Number\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Number} The index of the element found, or `-1`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1}, {a: 2}, {a: 3}];\n * R.findIndex(R.propEq('a', 2))(xs); //=> 1\n * R.findIndex(R.propEq('a', 4))(xs); //=> -1\n */\n var findIndex = _curry2(_dispatchable('findIndex', _xfindIndex, function findIndex(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n if (fn(list[idx])) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }));\n\n /**\n * Returns the last element of the list which matches the predicate, or\n * `undefined` if no element matches.\n *\n * Dispatches to the `findLast` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> a | undefined\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Object} The element found, or `undefined`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1, b: 0}, {a:1, b: 1}];\n * R.findLast(R.propEq('a', 1))(xs); //=> {a: 1, b: 1}\n * R.findLast(R.propEq('a', 4))(xs); //=> undefined\n */\n var findLast = _curry2(_dispatchable('findLast', _xfindLast, function findLast(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n if (fn(list[idx])) {\n return list[idx];\n }\n idx -= 1;\n }\n }));\n\n /**\n * Returns the index of the last element of the list which matches the\n * predicate, or `-1` if no element matches.\n *\n * Dispatches to the `findLastIndex` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> Boolean) -> [a] -> Number\n * @param {Function} fn The predicate function used to determine if the element is the\n * desired one.\n * @param {Array} list The array to consider.\n * @return {Number} The index of the element found, or `-1`.\n * @see R.transduce\n * @example\n *\n * var xs = [{a: 1, b: 0}, {a:1, b: 1}];\n * R.findLastIndex(R.propEq('a', 1))(xs); //=> 1\n * R.findLastIndex(R.propEq('a', 4))(xs); //=> -1\n */\n var findLastIndex = _curry2(_dispatchable('findLastIndex', _xfindLastIndex, function findLastIndex(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n if (fn(list[idx])) {\n return idx;\n }\n idx -= 1;\n }\n return -1;\n }));\n\n /**\n * Iterate over an input `list`, calling a provided function `fn` for each\n * element in the list.\n *\n * `fn` receives one argument: *(value)*.\n *\n * Note: `R.forEach` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.forEach` method. For more\n * details on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description\n *\n * Also note that, unlike `Array.prototype.forEach`, Ramda's `forEach` returns\n * the original array. In some libraries this function is named `each`.\n *\n * Dispatches to the `forEach` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig (a -> *) -> [a] -> [a]\n * @param {Function} fn The function to invoke. Receives one argument, `value`.\n * @param {Array} list The list to iterate over.\n * @return {Array} The original list.\n * @see R.addIndex\n * @example\n *\n * var printXPlusFive = x => console.log(x + 5);\n * R.forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]\n * //-> 6\n * //-> 7\n * //-> 8\n */\n var forEach = _curry2(_checkForMethod('forEach', function forEach(fn, list) {\n var len = list.length;\n var idx = 0;\n while (idx < len) {\n fn(list[idx]);\n idx += 1;\n }\n return list;\n }));\n\n /**\n * Creates a new object out of a list key-value pairs.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [[k,v]] -> {k: v}\n * @param {Array} pairs An array of two-element arrays that will be the keys and values of the output object.\n * @return {Object} The object made by pairing up `keys` and `values`.\n * @see R.toPairs, R.pair\n * @example\n *\n * R.fromPairs([['a', 1], ['b', 2], ['c', 3]]); //=> {a: 1, b: 2, c: 3}\n */\n var fromPairs = _curry1(function fromPairs(pairs) {\n var idx = 0;\n var len = pairs.length;\n var out = {};\n while (idx < len) {\n if (_isArray(pairs[idx]) && pairs[idx].length) {\n out[pairs[idx][0]] = pairs[idx][1];\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Takes a list and returns a list of lists where each sublist's elements are\n * all \"equal\" according to the provided equality function.\n *\n * @func\n * @memberOf R\n * @since v0.21.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [[a]]\n * @param {Function} fn Function for determining whether two given (adjacent)\n * elements should be in the same group\n * @param {Array} list The array to group. Also accepts a string, which will be\n * treated as a list of characters.\n * @return {List} A list that contains sublists of equal elements,\n * whose concatenations is equal to the original list.\n * @example\n *\n * groupWith(R.equals, [0, 1, 1, 2, 3, 5, 8, 13, 21])\n * // [[0], [1, 1], [2, 3, 5, 8, 13, 21]]\n *\n * groupWith((a, b) => a % 2 === b % 2, [0, 1, 1, 2, 3, 5, 8, 13, 21])\n * // [[0], [1, 1], [2], [3, 5], [8], [13, 21]]\n *\n * R.groupWith(R.eqBy(isVowel), 'aestiou')\n * // ['ae', 'st', 'iou']\n */\n var groupWith = _curry2(function (fn, list) {\n var res = [];\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n var nextidx = idx + 1;\n while (nextidx < len && fn(list[idx], list[nextidx])) {\n nextidx += 1;\n }\n res.push(list.slice(idx, nextidx));\n idx = nextidx;\n }\n return res;\n });\n\n /**\n * Returns `true` if the first argument is greater than the second; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @see R.lt\n * @example\n *\n * R.gt(2, 1); //=> true\n * R.gt(2, 2); //=> false\n * R.gt(2, 3); //=> false\n * R.gt('a', 'z'); //=> false\n * R.gt('z', 'a'); //=> true\n */\n var gt = _curry2(function gt(a, b) {\n return a > b;\n });\n\n /**\n * Returns `true` if the first argument is greater than or equal to the second;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {Number} a\n * @param {Number} b\n * @return {Boolean}\n * @see R.lte\n * @example\n *\n * R.gte(2, 1); //=> true\n * R.gte(2, 2); //=> true\n * R.gte(2, 3); //=> false\n * R.gte('a', 'z'); //=> false\n * R.gte('z', 'a'); //=> true\n */\n var gte = _curry2(function gte(a, b) {\n return a >= b;\n });\n\n /**\n * Returns whether or not an object has an own property with the specified name\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Object\n * @sig s -> {s: x} -> Boolean\n * @param {String} prop The name of the property to check for.\n * @param {Object} obj The object to query.\n * @return {Boolean} Whether the property exists.\n * @example\n *\n * var hasName = R.has('name');\n * hasName({name: 'alice'}); //=> true\n * hasName({name: 'bob'}); //=> true\n * hasName({}); //=> false\n *\n * var point = {x: 0, y: 0};\n * var pointHas = R.has(R.__, point);\n * pointHas('x'); //=> true\n * pointHas('y'); //=> true\n * pointHas('z'); //=> false\n */\n var has = _curry2(_has);\n\n /**\n * Returns whether or not an object or its prototype chain has a property with\n * the specified name\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Object\n * @sig s -> {s: x} -> Boolean\n * @param {String} prop The name of the property to check for.\n * @param {Object} obj The object to query.\n * @return {Boolean} Whether the property exists.\n * @example\n *\n * function Rectangle(width, height) {\n * this.width = width;\n * this.height = height;\n * }\n * Rectangle.prototype.area = function() {\n * return this.width * this.height;\n * };\n *\n * var square = new Rectangle(2, 2);\n * R.hasIn('width', square); //=> true\n * R.hasIn('area', square); //=> true\n */\n var hasIn = _curry2(function hasIn(prop, obj) {\n return prop in obj;\n });\n\n /**\n * Returns true if its arguments are identical, false otherwise. Values are\n * identical if they reference the same memory. `NaN` is identical to `NaN`;\n * `0` and `-0` are not identical.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * var o = {};\n * R.identical(o, o); //=> true\n * R.identical(1, 1); //=> true\n * R.identical(1, '1'); //=> false\n * R.identical([], []); //=> false\n * R.identical(0, -0); //=> false\n * R.identical(NaN, NaN); //=> true\n */\n // SameValue algorithm\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Step 6.a: NaN == NaN\n var identical = _curry2(function identical(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n });\n\n /**\n * A function that does nothing but return the parameter supplied to it. Good\n * as a default or placeholder function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> a\n * @param {*} x The value to return.\n * @return {*} The input value, `x`.\n * @example\n *\n * R.identity(1); //=> 1\n *\n * var obj = {};\n * R.identity(obj) === obj; //=> true\n */\n var identity = _curry1(_identity);\n\n /**\n * Creates a function that will process either the `onTrue` or the `onFalse`\n * function depending upon the result of the `condition` predicate.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)\n * @param {Function} condition A predicate function\n * @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value.\n * @param {Function} onFalse A function to invoke when the `condition` evaluates to a falsy value.\n * @return {Function} A new unary function that will process either the `onTrue` or the `onFalse`\n * function depending upon the result of the `condition` predicate.\n * @see R.unless, R.when\n * @example\n *\n * var incCount = R.ifElse(\n * R.has('count'),\n * R.over(R.lensProp('count'), R.inc),\n * R.assoc('count', 1)\n * );\n * incCount({}); //=> { count: 1 }\n * incCount({ count: 1 }); //=> { count: 2 }\n */\n var ifElse = _curry3(function ifElse(condition, onTrue, onFalse) {\n return curryN(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {\n return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);\n });\n });\n\n /**\n * Increments its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @see R.dec\n * @example\n *\n * R.inc(42); //=> 43\n */\n var inc = add(1);\n\n /**\n * Inserts the supplied element into the list, at index `index`. _Note that\n * this is not destructive_: it returns a copy of the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.2.2\n * @category List\n * @sig Number -> a -> [a] -> [a]\n * @param {Number} index The position to insert the element\n * @param {*} elt The element to insert into the Array\n * @param {Array} list The list to insert into\n * @return {Array} A new Array with `elt` inserted at `index`.\n * @example\n *\n * R.insert(2, 'x', [1,2,3,4]); //=> [1,2,'x',3,4]\n */\n var insert = _curry3(function insert(idx, elt, list) {\n idx = idx < list.length && idx >= 0 ? idx : list.length;\n var result = _slice(list);\n result.splice(idx, 0, elt);\n return result;\n });\n\n /**\n * Inserts the sub-list into the list, at index `index`. _Note that this is not\n * destructive_: it returns a copy of the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig Number -> [a] -> [a] -> [a]\n * @param {Number} index The position to insert the sub-list\n * @param {Array} elts The sub-list to insert into the Array\n * @param {Array} list The list to insert the sub-list into\n * @return {Array} A new Array with `elts` inserted starting at `index`.\n * @example\n *\n * R.insertAll(2, ['x','y','z'], [1,2,3,4]); //=> [1,2,'x','y','z',3,4]\n */\n var insertAll = _curry3(function insertAll(idx, elts, list) {\n idx = idx < list.length && idx >= 0 ? idx : list.length;\n return _concat(_concat(_slice(list, 0, idx), elts), _slice(list, idx));\n });\n\n /**\n * Creates a new list with the separator interposed between elements.\n *\n * Dispatches to the `intersperse` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} separator The element to add to the list.\n * @param {Array} list The list to be interposed.\n * @return {Array} The new list.\n * @example\n *\n * R.intersperse('n', ['ba', 'a', 'a']); //=> ['ba', 'n', 'a', 'n', 'a']\n */\n var intersperse = _curry2(_checkForMethod('intersperse', function intersperse(separator, list) {\n var out = [];\n var idx = 0;\n var length = list.length;\n while (idx < length) {\n if (idx === length - 1) {\n out.push(list[idx]);\n } else {\n out.push(list[idx], separator);\n }\n idx += 1;\n }\n return out;\n }));\n\n /**\n * See if an object (`val`) is an instance of the supplied constructor. This\n * function will check up the inheritance chain, if any.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Type\n * @sig (* -> {*}) -> a -> Boolean\n * @param {Object} ctor A constructor\n * @param {*} val The value to test\n * @return {Boolean}\n * @example\n *\n * R.is(Object, {}); //=> true\n * R.is(Number, 1); //=> true\n * R.is(Object, 1); //=> false\n * R.is(String, 's'); //=> true\n * R.is(String, new String('')); //=> true\n * R.is(Object, new String('')); //=> true\n * R.is(Object, 's'); //=> false\n * R.is(Number, {}); //=> false\n */\n var is = _curry2(function is(Ctor, val) {\n return val != null && val.constructor === Ctor || val instanceof Ctor;\n });\n\n /**\n * Tests whether or not an object is similar to an array.\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Type\n * @category List\n * @sig * -> Boolean\n * @param {*} x The object to test.\n * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.\n * @example\n *\n * R.isArrayLike([]); //=> true\n * R.isArrayLike(true); //=> false\n * R.isArrayLike({}); //=> false\n * R.isArrayLike({length: 10}); //=> false\n * R.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true\n */\n var isArrayLike = _curry1(function isArrayLike(x) {\n if (_isArray(x)) {\n return true;\n }\n if (!x) {\n return false;\n }\n if (typeof x !== 'object') {\n return false;\n }\n if (x instanceof String) {\n return false;\n }\n if (x.nodeType === 1) {\n return !!x.length;\n }\n if (x.length === 0) {\n return true;\n }\n if (x.length > 0) {\n return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);\n }\n return false;\n });\n\n /**\n * Checks if the input value is `null` or `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Type\n * @sig * -> Boolean\n * @param {*} x The value to test.\n * @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.\n * @example\n *\n * R.isNil(null); //=> true\n * R.isNil(undefined); //=> true\n * R.isNil(0); //=> false\n * R.isNil([]); //=> false\n */\n var isNil = _curry1(function isNil(x) {\n return x == null;\n });\n\n /**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\n // cover IE < 9 keys issues\n // Safari bug\n var keys = function () {\n // cover IE < 9 keys issues\n var hasEnumBug = !{ toString: null }.propertyIsEnumerable('toString');\n var nonEnumerableProps = [\n 'constructor',\n 'valueOf',\n 'isPrototypeOf',\n 'toString',\n 'propertyIsEnumerable',\n 'hasOwnProperty',\n 'toLocaleString'\n ];\n // Safari bug\n var hasArgsEnumBug = function () {\n 'use strict';\n return arguments.propertyIsEnumerable('length');\n }();\n var contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n };\n return typeof Object.keys === 'function' && !hasArgsEnumBug ? _curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n }) : _curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n });\n }();\n\n /**\n * Returns a list containing the names of all the properties of the supplied\n * object, including prototype properties.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.keysIn(f); //=> ['x', 'y']\n */\n var keysIn = _curry1(function keysIn(obj) {\n var prop;\n var ks = [];\n for (prop in obj) {\n ks[ks.length] = prop;\n }\n return ks;\n });\n\n /**\n * Returns the number of elements in the array by returning `list.length`.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [a] -> Number\n * @param {Array} list The array to inspect.\n * @return {Number} The length of the array.\n * @example\n *\n * R.length([]); //=> 0\n * R.length([1, 2, 3]); //=> 3\n */\n var length = _curry1(function length(list) {\n return list != null && is(Number, list.length) ? list.length : NaN;\n });\n\n /**\n * Returns `true` if the first argument is less than the second; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @see R.gt\n * @example\n *\n * R.lt(2, 1); //=> false\n * R.lt(2, 2); //=> false\n * R.lt(2, 3); //=> true\n * R.lt('a', 'z'); //=> true\n * R.lt('z', 'a'); //=> false\n */\n var lt = _curry2(function lt(a, b) {\n return a < b;\n });\n\n /**\n * Returns `true` if the first argument is less than or equal to the second;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> Boolean\n * @param {Number} a\n * @param {Number} b\n * @return {Boolean}\n * @see R.gte\n * @example\n *\n * R.lte(2, 1); //=> false\n * R.lte(2, 2); //=> true\n * R.lte(2, 3); //=> true\n * R.lte('a', 'z'); //=> true\n * R.lte('z', 'a'); //=> false\n */\n var lte = _curry2(function lte(a, b) {\n return a <= b;\n });\n\n /**\n * The mapAccum function behaves like a combination of map and reduce; it\n * applies a function to each element of a list, passing an accumulating\n * parameter from left to right, and returning a final value of this\n * accumulator together with the new list.\n *\n * The iterator function receives two arguments, *acc* and *value*, and should\n * return a tuple *[acc, value]*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var digits = ['1', '2', '3', '4'];\n * var appender = (a, b) => [a + b, a + b];\n *\n * R.mapAccum(appender, 0, digits); //=> ['01234', ['01', '012', '0123', '01234']]\n */\n var mapAccum = _curry3(function mapAccum(fn, acc, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n var tuple = [acc];\n while (idx < len) {\n tuple = fn(tuple[0], list[idx]);\n result[idx] = tuple[1];\n idx += 1;\n }\n return [\n tuple[0],\n result\n ];\n });\n\n /**\n * The mapAccumRight function behaves like a combination of map and reduce; it\n * applies a function to each element of a list, passing an accumulating\n * parameter from right to left, and returning a final value of this\n * accumulator together with the new list.\n *\n * Similar to `mapAccum`, except moves through the input list from the right to\n * the left.\n *\n * The iterator function receives two arguments, *acc* and *value*, and should\n * return a tuple *[acc, value]*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var digits = ['1', '2', '3', '4'];\n * var append = (a, b) => [a + b, a + b];\n *\n * R.mapAccumRight(append, 0, digits); //=> ['04321', ['04321', '0432', '043', '04']]\n */\n var mapAccumRight = _curry3(function mapAccumRight(fn, acc, list) {\n var idx = list.length - 1;\n var result = [];\n var tuple = [acc];\n while (idx >= 0) {\n tuple = fn(tuple[0], list[idx]);\n result[idx] = tuple[1];\n idx -= 1;\n }\n return [\n tuple[0],\n result\n ];\n });\n\n /**\n * Tests a regular expression against a String. Note that this function will\n * return an empty array when there are no matches. This differs from\n * [`String.prototype.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\n * which returns `null` when there are no matches.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category String\n * @sig RegExp -> String -> [String | Undefined]\n * @param {RegExp} rx A regular expression.\n * @param {String} str The string to match against\n * @return {Array} The list of matches or empty array.\n * @see R.test\n * @example\n *\n * R.match(/([a-z]a)/g, 'bananas'); //=> ['ba', 'na', 'na']\n * R.match(/a/, 'b'); //=> []\n * R.match(/a/, null); //=> TypeError: null does not have a method named \"match\"\n */\n var match = _curry2(function match(rx, str) {\n return str.match(rx) || [];\n });\n\n /**\n * mathMod behaves like the modulo operator should mathematically, unlike the\n * `%` operator (and by extension, R.modulo). So while \"-17 % 5\" is -2,\n * mathMod(-17, 5) is 3. mathMod requires Integer arguments, and returns NaN\n * when the modulus is zero or negative.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} m The dividend.\n * @param {Number} p the modulus.\n * @return {Number} The result of `b mod a`.\n * @example\n *\n * R.mathMod(-17, 5); //=> 3\n * R.mathMod(17, 5); //=> 2\n * R.mathMod(17, -5); //=> NaN\n * R.mathMod(17, 0); //=> NaN\n * R.mathMod(17.2, 5); //=> NaN\n * R.mathMod(17, 5.3); //=> NaN\n *\n * var clock = R.mathMod(R.__, 12);\n * clock(15); //=> 3\n * clock(24); //=> 0\n *\n * var seventeenMod = R.mathMod(17);\n * seventeenMod(3); //=> 2\n * seventeenMod(4); //=> 1\n * seventeenMod(10); //=> 7\n */\n var mathMod = _curry2(function mathMod(m, p) {\n if (!_isInteger(m)) {\n return NaN;\n }\n if (!_isInteger(p) || p < 1) {\n return NaN;\n }\n return (m % p + p) % p;\n });\n\n /**\n * Returns the larger of its two arguments.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> a\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.maxBy, R.min\n * @example\n *\n * R.max(789, 123); //=> 789\n * R.max('a', 'b'); //=> 'b'\n */\n var max = _curry2(function max(a, b) {\n return b > a ? b : a;\n });\n\n /**\n * Takes a function and two values, and returns whichever value produces the\n * larger result when passed to the provided function.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Relation\n * @sig Ord b => (a -> b) -> a -> a -> a\n * @param {Function} f\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.max, R.minBy\n * @example\n *\n * // square :: Number -> Number\n * var square = n => n * n;\n *\n * R.maxBy(square, -3, 2); //=> -3\n *\n * R.reduce(R.maxBy(square), 0, [3, -5, 4, 1, -2]); //=> -5\n * R.reduce(R.maxBy(square), 0, []); //=> 0\n */\n var maxBy = _curry3(function maxBy(f, a, b) {\n return f(b) > f(a) ? b : a;\n });\n\n /**\n * Create a new object with the own properties of the first object merged with\n * the own properties of the second object. If a key exists in both objects,\n * the value from the second object will be used.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> {k: v} -> {k: v}\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeWith, R.mergeWithKey\n * @example\n *\n * R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });\n * //=> { 'name': 'fred', 'age': 40 }\n *\n * var resetToDefault = R.merge(R.__, {x: 0});\n * resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}\n */\n var merge = _curry2(function merge(l, r) {\n return _assign({}, l, r);\n });\n\n /**\n * Merges a list of objects together into one object.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig [{k: v}] -> {k: v}\n * @param {Array} list An array of objects\n * @return {Object} A merged object.\n * @see R.reduce\n * @example\n *\n * R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3}\n * R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2}\n */\n var mergeAll = _curry1(function mergeAll(list) {\n return _assign.apply(null, [{}].concat(list));\n });\n\n /**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object. The key\n * will be excluded from the returned object if the resulting value is\n * `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig (String -> a -> a -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.merge, R.mergeWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeWithKey(concatValues,\n * { a: true, thing: 'foo', values: [10, 20] },\n * { b: true, thing: 'bar', values: [15, 35] });\n * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n */\n var mergeWithKey = _curry3(function mergeWithKey(fn, l, r) {\n var result = {};\n var k;\n for (k in l) {\n if (_has(k, l)) {\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n }\n }\n for (k in r) {\n if (_has(k, r) && !_has(k, result)) {\n result[k] = r[k];\n }\n }\n return result;\n });\n\n /**\n * Returns the smaller of its two arguments.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> a\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.minBy, R.max\n * @example\n *\n * R.min(789, 123); //=> 123\n * R.min('a', 'b'); //=> 'a'\n */\n var min = _curry2(function min(a, b) {\n return b < a ? b : a;\n });\n\n /**\n * Takes a function and two values, and returns whichever value produces the\n * smaller result when passed to the provided function.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Relation\n * @sig Ord b => (a -> b) -> a -> a -> a\n * @param {Function} f\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.min, R.maxBy\n * @example\n *\n * // square :: Number -> Number\n * var square = n => n * n;\n *\n * R.minBy(square, -3, 2); //=> 2\n *\n * R.reduce(R.minBy(square), Infinity, [3, -5, 4, 1, -2]); //=> 1\n * R.reduce(R.minBy(square), Infinity, []); //=> Infinity\n */\n var minBy = _curry3(function minBy(f, a, b) {\n return f(b) < f(a) ? b : a;\n });\n\n /**\n * Divides the second parameter by the first and returns the remainder. Note\n * that this function preserves the JavaScript-style behavior for modulo. For\n * mathematical modulo see `mathMod`.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The value to the divide.\n * @param {Number} b The pseudo-modulus\n * @return {Number} The result of `b % a`.\n * @see R.mathMod\n * @example\n *\n * R.modulo(17, 3); //=> 2\n * // JS behavior:\n * R.modulo(-17, 3); //=> -2\n * R.modulo(17, -3); //=> 2\n *\n * var isOdd = R.modulo(R.__, 2);\n * isOdd(42); //=> 0\n * isOdd(21); //=> 1\n */\n var modulo = _curry2(function modulo(a, b) {\n return a % b;\n });\n\n /**\n * Multiplies two numbers. Equivalent to `a * b` but curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a * b`.\n * @see R.divide\n * @example\n *\n * var double = R.multiply(2);\n * var triple = R.multiply(3);\n * double(3); //=> 6\n * triple(4); //=> 12\n * R.multiply(2, 5); //=> 10\n */\n var multiply = _curry2(function multiply(a, b) {\n return a * b;\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly `n` parameters. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} n The desired arity of the new function.\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity `n`.\n * @example\n *\n * var takesTwoArgs = (a, b) => [a, b];\n *\n * takesTwoArgs.length; //=> 2\n * takesTwoArgs(1, 2); //=> [1, 2]\n *\n * var takesOneArg = R.nAry(1, takesTwoArgs);\n * takesOneArg.length; //=> 1\n * // Only `n` arguments are passed to the wrapped function\n * takesOneArg(1, 2); //=> [1, undefined]\n */\n var nAry = _curry2(function nAry(n, fn) {\n switch (n) {\n case 0:\n return function () {\n return fn.call(this);\n };\n case 1:\n return function (a0) {\n return fn.call(this, a0);\n };\n case 2:\n return function (a0, a1) {\n return fn.call(this, a0, a1);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.call(this, a0, a1, a2);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.call(this, a0, a1, a2, a3);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.call(this, a0, a1, a2, a3, a4);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.call(this, a0, a1, a2, a3, a4, a5);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n };\n default:\n throw new Error('First argument to nAry must be a non-negative integer no greater than ten');\n }\n });\n\n /**\n * Negates its argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Math\n * @sig Number -> Number\n * @param {Number} n\n * @return {Number}\n * @example\n *\n * R.negate(42); //=> -42\n */\n var negate = _curry1(function negate(n) {\n return -n;\n });\n\n /**\n * Returns `true` if no elements of the list match the predicate, `false`\n * otherwise.\n *\n * Dispatches to the `any` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> Boolean\n * @param {Function} fn The predicate function.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the predicate is not satisfied by every element, `false` otherwise.\n * @see R.all, R.any\n * @example\n *\n * var isEven = n => n % 2 === 0;\n *\n * R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true\n * R.none(isEven, [1, 3, 5, 7, 8, 11]); //=> false\n */\n var none = _curry2(_complement(_dispatchable('any', _xany, any)));\n\n /**\n * A function that returns the `!` of its argument. It will return `true` when\n * passed false-y value, and `false` when passed a truth-y one.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> Boolean\n * @param {*} a any value\n * @return {Boolean} the logical inverse of passed argument.\n * @see R.complement\n * @example\n *\n * R.not(true); //=> false\n * R.not(false); //=> true\n * R.not(0); => true\n * R.not(1); => false\n */\n var not = _curry1(function not(a) {\n return !a;\n });\n\n /**\n * Returns the nth element of the given list or string. If n is negative the\n * element at index length + n is returned.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> a | Undefined\n * @sig Number -> String -> String\n * @param {Number} offset\n * @param {*} list\n * @return {*}\n * @example\n *\n * var list = ['foo', 'bar', 'baz', 'quux'];\n * R.nth(1, list); //=> 'bar'\n * R.nth(-1, list); //=> 'quux'\n * R.nth(-99, list); //=> undefined\n *\n * R.nth(2, 'abc'); //=> 'c'\n * R.nth(3, 'abc'); //=> ''\n */\n var nth = _curry2(function nth(offset, list) {\n var idx = offset < 0 ? list.length + offset : offset;\n return _isString(list) ? list.charAt(idx) : list[idx];\n });\n\n /**\n * Returns a function which returns its nth argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig Number -> *... -> *\n * @param {Number} n\n * @return {Function}\n * @example\n *\n * R.nthArg(1)('a', 'b', 'c'); //=> 'b'\n * R.nthArg(-1)('a', 'b', 'c'); //=> 'c'\n */\n var nthArg = _curry1(function nthArg(n) {\n return function () {\n return nth(n, arguments);\n };\n });\n\n /**\n * Creates an object containing a single key:value pair.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Object\n * @sig String -> a -> {String:a}\n * @param {String} key\n * @param {*} val\n * @return {Object}\n * @see R.pair\n * @example\n *\n * var matchPhrases = R.compose(\n * R.objOf('must'),\n * R.map(R.objOf('match_phrase'))\n * );\n * matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}\n */\n var objOf = _curry2(function objOf(key, val) {\n var obj = {};\n obj[key] = val;\n return obj;\n });\n\n /**\n * Returns a singleton array containing the value provided.\n *\n * Note this `of` is different from the ES6 `of`; See\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig a -> [a]\n * @param {*} x any value\n * @return {Array} An array wrapping `x`.\n * @example\n *\n * R.of(null); //=> [null]\n * R.of([42]); //=> [[42]]\n */\n var of = _curry1(_of);\n\n /**\n * Accepts a function `fn` and returns a function that guards invocation of\n * `fn` such that `fn` can only ever be called once, no matter how many times\n * the returned function is invoked. The first value calculated is returned in\n * subsequent invocations.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a... -> b) -> (a... -> b)\n * @param {Function} fn The function to wrap in a call-only-once wrapper.\n * @return {Function} The wrapped function.\n * @example\n *\n * var addOneOnce = R.once(x => x + 1);\n * addOneOnce(10); //=> 11\n * addOneOnce(addOneOnce(50)); //=> 11\n */\n var once = _curry1(function once(fn) {\n var called = false;\n var result;\n return _arity(fn.length, function () {\n if (called) {\n return result;\n }\n called = true;\n result = fn.apply(this, arguments);\n return result;\n });\n });\n\n /**\n * Returns `true` if one or both of its arguments are `true`. Returns `false`\n * if both arguments are `false`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig * -> * -> *\n * @param {Boolean} a A boolean value\n * @param {Boolean} b A boolean value\n * @return {Boolean} `true` if one or both arguments are `true`, `false` otherwise\n * @see R.either\n * @example\n *\n * R.or(true, true); //=> true\n * R.or(true, false); //=> true\n * R.or(false, true); //=> true\n * R.or(false, false); //=> false\n */\n var or = _curry2(function or(a, b) {\n return a || b;\n });\n\n /**\n * Returns the result of \"setting\" the portion of the given data structure\n * focused by the given lens to the result of applying the given function to\n * the focused value.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> (a -> a) -> s -> s\n * @param {Lens} lens\n * @param {*} v\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var headLens = R.lensIndex(0);\n *\n * R.over(headLens, R.toUpper, ['foo', 'bar', 'baz']); //=> ['FOO', 'bar', 'baz']\n */\n // `Identity` is a functor that holds a single value, where `map` simply\n // transforms the held value with the provided function.\n // The value returned by the getter function is first transformed with `f`,\n // then set as the value of an `Identity`. This is then mapped over with the\n // setter function of the lens.\n var over = function () {\n // `Identity` is a functor that holds a single value, where `map` simply\n // transforms the held value with the provided function.\n var Identity = function (x) {\n return {\n value: x,\n map: function (f) {\n return Identity(f(x));\n }\n };\n };\n return _curry3(function over(lens, f, x) {\n // The value returned by the getter function is first transformed with `f`,\n // then set as the value of an `Identity`. This is then mapped over with the\n // setter function of the lens.\n return lens(function (y) {\n return Identity(f(y));\n })(x).value;\n });\n }();\n\n /**\n * Takes two arguments, `fst` and `snd`, and returns `[fst, snd]`.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category List\n * @sig a -> b -> (a,b)\n * @param {*} fst\n * @param {*} snd\n * @return {Array}\n * @see R.objOf, R.of\n * @example\n *\n * R.pair('foo', 'bar'); //=> ['foo', 'bar']\n */\n var pair = _curry2(function pair(fst, snd) {\n return [\n fst,\n snd\n ];\n });\n\n /**\n * Retrieve the value at a given path.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig [String] -> {k: v} -> v | Undefined\n * @param {Array} path The path to use.\n * @param {Object} obj The object to retrieve the nested property from.\n * @return {*} The data at `path`.\n * @example\n *\n * R.path(['a', 'b'], {a: {b: 2}}); //=> 2\n * R.path(['a', 'b'], {c: {b: 2}}); //=> undefined\n */\n var path = _curry2(function path(paths, obj) {\n var val = obj;\n var idx = 0;\n while (idx < paths.length) {\n if (val == null) {\n return;\n }\n val = val[paths[idx]];\n idx += 1;\n }\n return val;\n });\n\n /**\n * If the given, non-null object has a value at the given path, returns the\n * value at that path. Otherwise returns the provided default value.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Object\n * @sig a -> [String] -> Object -> a\n * @param {*} d The default value.\n * @param {Array} p The path to use.\n * @param {Object} obj The object to retrieve the nested property from.\n * @return {*} The data at `path` of the supplied object or the default value.\n * @example\n *\n * R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2\n * R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> \"N/A\"\n */\n var pathOr = _curry3(function pathOr(d, p, obj) {\n return defaultTo(d, path(p, obj));\n });\n\n /**\n * Returns `true` if the specified object property at given path satisfies the\n * given predicate; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Logic\n * @sig (a -> Boolean) -> [String] -> Object -> Boolean\n * @param {Function} pred\n * @param {Array} propPath\n * @param {*} obj\n * @return {Boolean}\n * @see R.propSatisfies, R.path\n * @example\n *\n * R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true\n */\n var pathSatisfies = _curry3(function pathSatisfies(pred, propPath, obj) {\n return propPath.length > 0 && pred(path(propPath, obj));\n });\n\n /**\n * Returns a partial copy of an object containing only the keys specified. If\n * the key does not exist, the property is ignored.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> {k: v}\n * @param {Array} names an array of String property names to copy onto a new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties from `names` on it.\n * @see R.omit, R.props\n * @example\n *\n * R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n * R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1}\n */\n var pick = _curry2(function pick(names, obj) {\n var result = {};\n var idx = 0;\n while (idx < names.length) {\n if (names[idx] in obj) {\n result[names[idx]] = obj[names[idx]];\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Similar to `pick` except that this one includes a `key: undefined` pair for\n * properties that don't exist.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> {k: v}\n * @param {Array} names an array of String property names to copy onto a new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties from `names` on it.\n * @see R.pick\n * @example\n *\n * R.pickAll(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n * R.pickAll(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, e: undefined, f: undefined}\n */\n var pickAll = _curry2(function pickAll(names, obj) {\n var result = {};\n var idx = 0;\n var len = names.length;\n while (idx < len) {\n var name = names[idx];\n result[name] = obj[name];\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns a partial copy of an object containing only the keys that satisfy\n * the supplied predicate.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @sig (v, k -> Boolean) -> {k: v} -> {k: v}\n * @param {Function} pred A predicate to determine whether or not a key\n * should be included on the output object.\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties that satisfy `pred`\n * on it.\n * @see R.pick, R.filter\n * @example\n *\n * var isUpperCase = (val, key) => key.toUpperCase() === key;\n * R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}\n */\n var pickBy = _curry2(function pickBy(test, obj) {\n var result = {};\n for (var prop in obj) {\n if (test(obj[prop], prop, obj)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n });\n\n /**\n * Returns a new list with the given element at the front, followed by the\n * contents of the list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> [a]\n * @param {*} el The item to add to the head of the output list.\n * @param {Array} list The array to add to the tail of the output list.\n * @return {Array} A new array.\n * @see R.append\n * @example\n *\n * R.prepend('fee', ['fi', 'fo', 'fum']); //=> ['fee', 'fi', 'fo', 'fum']\n */\n var prepend = _curry2(function prepend(el, list) {\n return _concat([el], list);\n });\n\n /**\n * Returns a function that when supplied an object returns the indicated\n * property of that object, if it exists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig s -> {s: a} -> a | Undefined\n * @param {String} p The property name\n * @param {Object} obj The object to query\n * @return {*} The value at `obj.p`.\n * @example\n *\n * R.prop('x', {x: 100}); //=> 100\n * R.prop('x', {}); //=> undefined\n */\n var prop = _curry2(function prop(p, obj) {\n return obj[p];\n });\n\n /**\n * If the given, non-null object has an own property with the specified name,\n * returns the value of that property. Otherwise returns the provided default\n * value.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Object\n * @sig a -> String -> Object -> a\n * @param {*} val The default value.\n * @param {String} p The name of the property to return.\n * @param {Object} obj The object to query.\n * @return {*} The value of given property of the supplied object or the default value.\n * @example\n *\n * var alice = {\n * name: 'ALICE',\n * age: 101\n * };\n * var favorite = R.prop('favoriteLibrary');\n * var favoriteWithDefault = R.propOr('Ramda', 'favoriteLibrary');\n *\n * favorite(alice); //=> undefined\n * favoriteWithDefault(alice); //=> 'Ramda'\n */\n var propOr = _curry3(function propOr(val, p, obj) {\n return obj != null && _has(p, obj) ? obj[p] : val;\n });\n\n /**\n * Returns `true` if the specified object property satisfies the given\n * predicate; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Logic\n * @sig (a -> Boolean) -> String -> {String: a} -> Boolean\n * @param {Function} pred\n * @param {String} name\n * @param {*} obj\n * @return {Boolean}\n * @see R.propEq, R.propIs\n * @example\n *\n * R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}); //=> true\n */\n var propSatisfies = _curry3(function propSatisfies(pred, name, obj) {\n return pred(obj[name]);\n });\n\n /**\n * Acts as multiple `prop`: array of keys in, array of values out. Preserves\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> [v]\n * @param {Array} ps The property names to fetch\n * @param {Object} obj The object to query\n * @return {Array} The corresponding values or partially applied function.\n * @example\n *\n * R.props(['x', 'y'], {x: 1, y: 2}); //=> [1, 2]\n * R.props(['c', 'a', 'b'], {b: 2, a: 1}); //=> [undefined, 1, 2]\n *\n * var fullName = R.compose(R.join(' '), R.props(['first', 'last']));\n * fullName({last: 'Bullet-Tooth', age: 33, first: 'Tony'}); //=> 'Tony Bullet-Tooth'\n */\n var props = _curry2(function props(ps, obj) {\n var len = ps.length;\n var out = [];\n var idx = 0;\n while (idx < len) {\n out[idx] = obj[ps[idx]];\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a list of numbers from `from` (inclusive) to `to` (exclusive).\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> Number -> [Number]\n * @param {Number} from The first number in the list.\n * @param {Number} to One more than the last number in the list.\n * @return {Array} The list of numbers in tthe set `[a, b)`.\n * @example\n *\n * R.range(1, 5); //=> [1, 2, 3, 4]\n * R.range(50, 53); //=> [50, 51, 52]\n */\n var range = _curry2(function range(from, to) {\n if (!(_isNumber(from) && _isNumber(to))) {\n throw new TypeError('Both arguments to range must be numbers');\n }\n var result = [];\n var n = from;\n while (n < to) {\n result.push(n);\n n += 1;\n }\n return result;\n });\n\n /**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * Similar to `reduce`, except moves through the input list from the right to\n * the left.\n *\n * The iterator function receives two values: *(acc, value)*\n *\n * Note: `R.reduceRight` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight#Description\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,b -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.addIndex\n * @example\n *\n * var pairs = [ ['a', 1], ['b', 2], ['c', 3] ];\n * var flattenPairs = (acc, pair) => acc.concat(pair);\n *\n * R.reduceRight(flattenPairs, [], pairs); //=> [ 'c', 3, 'b', 2, 'a', 1 ]\n */\n var reduceRight = _curry3(function reduceRight(fn, acc, list) {\n var idx = list.length - 1;\n while (idx >= 0) {\n acc = fn(acc, list[idx]);\n idx -= 1;\n }\n return acc;\n });\n\n /**\n * Returns a value wrapped to indicate that it is the final value of the reduce\n * and transduce functions. The returned value should be considered a black\n * box: the internal structure is not guaranteed to be stable.\n *\n * Note: this optimization is unavailable to functions not explicitly listed\n * above. For instance, it is not currently supported by reduceRight.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category List\n * @sig a -> *\n * @param {*} x The final value of the reduce.\n * @return {*} The wrapped value.\n * @see R.reduce, R.transduce\n * @example\n *\n * R.reduce(\n * R.pipe(R.add, R.when(R.gte(R.__, 10), R.reduced)),\n * 0,\n * [1, 2, 3, 4, 5]) // 10\n */\n var reduced = _curry1(_reduced);\n\n /**\n * Removes the sub-list of `list` starting at index `start` and containing\n * `count` elements. _Note that this is not destructive_: it returns a copy of\n * the list with the changes.\n * No lists have been harmed in the application of this function.\n *\n * @func\n * @memberOf R\n * @since v0.2.2\n * @category List\n * @sig Number -> Number -> [a] -> [a]\n * @param {Number} start The position to start removing elements\n * @param {Number} count The number of elements to remove\n * @param {Array} list The list to remove from\n * @return {Array} A new Array with `count` elements from `start` removed.\n * @example\n *\n * R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]\n */\n var remove = _curry3(function remove(start, count, list) {\n return _concat(_slice(list, 0, Math.min(start, list.length)), _slice(list, Math.min(list.length, start + count)));\n });\n\n /**\n * Replace a substring or regex match in a string with a replacement.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category String\n * @sig RegExp|String -> String -> String -> String\n * @param {RegExp|String} pattern A regular expression or a substring to match.\n * @param {String} replacement The string to replace the matches with.\n * @param {String} str The String to do the search and replacement in.\n * @return {String} The result.\n * @example\n *\n * R.replace('foo', 'bar', 'foo foo foo'); //=> 'bar foo foo'\n * R.replace(/foo/, 'bar', 'foo foo foo'); //=> 'bar foo foo'\n *\n * // Use the \"g\" (global) flag to replace all occurrences:\n * R.replace(/foo/g, 'bar', 'foo foo foo'); //=> 'bar bar bar'\n */\n var replace = _curry3(function replace(regex, replacement, str) {\n return str.replace(regex, replacement);\n });\n\n /**\n * Returns a new list or string with the elements or characters in reverse\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {Array|String} list\n * @return {Array|String}\n * @example\n *\n * R.reverse([1, 2, 3]); //=> [3, 2, 1]\n * R.reverse([1, 2]); //=> [2, 1]\n * R.reverse([1]); //=> [1]\n * R.reverse([]); //=> []\n *\n * R.reverse('abc'); //=> 'cba'\n * R.reverse('ab'); //=> 'ba'\n * R.reverse('a'); //=> 'a'\n * R.reverse(''); //=> ''\n */\n var reverse = _curry1(function reverse(list) {\n return _isString(list) ? list.split('').reverse().join('') : _slice(list).reverse();\n });\n\n /**\n * Scan is similar to reduce, but returns a list of successively reduced values\n * from the left\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (a,b -> a) -> a -> [b] -> [a]\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {Array} A list of all intermediately reduced values.\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var factorials = R.scan(R.multiply, 1, numbers); //=> [1, 1, 2, 6, 24]\n */\n var scan = _curry3(function scan(fn, acc, list) {\n var idx = 0;\n var len = list.length;\n var result = [acc];\n while (idx < len) {\n acc = fn(acc, list[idx]);\n result[idx + 1] = acc;\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns the result of \"setting\" the portion of the given data structure\n * focused by the given lens to the given value.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> a -> s -> s\n * @param {Lens} lens\n * @param {*} v\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.set(xLens, 8, {x: 1, y: 2}); //=> {x: 8, y: 2}\n */\n var set = _curry3(function set(lens, v, x) {\n return over(lens, always(v), x);\n });\n\n /**\n * Returns the elements of the given list or string (or object with a `slice`\n * method) from `fromIndex` (inclusive) to `toIndex` (exclusive).\n *\n * Dispatches to the `slice` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig Number -> Number -> [a] -> [a]\n * @sig Number -> Number -> String -> String\n * @param {Number} fromIndex The start index (inclusive).\n * @param {Number} toIndex The end index (exclusive).\n * @param {*} list\n * @return {*}\n * @example\n *\n * R.slice(1, 3, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n * R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']\n * R.slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']\n * R.slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n * R.slice(0, 3, 'ramda'); //=> 'ram'\n */\n var slice = _curry3(_checkForMethod('slice', function slice(fromIndex, toIndex, list) {\n return Array.prototype.slice.call(list, fromIndex, toIndex);\n }));\n\n /**\n * Returns a copy of the list, sorted according to the comparator function,\n * which should accept two values at a time and return a negative number if the\n * first value is smaller, a positive number if it's larger, and zero if they\n * are equal. Please note that this is a **copy** of the list. It does not\n * modify the original.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,a -> Number) -> [a] -> [a]\n * @param {Function} comparator A sorting function :: a -> b -> Int\n * @param {Array} list The list to sort\n * @return {Array} a new array with its elements sorted by the comparator function.\n * @example\n *\n * var diff = function(a, b) { return a - b; };\n * R.sort(diff, [4,2,7,5]); //=> [2, 4, 5, 7]\n */\n var sort = _curry2(function sort(comparator, list) {\n return _slice(list).sort(comparator);\n });\n\n /**\n * Sorts the list according to the supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord b => (a -> b) -> [a] -> [a]\n * @param {Function} fn\n * @param {Array} list The list to sort.\n * @return {Array} A new list sorted by the keys generated by `fn`.\n * @example\n *\n * var sortByFirstItem = R.sortBy(R.prop(0));\n * var sortByNameCaseInsensitive = R.sortBy(R.compose(R.toLower, R.prop('name')));\n * var pairs = [[-1, 1], [-2, 2], [-3, 3]];\n * sortByFirstItem(pairs); //=> [[-3, 3], [-2, 2], [-1, 1]]\n * var alice = {\n * name: 'ALICE',\n * age: 101\n * };\n * var bob = {\n * name: 'Bob',\n * age: -10\n * };\n * var clara = {\n * name: 'clara',\n * age: 314.159\n * };\n * var people = [clara, bob, alice];\n * sortByNameCaseInsensitive(people); //=> [alice, bob, clara]\n */\n var sortBy = _curry2(function sortBy(fn, list) {\n return _slice(list).sort(function (a, b) {\n var aa = fn(a);\n var bb = fn(b);\n return aa < bb ? -1 : aa > bb ? 1 : 0;\n });\n });\n\n /**\n * Splits a given list or string at a given index.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig Number -> [a] -> [[a], [a]]\n * @sig Number -> String -> [String, String]\n * @param {Number} index The index where the array/string is split.\n * @param {Array|String} array The array/string to be split.\n * @return {Array}\n * @example\n *\n * R.splitAt(1, [1, 2, 3]); //=> [[1], [2, 3]]\n * R.splitAt(5, 'hello world'); //=> ['hello', ' world']\n * R.splitAt(-1, 'foobar'); //=> ['fooba', 'r']\n */\n var splitAt = _curry2(function splitAt(index, array) {\n return [\n slice(0, index, array),\n slice(index, length(array), array)\n ];\n });\n\n /**\n * Splits a collection into slices of the specified length.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [[a]]\n * @sig Number -> String -> [String]\n * @param {Number} n\n * @param {Array} list\n * @return {Array}\n * @example\n *\n * R.splitEvery(3, [1, 2, 3, 4, 5, 6, 7]); //=> [[1, 2, 3], [4, 5, 6], [7]]\n * R.splitEvery(3, 'foobarbaz'); //=> ['foo', 'bar', 'baz']\n */\n var splitEvery = _curry2(function splitEvery(n, list) {\n if (n <= 0) {\n throw new Error('First argument to splitEvery must be a positive integer');\n }\n var result = [];\n var idx = 0;\n while (idx < list.length) {\n result.push(slice(idx, idx += n, list));\n }\n return result;\n });\n\n /**\n * Takes a list and a predicate and returns a pair of lists with the following properties:\n *\n * - the result of concatenating the two output lists is equivalent to the input list;\n * - none of the elements of the first output list satisfies the predicate; and\n * - if the second output list is non-empty, its first element satisfies the predicate.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [[a], [a]]\n * @param {Function} pred The predicate that determines where the array is split.\n * @param {Array} list The array to be split.\n * @return {Array}\n * @example\n *\n * R.splitWhen(R.equals(2), [1, 2, 3, 1, 2, 3]); //=> [[1], [2, 3, 1, 2, 3]]\n */\n var splitWhen = _curry2(function splitWhen(pred, list) {\n var idx = 0;\n var len = list.length;\n var prefix = [];\n while (idx < len && !pred(list[idx])) {\n prefix.push(list[idx]);\n idx += 1;\n }\n return [\n prefix,\n _slice(list, idx)\n ];\n });\n\n /**\n * Subtracts its second argument from its first argument.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig Number -> Number -> Number\n * @param {Number} a The first value.\n * @param {Number} b The second value.\n * @return {Number} The result of `a - b`.\n * @see R.add\n * @example\n *\n * R.subtract(10, 8); //=> 2\n *\n * var minus5 = R.subtract(R.__, 5);\n * minus5(17); //=> 12\n *\n * var complementaryAngle = R.subtract(90);\n * complementaryAngle(30); //=> 60\n * complementaryAngle(72); //=> 18\n */\n var subtract = _curry2(function subtract(a, b) {\n return Number(a) - Number(b);\n });\n\n /**\n * Returns all but the first element of the given list or string (or object\n * with a `tail` method).\n *\n * Dispatches to the `slice` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.head, R.init, R.last\n * @example\n *\n * R.tail([1, 2, 3]); //=> [2, 3]\n * R.tail([1, 2]); //=> [2]\n * R.tail([1]); //=> []\n * R.tail([]); //=> []\n *\n * R.tail('abc'); //=> 'bc'\n * R.tail('ab'); //=> 'b'\n * R.tail('a'); //=> ''\n * R.tail(''); //=> ''\n */\n var tail = _checkForMethod('tail', slice(1, Infinity));\n\n /**\n * Returns the first `n` elements of the given list, string, or\n * transducer/transformer (or object with a `take` method).\n *\n * Dispatches to the `take` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n\n * @param {*} list\n * @return {*}\n * @see R.drop\n * @example\n *\n * R.take(1, ['foo', 'bar', 'baz']); //=> ['foo']\n * R.take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n * R.take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(3, 'ramda'); //=> 'ram'\n *\n * var personnel = [\n * 'Dave Brubeck',\n * 'Paul Desmond',\n * 'Eugene Wright',\n * 'Joe Morello',\n * 'Gerry Mulligan',\n * 'Bob Bates',\n * 'Joe Dodge',\n * 'Ron Crotty'\n * ];\n *\n * var takeFive = R.take(5);\n * takeFive(personnel);\n * //=> ['Dave Brubeck', 'Paul Desmond', 'Eugene Wright', 'Joe Morello', 'Gerry Mulligan']\n */\n var take = _curry2(_dispatchable('take', _xtake, function take(n, xs) {\n return slice(0, n < 0 ? Infinity : n, xs);\n }));\n\n /**\n * Returns a new list containing the last `n` elements of a given list, passing\n * each value to the supplied predicate function, and terminating when the\n * predicate function returns `false`. Excludes the element that caused the\n * predicate function to fail. The predicate function is passed one argument:\n * *(value)*.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.dropLastWhile, R.addIndex\n * @example\n *\n * var isNotOne = x => x !== 1;\n *\n * R.takeLastWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]\n */\n var takeLastWhile = _curry2(function takeLastWhile(fn, list) {\n var idx = list.length - 1;\n while (idx >= 0 && fn(list[idx])) {\n idx -= 1;\n }\n return _slice(list, idx + 1, Infinity);\n });\n\n /**\n * Returns a new list containing the first `n` elements of a given list,\n * passing each value to the supplied predicate function, and terminating when\n * the predicate function returns `false`. Excludes the element that caused the\n * predicate function to fail. The predicate function is passed one argument:\n * *(value)*.\n *\n * Dispatches to the `takeWhile` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.dropWhile, R.transduce, R.addIndex\n * @example\n *\n * var isNotFour = x => x !== 4;\n *\n * R.takeWhile(isNotFour, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3]\n */\n var takeWhile = _curry2(_dispatchable('takeWhile', _xtakeWhile, function takeWhile(fn, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len && fn(list[idx])) {\n idx += 1;\n }\n return _slice(list, 0, idx);\n }));\n\n /**\n * Runs the given function with the supplied object, then returns the object.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a -> *) -> a -> a\n * @param {Function} fn The function to call with `x`. The return value of `fn` will be thrown away.\n * @param {*} x\n * @return {*} `x`.\n * @example\n *\n * var sayX = x => console.log('x is ' + x);\n * R.tap(sayX, 100); //=> 100\n * //-> 'x is 100'\n */\n var tap = _curry2(function tap(fn, x) {\n fn(x);\n return x;\n });\n\n /**\n * Calls an input function `n` times, returning an array containing the results\n * of those function calls.\n *\n * `fn` is passed one argument: The current value of `n`, which begins at `0`\n * and is gradually incremented to `n - 1`.\n *\n * @func\n * @memberOf R\n * @since v0.2.3\n * @category List\n * @sig (Number -> a) -> Number -> [a]\n * @param {Function} fn The function to invoke. Passed one argument, the current value of `n`.\n * @param {Number} n A value between `0` and `n - 1`. Increments after each function call.\n * @return {Array} An array containing the return values of all calls to `fn`.\n * @example\n *\n * R.times(R.identity, 5); //=> [0, 1, 2, 3, 4]\n */\n var times = _curry2(function times(fn, n) {\n var len = Number(n);\n var idx = 0;\n var list;\n if (len < 0 || isNaN(len)) {\n throw new RangeError('n must be a non-negative number');\n }\n list = new Array(len);\n while (idx < len) {\n list[idx] = fn(idx);\n idx += 1;\n }\n return list;\n });\n\n /**\n * Converts an object into an array of key, value arrays. Only the object's\n * own properties are used.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Object\n * @sig {String: *} -> [[String,*]]\n * @param {Object} obj The object to extract from\n * @return {Array} An array of key, value arrays from the object's own properties.\n * @see R.fromPairs\n * @example\n *\n * R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]\n */\n var toPairs = _curry1(function toPairs(obj) {\n var pairs = [];\n for (var prop in obj) {\n if (_has(prop, obj)) {\n pairs[pairs.length] = [\n prop,\n obj[prop]\n ];\n }\n }\n return pairs;\n });\n\n /**\n * Converts an object into an array of key, value arrays. The object's own\n * properties and prototype properties are used. Note that the order of the\n * output array is not guaranteed to be consistent across different JS\n * platforms.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Object\n * @sig {String: *} -> [[String,*]]\n * @param {Object} obj The object to extract from\n * @return {Array} An array of key, value arrays from the object's own\n * and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.toPairsIn(f); //=> [['x','X'], ['y','Y']]\n */\n var toPairsIn = _curry1(function toPairsIn(obj) {\n var pairs = [];\n for (var prop in obj) {\n pairs[pairs.length] = [\n prop,\n obj[prop]\n ];\n }\n return pairs;\n });\n\n /**\n * Transposes the rows and columns of a 2D list.\n * When passed a list of `n` lists of length `x`,\n * returns a list of `x` lists of length `n`.\n *\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig [[a]] -> [[a]]\n * @param {Array} list A 2D list\n * @return {Array} A 2D list\n * @example\n *\n * R.transpose([[1, 'a'], [2, 'b'], [3, 'c']]) //=> [[1, 2, 3], ['a', 'b', 'c']]\n * R.transpose([[1, 2, 3], ['a', 'b', 'c']]) //=> [[1, 'a'], [2, 'b'], [3, 'c']]\n *\n * If some of the rows are shorter than the following rows, their elements are skipped:\n *\n * R.transpose([[10, 11], [20], [], [30, 31, 32]]) //=> [[10, 20, 30], [11, 31], [32]]\n */\n var transpose = _curry1(function transpose(outerlist) {\n var i = 0;\n var result = [];\n while (i < outerlist.length) {\n var innerlist = outerlist[i];\n var j = 0;\n while (j < innerlist.length) {\n if (typeof result[j] === 'undefined') {\n result[j] = [];\n }\n result[j].push(innerlist[j]);\n j += 1;\n }\n i += 1;\n }\n return result;\n });\n\n /**\n * Removes (strips) whitespace from both ends of the string.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to trim.\n * @return {String} Trimmed version of `str`.\n * @example\n *\n * R.trim(' xyz '); //=> 'xyz'\n * R.map(R.trim, R.split(',', 'x, y, z')); //=> ['x', 'y', 'z']\n */\n var trim = function () {\n var ws = '\\t\\n\\x0B\\f\\r \\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' + '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028' + '\\u2029\\uFEFF';\n var zeroWidth = '\\u200B';\n var hasProtoTrim = typeof String.prototype.trim === 'function';\n if (!hasProtoTrim || (ws.trim() || !zeroWidth.trim())) {\n return _curry1(function trim(str) {\n var beginRx = new RegExp('^[' + ws + '][' + ws + ']*');\n var endRx = new RegExp('[' + ws + '][' + ws + ']*$');\n return str.replace(beginRx, '').replace(endRx, '');\n });\n } else {\n return _curry1(function trim(str) {\n return str.trim();\n });\n }\n }();\n\n /**\n * `tryCatch` takes two functions, a `tryer` and a `catcher`. The returned\n * function evaluates the `tryer`; if it does not throw, it simply returns the\n * result. If the `tryer` *does* throw, the returned function evaluates the\n * `catcher` function and returns its result. Note that for effective\n * composition with this function, both the `tryer` and `catcher` functions\n * must return the same type of results.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Function\n * @sig (...x -> a) -> ((e, ...x) -> a) -> (...x -> a)\n * @param {Function} tryer The function that may throw.\n * @param {Function} catcher The function that will be evaluated if `tryer` throws.\n * @return {Function} A new function that will catch exceptions and send then to the catcher.\n * @example\n *\n * R.tryCatch(R.prop('x'), R.F, {x: true}); //=> true\n * R.tryCatch(R.prop('x'), R.F, null); //=> false\n */\n var tryCatch = _curry2(function _tryCatch(tryer, catcher) {\n return _arity(tryer.length, function () {\n try {\n return tryer.apply(this, arguments);\n } catch (e) {\n return catcher.apply(this, _concat([e], arguments));\n }\n });\n });\n\n /**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n */\n var type = _curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n });\n\n /**\n * Takes a function `fn`, which takes a single array argument, and returns a\n * function which:\n *\n * - takes any number of positional arguments;\n * - passes these arguments to `fn` as an array; and\n * - returns the result.\n *\n * In other words, R.unapply derives a variadic function from a function which\n * takes an array. R.unapply is the inverse of R.apply.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Function\n * @sig ([*...] -> a) -> (*... -> a)\n * @param {Function} fn\n * @return {Function}\n * @see R.apply\n * @example\n *\n * R.unapply(JSON.stringify)(1, 2, 3); //=> '[1,2,3]'\n */\n var unapply = _curry1(function unapply(fn) {\n return function () {\n return fn(_slice(arguments));\n };\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly 1 parameter. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Function\n * @sig (* -> b) -> (a -> b)\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity 1.\n * @example\n *\n * var takesTwoArgs = function(a, b) {\n * return [a, b];\n * };\n * takesTwoArgs.length; //=> 2\n * takesTwoArgs(1, 2); //=> [1, 2]\n *\n * var takesOneArg = R.unary(takesTwoArgs);\n * takesOneArg.length; //=> 1\n * // Only 1 argument is passed to the wrapped function\n * takesOneArg(1, 2); //=> [1, undefined]\n */\n var unary = _curry1(function unary(fn) {\n return nAry(1, fn);\n });\n\n /**\n * Returns a function of arity `n` from a (manually) curried function.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Function\n * @sig Number -> (a -> b) -> (a -> c)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to uncurry.\n * @return {Function} A new function.\n * @see R.curry\n * @example\n *\n * var addFour = a => b => c => d => a + b + c + d;\n *\n * var uncurriedAddFour = R.uncurryN(4, addFour);\n * uncurriedAddFour(1, 2, 3, 4); //=> 10\n */\n var uncurryN = _curry2(function uncurryN(depth, fn) {\n return curryN(depth, function () {\n var currentDepth = 1;\n var value = fn;\n var idx = 0;\n var endIdx;\n while (currentDepth <= depth && typeof value === 'function') {\n endIdx = currentDepth === depth ? arguments.length : idx + value.length;\n value = value.apply(this, _slice(arguments, idx, endIdx));\n currentDepth += 1;\n idx = endIdx;\n }\n return value;\n });\n });\n\n /**\n * Builds a list from a seed value. Accepts an iterator function, which returns\n * either false to stop iteration or an array of length 2 containing the value\n * to add to the resulting list and the seed to be used in the next call to the\n * iterator function.\n *\n * The iterator function receives one argument: *(seed)*.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category List\n * @sig (a -> [b]) -> * -> [b]\n * @param {Function} fn The iterator function. receives one argument, `seed`, and returns\n * either false to quit iteration or an array of length two to proceed. The element\n * at index 0 of this array will be added to the resulting array, and the element\n * at index 1 will be passed to the next call to `fn`.\n * @param {*} seed The seed value.\n * @return {Array} The final list.\n * @example\n *\n * var f = n => n > 50 ? false : [-n, n + 10];\n * R.unfold(f, 10); //=> [-10, -20, -30, -40, -50]\n */\n var unfold = _curry2(function unfold(fn, seed) {\n var pair = fn(seed);\n var result = [];\n while (pair && pair.length) {\n result[result.length] = pair[0];\n pair = fn(pair[1]);\n }\n return result;\n });\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list, based upon the value returned by applying the supplied predicate to\n * two list elements. Prefers the first item if two items compare equal based\n * on the predicate.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * var strEq = R.eqBy(String);\n * R.uniqWith(strEq)([1, '1', 2, 1]); //=> [1, 2]\n * R.uniqWith(strEq)([{}, {}]); //=> [{}]\n * R.uniqWith(strEq)([1, '1', 1]); //=> [1]\n * R.uniqWith(strEq)(['1', 1, 1]); //=> ['1']\n */\n var uniqWith = _curry2(function uniqWith(pred, list) {\n var idx = 0;\n var len = list.length;\n var result = [];\n var item;\n while (idx < len) {\n item = list[idx];\n if (!_containsWith(pred, item, result)) {\n result[result.length] = item;\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Tests the final argument by passing it to the given predicate function. If\n * the predicate is not satisfied, the function will return the result of\n * calling the `whenFalseFn` function with the same argument. If the predicate\n * is satisfied, the argument is returned as is.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} whenFalseFn A function to invoke when the `pred` evaluates\n * to a falsy value.\n * @param {*} x An object to test with the `pred` function and\n * pass to `whenFalseFn` if necessary.\n * @return {*} Either `x` or the result of applying `x` to `whenFalseFn`.\n * @see R.ifElse, R.when\n * @example\n *\n * // coerceArray :: (a|[a]) -> [a]\n * var coerceArray = R.unless(R.isArrayLike, R.of);\n * coerceArray([1, 2, 3]); //=> [1, 2, 3]\n * coerceArray(1); //=> [1]\n */\n var unless = _curry3(function unless(pred, whenFalseFn, x) {\n return pred(x) ? x : whenFalseFn(x);\n });\n\n /**\n * Takes a predicate, a transformation function, and an initial value,\n * and returns a value of the same type as the initial value.\n * It does so by applying the transformation until the predicate is satisfied,\n * at which point it returns the satisfactory value.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} fn The iterator function\n * @param {*} init Initial value\n * @return {*} Final value that satisfies predicate\n * @example\n *\n * R.until(R.gt(R.__, 100), R.multiply(2))(1) // => 128\n */\n var until = _curry3(function until(pred, fn, init) {\n var val = init;\n while (!pred(val)) {\n val = fn(val);\n }\n return val;\n });\n\n /**\n * Returns a new copy of the array with the element at the provided index\n * replaced with the given value.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig Number -> a -> [a] -> [a]\n * @param {Number} idx The index to update.\n * @param {*} x The value to exist at the given index of the returned array.\n * @param {Array|Arguments} list The source array-like object to be updated.\n * @return {Array} A copy of `list` with the value at index `idx` replaced with `x`.\n * @see R.adjust\n * @example\n *\n * R.update(1, 11, [0, 1, 2]); //=> [0, 11, 2]\n * R.update(1)(11)([0, 1, 2]); //=> [0, 11, 2]\n */\n var update = _curry3(function update(idx, x, list) {\n return adjust(always(x), idx, list);\n });\n\n /**\n * Accepts a function `fn` and a list of transformer functions and returns a\n * new curried function. When the new function is invoked, it calls the\n * function `fn` with parameters consisting of the result of calling each\n * supplied handler on successive arguments to the new function.\n *\n * If more arguments are passed to the returned function than transformer\n * functions, those arguments are passed directly to `fn` as additional\n * parameters. If you expect additional arguments that don't need to be\n * transformed, although you can ignore them, it's best to pass an identity\n * function so that the new function reports the correct arity.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (x1 -> x2 -> ... -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)\n * @param {Function} fn The function to wrap.\n * @param {Array} transformers A list of transformer functions\n * @return {Function} The wrapped function.\n * @example\n *\n * R.useWith(Math.pow, [R.identity, R.identity])(3, 4); //=> 81\n * R.useWith(Math.pow, [R.identity, R.identity])(3)(4); //=> 81\n * R.useWith(Math.pow, [R.dec, R.inc])(3, 4); //=> 32\n * R.useWith(Math.pow, [R.dec, R.inc])(3)(4); //=> 32\n */\n var useWith = _curry2(function useWith(fn, transformers) {\n return curryN(transformers.length, function () {\n var args = [];\n var idx = 0;\n while (idx < transformers.length) {\n args.push(transformers[idx].call(this, arguments[idx]));\n idx += 1;\n }\n return fn.apply(this, args.concat(_slice(arguments, transformers.length)));\n });\n });\n\n /**\n * Returns a list of all the enumerable own properties of the supplied object.\n * Note that the order of the output array is not guaranteed across different\n * JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own properties.\n * @example\n *\n * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]\n */\n var values = _curry1(function values(obj) {\n var props = keys(obj);\n var len = props.length;\n var vals = [];\n var idx = 0;\n while (idx < len) {\n vals[idx] = obj[props[idx]];\n idx += 1;\n }\n return vals;\n });\n\n /**\n * Returns a list of all the properties, including prototype properties, of the\n * supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own and prototype properties.\n * @example\n *\n * var F = function() { this.x = 'X'; };\n * F.prototype.y = 'Y';\n * var f = new F();\n * R.valuesIn(f); //=> ['X', 'Y']\n */\n var valuesIn = _curry1(function valuesIn(obj) {\n var prop;\n var vs = [];\n for (prop in obj) {\n vs[vs.length] = obj[prop];\n }\n return vs;\n });\n\n /**\n * Returns a \"view\" of the given data structure, determined by the given lens.\n * The lens's focus determines which portion of the data structure is visible.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Lens s a -> s -> a\n * @param {Lens} lens\n * @param {*} x\n * @return {*}\n * @see R.prop, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.view(xLens, {x: 4, y: 2}); //=> 4\n */\n // `Const` is a functor that effectively ignores the function given to `map`.\n // Using `Const` effectively ignores the setter function of the `lens`,\n // leaving the value returned by the getter function unmodified.\n var view = function () {\n // `Const` is a functor that effectively ignores the function given to `map`.\n var Const = function (x) {\n return {\n value: x,\n map: function () {\n return this;\n }\n };\n };\n return _curry2(function view(lens, x) {\n // Using `Const` effectively ignores the setter function of the `lens`,\n // leaving the value returned by the getter function unmodified.\n return lens(Const)(x).value;\n });\n }();\n\n /**\n * Tests the final argument by passing it to the given predicate function. If\n * the predicate is satisfied, the function will return the result of calling\n * the `whenTrueFn` function with the same argument. If the predicate is not\n * satisfied, the argument is returned as is.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Logic\n * @sig (a -> Boolean) -> (a -> a) -> a -> a\n * @param {Function} pred A predicate function\n * @param {Function} whenTrueFn A function to invoke when the `condition`\n * evaluates to a truthy value.\n * @param {*} x An object to test with the `pred` function and\n * pass to `whenTrueFn` if necessary.\n * @return {*} Either `x` or the result of applying `x` to `whenTrueFn`.\n * @see R.ifElse, R.unless\n * @example\n *\n * // truncate :: String -> String\n * var truncate = R.when(\n * R.propSatisfies(R.gt(R.__, 10), 'length'),\n * R.pipe(R.take(10), R.append('…'), R.join(''))\n * );\n * truncate('12345'); //=> '12345'\n * truncate('0123456789ABC'); //=> '0123456789…'\n */\n var when = _curry3(function when(pred, whenTrueFn, x) {\n return pred(x) ? whenTrueFn(x) : x;\n });\n\n /**\n * Takes a spec object and a test object; returns true if the test satisfies\n * the spec. Each of the spec's own properties must be a predicate function.\n * Each predicate is applied to the value of the corresponding property of the\n * test object. `where` returns true if all the predicates return true, false\n * otherwise.\n *\n * `where` is well suited to declaratively expressing constraints for other\n * functions such as `filter` and `find`.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category Object\n * @sig {String: (* -> Boolean)} -> {String: *} -> Boolean\n * @param {Object} spec\n * @param {Object} testObj\n * @return {Boolean}\n * @example\n *\n * // pred :: Object -> Boolean\n * var pred = R.where({\n * a: R.equals('foo'),\n * b: R.complement(R.equals('bar')),\n * x: R.gt(_, 10),\n * y: R.lt(_, 20)\n * });\n *\n * pred({a: 'foo', b: 'xxx', x: 11, y: 19}); //=> true\n * pred({a: 'xxx', b: 'xxx', x: 11, y: 19}); //=> false\n * pred({a: 'foo', b: 'bar', x: 11, y: 19}); //=> false\n * pred({a: 'foo', b: 'xxx', x: 10, y: 19}); //=> false\n * pred({a: 'foo', b: 'xxx', x: 11, y: 20}); //=> false\n */\n var where = _curry2(function where(spec, testObj) {\n for (var prop in spec) {\n if (_has(prop, spec) && !spec[prop](testObj[prop])) {\n return false;\n }\n }\n return true;\n });\n\n /**\n * Wrap a function inside another to allow you to make adjustments to the\n * parameters, or do other processing either before the internal function is\n * called or with its results.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a... -> b) -> ((a... -> b) -> a... -> c) -> (a... -> c)\n * @param {Function} fn The function to wrap.\n * @param {Function} wrapper The wrapper function.\n * @return {Function} The wrapped function.\n * @example\n *\n * var greet = name => 'Hello ' + name;\n *\n * var shoutedGreet = R.wrap(greet, (gr, name) => gr(name).toUpperCase());\n *\n * shoutedGreet(\"Kathy\"); //=> \"HELLO KATHY\"\n *\n * var shortenedGreet = R.wrap(greet, function(gr, name) {\n * return gr(name.substring(0, 3));\n * });\n * shortenedGreet(\"Robert\"); //=> \"Hello Rob\"\n */\n var wrap = _curry2(function wrap(fn, wrapper) {\n return curryN(fn.length, function () {\n return wrapper.apply(this, _concat([fn], arguments));\n });\n });\n\n /**\n * Creates a new list out of the two supplied by creating each possible pair\n * from the lists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b] -> [[a,b]]\n * @param {Array} as The first list.\n * @param {Array} bs The second list.\n * @return {Array} The list made by combining each possible pair from\n * `as` and `bs` into pairs (`[a, b]`).\n * @example\n *\n * R.xprod([1, 2], ['a', 'b']); //=> [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]\n */\n // = xprodWith(prepend); (takes about 3 times as long...)\n var xprod = _curry2(function xprod(a, b) {\n // = xprodWith(prepend); (takes about 3 times as long...)\n var idx = 0;\n var ilen = a.length;\n var j;\n var jlen = b.length;\n var result = [];\n while (idx < ilen) {\n j = 0;\n while (j < jlen) {\n result[result.length] = [\n a[idx],\n b[j]\n ];\n j += 1;\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Creates a new list out of the two supplied by pairing up equally-positioned\n * items from both lists. The returned list is truncated to the length of the\n * shorter of the two input lists.\n * Note: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b] -> [[a,b]]\n * @param {Array} list1 The first array to consider.\n * @param {Array} list2 The second array to consider.\n * @return {Array} The list made by pairing up same-indexed elements of `list1` and `list2`.\n * @example\n *\n * R.zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]\n */\n var zip = _curry2(function zip(a, b) {\n var rv = [];\n var idx = 0;\n var len = Math.min(a.length, b.length);\n while (idx < len) {\n rv[idx] = [\n a[idx],\n b[idx]\n ];\n idx += 1;\n }\n return rv;\n });\n\n /**\n * Creates a new object out of a list of keys and a list of values.\n * Key/value pairing is truncated to the length of the shorter of the two lists.\n * Note: `zipObj` is equivalent to `pipe(zipWith(pair), fromPairs)`.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig [String] -> [*] -> {String: *}\n * @param {Array} keys The array that will be properties on the output object.\n * @param {Array} values The list of values on the output object.\n * @return {Object} The object made by pairing up same-indexed elements of `keys` and `values`.\n * @example\n *\n * R.zipObj(['a', 'b', 'c'], [1, 2, 3]); //=> {a: 1, b: 2, c: 3}\n */\n var zipObj = _curry2(function zipObj(keys, values) {\n var idx = 0;\n var len = Math.min(keys.length, values.length);\n var out = {};\n while (idx < len) {\n out[keys[idx]] = values[idx];\n idx += 1;\n }\n return out;\n });\n\n /**\n * Creates a new list out of the two supplied by applying the function to each\n * equally-positioned pair in the lists. The returned list is truncated to the\n * length of the shorter of the two input lists.\n *\n * @function\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a,b -> c) -> [a] -> [b] -> [c]\n * @param {Function} fn The function used to combine the two elements into one value.\n * @param {Array} list1 The first array to consider.\n * @param {Array} list2 The second array to consider.\n * @return {Array} The list made by combining same-indexed elements of `list1` and `list2`\n * using `fn`.\n * @example\n *\n * var f = (x, y) => {\n * // ...\n * };\n * R.zipWith(f, [1, 2, 3], ['a', 'b', 'c']);\n * //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]\n */\n var zipWith = _curry3(function zipWith(fn, a, b) {\n var rv = [];\n var idx = 0;\n var len = Math.min(a.length, b.length);\n while (idx < len) {\n rv[idx] = fn(a[idx], b[idx]);\n idx += 1;\n }\n return rv;\n });\n\n /**\n * A function that always returns `false`. Any passed in parameters are ignored.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig * -> Boolean\n * @param {*}\n * @return {Boolean}\n * @see R.always, R.T\n * @example\n *\n * R.F(); //=> false\n */\n var F = always(false);\n\n /**\n * A function that always returns `true`. Any passed in parameters are ignored.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig * -> Boolean\n * @param {*}\n * @return {Boolean}\n * @see R.always, R.F\n * @example\n *\n * R.T(); //=> true\n */\n var T = always(true);\n\n /**\n * Copies an object.\n *\n * @private\n * @param {*} value The value to be copied\n * @param {Array} refFrom Array containing the source references\n * @param {Array} refTo Array containing the copied source references\n * @param {Boolean} deep Whether or not to perform deep cloning.\n * @return {*} The copied value.\n */\n var _clone = function _clone(value, refFrom, refTo, deep) {\n var copy = function copy(copiedValue) {\n var len = refFrom.length;\n var idx = 0;\n while (idx < len) {\n if (value === refFrom[idx]) {\n return refTo[idx];\n }\n idx += 1;\n }\n refFrom[idx + 1] = value;\n refTo[idx + 1] = copiedValue;\n for (var key in value) {\n copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];\n }\n return copiedValue;\n };\n switch (type(value)) {\n case 'Object':\n return copy({});\n case 'Array':\n return copy([]);\n case 'Date':\n return new Date(value.valueOf());\n case 'RegExp':\n return _cloneRegExp(value);\n default:\n return value;\n }\n };\n\n var _createPartialApplicator = function _createPartialApplicator(concat) {\n return _curry2(function (fn, args) {\n return _arity(Math.max(0, fn.length - args.length), function () {\n return fn.apply(this, concat(args, arguments));\n });\n });\n };\n\n var _dropLast = function dropLast(n, xs) {\n return take(n < xs.length ? xs.length - n : 0, xs);\n };\n\n // Values of other types are only equal if identical.\n var _equals = function _equals(a, b, stackA, stackB) {\n if (identical(a, b)) {\n return true;\n }\n if (type(a) !== type(b)) {\n return false;\n }\n if (a == null || b == null) {\n return false;\n }\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n switch (type(a)) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && identical(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!identical(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n case 'Map':\n case 'Set':\n if (!_equals(_arrayFromIterator(a.entries()), _arrayFromIterator(b.entries()), stackA, stackB)) {\n return false;\n }\n break;\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n break;\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n stackA.push(a);\n stackB.push(b);\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], stackA, stackB))) {\n return false;\n }\n idx -= 1;\n }\n stackA.pop();\n stackB.pop();\n return true;\n };\n\n /**\n * `_makeFlat` is a helper function that returns a one-level or fully recursive\n * function based on the flag passed in.\n *\n * @private\n */\n var _makeFlat = function _makeFlat(recursive) {\n return function flatt(list) {\n var value, jlen, j;\n var result = [];\n var idx = 0;\n var ilen = list.length;\n while (idx < ilen) {\n if (isArrayLike(list[idx])) {\n value = recursive ? flatt(list[idx]) : list[idx];\n j = 0;\n jlen = value.length;\n while (j < jlen) {\n result[result.length] = value[j];\n j += 1;\n }\n } else {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n return result;\n };\n };\n\n var _reduce = function () {\n function _arrayReduce(xf, acc, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n acc = xf['@@transducer/step'](acc, list[idx]);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n idx += 1;\n }\n return xf['@@transducer/result'](acc);\n }\n function _iterableReduce(xf, acc, iter) {\n var step = iter.next();\n while (!step.done) {\n acc = xf['@@transducer/step'](acc, step.value);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n step = iter.next();\n }\n return xf['@@transducer/result'](acc);\n }\n function _methodReduce(xf, acc, obj) {\n return xf['@@transducer/result'](obj.reduce(bind(xf['@@transducer/step'], xf), acc));\n }\n var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';\n return function _reduce(fn, acc, list) {\n if (typeof fn === 'function') {\n fn = _xwrap(fn);\n }\n if (isArrayLike(list)) {\n return _arrayReduce(fn, acc, list);\n }\n if (typeof list.reduce === 'function') {\n return _methodReduce(fn, acc, list);\n }\n if (list[symIterator] != null) {\n return _iterableReduce(fn, acc, list[symIterator]());\n }\n if (typeof list.next === 'function') {\n return _iterableReduce(fn, acc, list);\n }\n throw new TypeError('reduce: list must be array or iterable');\n };\n }();\n\n var _stepCat = function () {\n var _stepCatArray = {\n '@@transducer/init': Array,\n '@@transducer/step': function (xs, x) {\n xs.push(x);\n return xs;\n },\n '@@transducer/result': _identity\n };\n var _stepCatString = {\n '@@transducer/init': String,\n '@@transducer/step': function (a, b) {\n return a + b;\n },\n '@@transducer/result': _identity\n };\n var _stepCatObject = {\n '@@transducer/init': Object,\n '@@transducer/step': function (result, input) {\n return _assign(result, isArrayLike(input) ? objOf(input[0], input[1]) : input);\n },\n '@@transducer/result': _identity\n };\n return function _stepCat(obj) {\n if (_isTransformer(obj)) {\n return obj;\n }\n if (isArrayLike(obj)) {\n return _stepCatArray;\n }\n if (typeof obj === 'string') {\n return _stepCatString;\n }\n if (typeof obj === 'object') {\n return _stepCatObject;\n }\n throw new Error('Cannot create transformer for ' + obj);\n };\n }();\n\n var _xdropLastWhile = function () {\n function XDropLastWhile(fn, xf) {\n this.f = fn;\n this.retained = [];\n this.xf = xf;\n }\n XDropLastWhile.prototype['@@transducer/init'] = _xfBase.init;\n XDropLastWhile.prototype['@@transducer/result'] = function (result) {\n this.retained = null;\n return this.xf['@@transducer/result'](result);\n };\n XDropLastWhile.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.retain(result, input) : this.flush(result, input);\n };\n XDropLastWhile.prototype.flush = function (result, input) {\n result = _reduce(this.xf['@@transducer/step'], result, this.retained);\n this.retained = [];\n return this.xf['@@transducer/step'](result, input);\n };\n XDropLastWhile.prototype.retain = function (result, input) {\n this.retained.push(input);\n return result;\n };\n return _curry2(function _xdropLastWhile(fn, xf) {\n return new XDropLastWhile(fn, xf);\n });\n }();\n\n var _xgroupBy = function () {\n function XGroupBy(f, xf) {\n this.xf = xf;\n this.f = f;\n this.inputs = {};\n }\n XGroupBy.prototype['@@transducer/init'] = _xfBase.init;\n XGroupBy.prototype['@@transducer/result'] = function (result) {\n var key;\n for (key in this.inputs) {\n if (_has(key, this.inputs)) {\n result = this.xf['@@transducer/step'](result, this.inputs[key]);\n if (result['@@transducer/reduced']) {\n result = result['@@transducer/value'];\n break;\n }\n }\n }\n this.inputs = null;\n return this.xf['@@transducer/result'](result);\n };\n XGroupBy.prototype['@@transducer/step'] = function (result, input) {\n var key = this.f(input);\n this.inputs[key] = this.inputs[key] || [\n key,\n []\n ];\n this.inputs[key][1] = append(input, this.inputs[key][1]);\n return result;\n };\n return _curry2(function _xgroupBy(f, xf) {\n return new XGroupBy(f, xf);\n });\n }();\n\n /**\n * Creates a new list iteration function from an existing one by adding two new\n * parameters to its callback function: the current index, and the entire list.\n *\n * This would turn, for instance, Ramda's simple `map` function into one that\n * more closely resembles `Array.prototype.map`. Note that this will only work\n * for functions in which the iteration callback function is the first\n * parameter, and where the list is the last parameter. (This latter might be\n * unimportant if the list parameter is not used.)\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Function\n * @category List\n * @sig ((a ... -> b) ... -> [a] -> *) -> (a ..., Int, [a] -> b) ... -> [a] -> *)\n * @param {Function} fn A list iteration function that does not pass index or list to its callback\n * @return {Function} An altered list iteration function that passes (item, index, list) to its callback\n * @example\n *\n * var mapIndexed = R.addIndex(R.map);\n * mapIndexed((val, idx) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);\n * //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']\n */\n var addIndex = _curry1(function addIndex(fn) {\n return curryN(fn.length, function () {\n var idx = 0;\n var origFn = arguments[0];\n var list = arguments[arguments.length - 1];\n var args = _slice(arguments);\n args[0] = function () {\n var result = origFn.apply(this, _concat(arguments, [\n idx,\n list\n ]));\n idx += 1;\n return result;\n };\n return fn.apply(this, args);\n });\n });\n\n /**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly 2 parameters. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.2.0\n * @category Function\n * @sig (* -> c) -> (a, b -> c)\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n * arity 2.\n * @example\n *\n * var takesThreeArgs = function(a, b, c) {\n * return [a, b, c];\n * };\n * takesThreeArgs.length; //=> 3\n * takesThreeArgs(1, 2, 3); //=> [1, 2, 3]\n *\n * var takesTwoArgs = R.binary(takesThreeArgs);\n * takesTwoArgs.length; //=> 2\n * // Only 2 arguments are passed to the wrapped function\n * takesTwoArgs(1, 2, 3); //=> [1, 2, undefined]\n */\n var binary = _curry1(function binary(fn) {\n return nAry(2, fn);\n });\n\n /**\n * Creates a deep copy of the value which may contain (nested) `Array`s and\n * `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are not\n * copied, but assigned by their reference.\n *\n * Dispatches to a `clone` method if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {*} -> {*}\n * @param {*} value The object or array to clone\n * @return {*} A new object or array.\n * @example\n *\n * var objects = [{}, {}, {}];\n * var objectsClone = R.clone(objects);\n * objects[0] === objectsClone[0]; //=> false\n */\n var clone = _curry1(function clone(value) {\n return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);\n });\n\n /**\n * Returns a curried equivalent of the provided function. The curried function\n * has two unusual capabilities. First, its arguments needn't be provided one\n * at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value `R.__` may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is `R.__`, the\n * following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> a) -> (* -> a)\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curryN\n * @example\n *\n * var addFourNumbers = (a, b, c, d) => a + b + c + d;\n *\n * var curriedAddFourNumbers = R.curry(addFourNumbers);\n * var f = curriedAddFourNumbers(1, 2);\n * var g = f(3);\n * g(4); //=> 10\n */\n var curry = _curry1(function curry(fn) {\n return curryN(fn.length, fn);\n });\n\n /**\n * Returns all but the first `n` elements of the given list, string, or\n * transducer/transformer (or object with a `drop` method).\n *\n * Dispatches to the `drop` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n\n * @param {*} list\n * @return {*}\n * @see R.take, R.transduce\n * @example\n *\n * R.drop(1, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n * R.drop(2, ['foo', 'bar', 'baz']); //=> ['baz']\n * R.drop(3, ['foo', 'bar', 'baz']); //=> []\n * R.drop(4, ['foo', 'bar', 'baz']); //=> []\n * R.drop(3, 'ramda'); //=> 'da'\n */\n var drop = _curry2(_dispatchable('drop', _xdrop, function drop(n, xs) {\n return slice(Math.max(0, n), Infinity, xs);\n }));\n\n /**\n * Returns a list containing all but the last `n` elements of the given `list`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n The number of elements of `xs` to skip.\n * @param {Array} xs The collection to consider.\n * @return {Array}\n * @see R.takeLast\n * @example\n *\n * R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n * R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']\n * R.dropLast(3, ['foo', 'bar', 'baz']); //=> []\n * R.dropLast(4, ['foo', 'bar', 'baz']); //=> []\n * R.dropLast(3, 'ramda'); //=> 'ra'\n */\n var dropLast = _curry2(_dispatchable('dropLast', _xdropLast, _dropLast));\n\n /**\n * Returns a new list containing all but last the`n` elements of a given list,\n * passing each value from the right to the supplied predicate function,\n * skipping elements while the predicate function returns `true`. The predicate\n * function is passed one argument: (value)*.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> Boolean) -> [a] -> [a]\n * @param {Function} fn The function called per iteration.\n * @param {Array} list The collection to iterate over.\n * @return {Array} A new array.\n * @see R.takeLastWhile, R.addIndex\n * @example\n *\n * var lteThree = x => x <= 3;\n *\n * R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3, 4]\n */\n var dropLastWhile = _curry2(_dispatchable('dropLastWhile', _xdropLastWhile, _dropLastWhile));\n\n /**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * var a = {}; a.v = a;\n * var b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\n var equals = _curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n });\n\n /**\n * Takes a predicate and a \"filterable\", and returns a new filterable of the\n * same type containing the members of the given filterable which satisfy the\n * given predicate.\n *\n * Dispatches to the `filter` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> f a\n * @param {Function} pred\n * @param {Array} filterable\n * @return {Array}\n * @see R.reject, R.transduce, R.addIndex\n * @example\n *\n * var isEven = n => n % 2 === 0;\n *\n * R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]\n *\n * R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}\n */\n // else\n var filter = _curry2(_dispatchable('filter', _xfilter, function (pred, filterable) {\n return _isObject(filterable) ? _reduce(function (acc, key) {\n if (pred(filterable[key])) {\n acc[key] = filterable[key];\n }\n return acc;\n }, {}, keys(filterable)) : // else\n _filter(pred, filterable);\n }));\n\n /**\n * Returns a new list by pulling every item out of it (and all its sub-arrays)\n * and putting them in a new array, depth-first.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [b]\n * @param {Array} list The array to consider.\n * @return {Array} The flattened list.\n * @see R.unnest\n * @example\n *\n * R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);\n * //=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n */\n var flatten = _curry1(_makeFlat(true));\n\n /**\n * Returns a new function much like the supplied one, except that the first two\n * arguments' order is reversed.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (a -> b -> c -> ... -> z) -> (b -> a -> c -> ... -> z)\n * @param {Function} fn The function to invoke with its first two parameters reversed.\n * @return {*} The result of invoking `fn` with its first two parameters' order reversed.\n * @example\n *\n * var mergeThree = (a, b, c) => [].concat(a, b, c);\n *\n * mergeThree(1, 2, 3); //=> [1, 2, 3]\n *\n * R.flip(mergeThree)(1, 2, 3); //=> [2, 1, 3]\n */\n var flip = _curry1(function flip(fn) {\n return curry(function (a, b) {\n var args = _slice(arguments);\n args[0] = b;\n args[1] = a;\n return fn.apply(this, args);\n });\n });\n\n /**\n * Returns the first element of the given list or string. In some libraries\n * this function is named `first`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> a | Undefined\n * @sig String -> String\n * @param {Array|String} list\n * @return {*}\n * @see R.tail, R.init, R.last\n * @example\n *\n * R.head(['fi', 'fo', 'fum']); //=> 'fi'\n * R.head([]); //=> undefined\n *\n * R.head('abc'); //=> 'a'\n * R.head(''); //=> ''\n */\n var head = nth(0);\n\n /**\n * Returns all but the last element of the given list or string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.last, R.head, R.tail\n * @example\n *\n * R.init([1, 2, 3]); //=> [1, 2]\n * R.init([1, 2]); //=> [1]\n * R.init([1]); //=> []\n * R.init([]); //=> []\n *\n * R.init('abc'); //=> 'ab'\n * R.init('ab'); //=> 'a'\n * R.init('a'); //=> ''\n * R.init(''); //=> ''\n */\n var init = slice(0, -1);\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of those\n * elements common to both lists. Duplication is determined according to the\n * value returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate function that determines whether\n * the two supplied elements are equal.\n * @param {Array} list1 One list of items to compare\n * @param {Array} list2 A second list of items to compare\n * @return {Array} A new list containing those elements common to both lists.\n * @see R.intersection\n * @example\n *\n * var buffaloSpringfield = [\n * {id: 824, name: 'Richie Furay'},\n * {id: 956, name: 'Dewey Martin'},\n * {id: 313, name: 'Bruce Palmer'},\n * {id: 456, name: 'Stephen Stills'},\n * {id: 177, name: 'Neil Young'}\n * ];\n * var csny = [\n * {id: 204, name: 'David Crosby'},\n * {id: 456, name: 'Stephen Stills'},\n * {id: 539, name: 'Graham Nash'},\n * {id: 177, name: 'Neil Young'}\n * ];\n *\n * R.intersectionWith(R.eqBy(R.prop('id')), buffaloSpringfield, csny);\n * //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]\n */\n var intersectionWith = _curry3(function intersectionWith(pred, list1, list2) {\n var lookupList, filteredList;\n if (list1.length > list2.length) {\n lookupList = list1;\n filteredList = list2;\n } else {\n lookupList = list2;\n filteredList = list1;\n }\n var results = [];\n var idx = 0;\n while (idx < filteredList.length) {\n if (_containsWith(pred, filteredList[idx], lookupList)) {\n results[results.length] = filteredList[idx];\n }\n idx += 1;\n }\n return uniqWith(pred, results);\n });\n\n /**\n * Transforms the items of the list with the transducer and appends the\n * transformed items to the accumulator using an appropriate iterator function\n * based on the accumulator type.\n *\n * The accumulator can be an array, string, object or a transformer. Iterated\n * items will be appended to arrays and concatenated to strings. Objects will\n * be merged directly or 2-item arrays will be merged as key, value pairs.\n *\n * The accumulator can also be a transformer object that provides a 2-arity\n * reducing iterator function, step, 0-arity initial value function, init, and\n * 1-arity result extraction function result. The step function is used as the\n * iterator function in reduce. The result function is used to convert the\n * final accumulator into the return type and in most cases is R.identity. The\n * init function is used to provide the initial accumulator.\n *\n * The iteration is performed with R.reduce after initializing the transducer.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig a -> (b -> b) -> [c] -> a\n * @param {*} acc The initial accumulator value.\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var transducer = R.compose(R.map(R.add(1)), R.take(2));\n *\n * R.into([], transducer, numbers); //=> [2, 3]\n *\n * var intoArray = R.into([]);\n * intoArray(transducer, numbers); //=> [2, 3]\n */\n var into = _curry3(function into(acc, xf, list) {\n return _isTransformer(acc) ? _reduce(xf(acc), acc['@@transducer/init'](), list) : _reduce(xf(_stepCat(acc)), _clone(acc, [], [], false), list);\n });\n\n /**\n * Same as R.invertObj, however this accounts for objects with duplicate values\n * by putting the values into an array.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {s: x} -> {x: [ s, ... ]}\n * @param {Object} obj The object or array to invert\n * @return {Object} out A new object with keys\n * in an array.\n * @example\n *\n * var raceResultsByFirstName = {\n * first: 'alice',\n * second: 'jake',\n * third: 'alice',\n * };\n * R.invert(raceResultsByFirstName);\n * //=> { 'alice': ['first', 'third'], 'jake':['second'] }\n */\n var invert = _curry1(function invert(obj) {\n var props = keys(obj);\n var len = props.length;\n var idx = 0;\n var out = {};\n while (idx < len) {\n var key = props[idx];\n var val = obj[key];\n var list = _has(val, out) ? out[val] : out[val] = [];\n list[list.length] = key;\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new object with the keys of the given object as values, and the\n * values of the given object, which are coerced to strings, as keys. Note\n * that the last key found is preferred when handling the same value.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig {s: x} -> {x: s}\n * @param {Object} obj The object or array to invert\n * @return {Object} out A new object\n * @example\n *\n * var raceResults = {\n * first: 'alice',\n * second: 'jake'\n * };\n * R.invertObj(raceResults);\n * //=> { 'alice': 'first', 'jake':'second' }\n *\n * // Alternatively:\n * var raceResults = ['alice', 'jake'];\n * R.invertObj(raceResults);\n * //=> { 'alice': '0', 'jake':'1' }\n */\n var invertObj = _curry1(function invertObj(obj) {\n var props = keys(obj);\n var len = props.length;\n var idx = 0;\n var out = {};\n while (idx < len) {\n var key = props[idx];\n out[obj[key]] = key;\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns `true` if the given value is its type's empty value; `false`\n * otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Logic\n * @sig a -> Boolean\n * @param {*} x\n * @return {Boolean}\n * @see R.empty\n * @example\n *\n * R.isEmpty([1, 2, 3]); //=> false\n * R.isEmpty([]); //=> true\n * R.isEmpty(''); //=> true\n * R.isEmpty(null); //=> false\n * R.isEmpty({}); //=> true\n * R.isEmpty({length: 0}); //=> false\n */\n var isEmpty = _curry1(function isEmpty(x) {\n return x != null && equals(x, empty(x));\n });\n\n /**\n * Returns the last element of the given list or string.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig [a] -> a | Undefined\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.init, R.head, R.tail\n * @example\n *\n * R.last(['fi', 'fo', 'fum']); //=> 'fum'\n * R.last([]); //=> undefined\n *\n * R.last('abc'); //=> 'c'\n * R.last(''); //=> ''\n */\n var last = nth(-1);\n\n /**\n * Returns the position of the last occurrence of an item in an array, or -1 if\n * the item is not included in the array. `R.equals` is used to determine\n * equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Number\n * @param {*} target The item to find.\n * @param {Array} xs The array to search in.\n * @return {Number} the index of the target, or -1 if the target is not found.\n * @see R.indexOf\n * @example\n *\n * R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=> 6\n * R.lastIndexOf(10, [1,2,3,4]); //=> -1\n */\n var lastIndexOf = _curry2(function lastIndexOf(target, xs) {\n if (typeof xs.lastIndexOf === 'function' && !_isArray(xs)) {\n return xs.lastIndexOf(target);\n } else {\n var idx = xs.length - 1;\n while (idx >= 0) {\n if (equals(xs[idx], target)) {\n return idx;\n }\n idx -= 1;\n }\n return -1;\n }\n });\n\n /**\n * Takes a function and\n * a [functor](https://github.com/fantasyland/fantasy-land#functor),\n * applies the function to each of the functor's values, and returns\n * a functor of the same shape.\n *\n * Ramda provides suitable `map` implementations for `Array` and `Object`,\n * so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.\n *\n * Dispatches to the `map` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * Also treats functions as functors and will compose them together.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Functor f => (a -> b) -> f a -> f b\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {Array} list The list to be iterated over.\n * @return {Array} The new list.\n * @see R.transduce, R.addIndex\n * @example\n *\n * var double = x => x * 2;\n *\n * R.map(double, [1, 2, 3]); //=> [2, 4, 6]\n *\n * R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}\n */\n var map = _curry2(_dispatchable('map', _xmap, function map(fn, functor) {\n switch (Object.prototype.toString.call(functor)) {\n case '[object Function]':\n return curryN(functor.length, function () {\n return fn.call(this, functor.apply(this, arguments));\n });\n case '[object Object]':\n return _reduce(function (acc, key) {\n acc[key] = fn(functor[key]);\n return acc;\n }, {}, keys(functor));\n default:\n return _map(fn, functor);\n }\n }));\n\n /**\n * An Object-specific version of `map`. The function is applied to three\n * arguments: *(value, key, obj)*. If only the value is significant, use\n * `map` instead.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Object\n * @sig ((*, String, Object) -> *) -> Object -> Object\n * @param {Function} fn\n * @param {Object} obj\n * @return {Object}\n * @see R.map\n * @example\n *\n * var values = { x: 1, y: 2, z: 3 };\n * var prependKeyAndDouble = (num, key, obj) => key + (num * 2);\n *\n * R.mapObjIndexed(prependKeyAndDouble, values); //=> { x: 'x2', y: 'y4', z: 'z6' }\n */\n var mapObjIndexed = _curry2(function mapObjIndexed(fn, obj) {\n return _reduce(function (acc, key) {\n acc[key] = fn(obj[key], key, obj);\n return acc;\n }, {}, keys(obj));\n });\n\n /**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the values\n * associated with the key in each object, with the result being used as the\n * value associated with the key in the returned object. The key will be\n * excluded from the returned object if the resulting value is `undefined`.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig (a -> a -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.merge, R.mergeWithKey\n * @example\n *\n * R.mergeWith(R.concat,\n * { a: true, values: [10, 20] },\n * { b: true, values: [15, 35] });\n * //=> { a: true, b: true, values: [10, 20, 15, 35] }\n */\n var mergeWith = _curry3(function mergeWith(fn, l, r) {\n return mergeWithKey(function (_, _l, _r) {\n return fn(_l, _r);\n }, l, r);\n });\n\n /**\n * Takes a function `f` and a list of arguments, and returns a function `g`.\n * When applied, `g` returns the result of applying `f` to the arguments\n * provided initially followed by the arguments provided to `g`.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)\n * @param {Function} f\n * @param {Array} args\n * @return {Function}\n * @see R.partialRight\n * @example\n *\n * var multiply = (a, b) => a * b;\n * var double = R.partial(multiply, [2]);\n * double(2); //=> 4\n *\n * var greet = (salutation, title, firstName, lastName) =>\n * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n *\n * var sayHello = R.partial(greet, ['Hello']);\n * var sayHelloToMs = R.partial(sayHello, ['Ms.']);\n * sayHelloToMs('Jane', 'Jones'); //=> 'Hello, Ms. Jane Jones!'\n */\n var partial = _createPartialApplicator(_concat);\n\n /**\n * Takes a function `f` and a list of arguments, and returns a function `g`.\n * When applied, `g` returns the result of applying `f` to the arguments\n * provided to `g` followed by the arguments provided initially.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a, b, c, ..., n) -> x) -> [d, e, f, ..., n] -> ((a, b, c, ...) -> x)\n * @param {Function} f\n * @param {Array} args\n * @return {Function}\n * @see R.partial\n * @example\n *\n * var greet = (salutation, title, firstName, lastName) =>\n * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n *\n * var greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);\n *\n * greetMsJaneJones('Hello'); //=> 'Hello, Ms. Jane Jones!'\n */\n var partialRight = _createPartialApplicator(flip(_concat));\n\n /**\n * Determines whether a nested path on an object has a specific value, in\n * `R.equals` terms. Most likely used to filter a list.\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Relation\n * @sig [String] -> * -> {String: *} -> Boolean\n * @param {Array} path The path of the nested property to use\n * @param {*} val The value to compare the nested property with\n * @param {Object} obj The object to check the nested property in\n * @return {Boolean} `true` if the value equals the nested object property,\n * `false` otherwise.\n * @example\n *\n * var user1 = { address: { zipCode: 90210 } };\n * var user2 = { address: { zipCode: 55555 } };\n * var user3 = { name: 'Bob' };\n * var users = [ user1, user2, user3 ];\n * var isFamous = R.pathEq(['address', 'zipCode'], 90210);\n * R.filter(isFamous, users); //=> [ user1 ]\n */\n var pathEq = _curry3(function pathEq(_path, val, obj) {\n return equals(path(_path, obj), val);\n });\n\n /**\n * Returns a new list by plucking the same named property off all objects in\n * the list supplied.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig k -> [{k: v}] -> [v]\n * @param {Number|String} key The key name to pluck off of each object.\n * @param {Array} list The array to consider.\n * @return {Array} The list of values for the given key.\n * @see R.props\n * @example\n *\n * R.pluck('a')([{a: 1}, {a: 2}]); //=> [1, 2]\n * R.pluck(0)([[1, 2], [3, 4]]); //=> [1, 3]\n */\n var pluck = _curry2(function pluck(p, list) {\n return map(prop(p), list);\n });\n\n /**\n * Reasonable analog to SQL `select` statement.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @category Relation\n * @sig [k] -> [{k: v}] -> [{k: v}]\n * @param {Array} props The property names to project\n * @param {Array} objs The objects to query\n * @return {Array} An array of objects with just the `props` properties.\n * @example\n *\n * var abby = {name: 'Abby', age: 7, hair: 'blond', grade: 2};\n * var fred = {name: 'Fred', age: 12, hair: 'brown', grade: 7};\n * var kids = [abby, fred];\n * R.project(['name', 'grade'], kids); //=> [{name: 'Abby', grade: 2}, {name: 'Fred', grade: 7}]\n */\n // passing `identity` gives correct arity\n var project = useWith(_map, [\n pickAll,\n identity\n ]);\n\n /**\n * Returns `true` if the specified object property is equal, in `R.equals`\n * terms, to the given value; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig String -> a -> Object -> Boolean\n * @param {String} name\n * @param {*} val\n * @param {*} obj\n * @return {Boolean}\n * @see R.equals, R.propSatisfies\n * @example\n *\n * var abby = {name: 'Abby', age: 7, hair: 'blond'};\n * var fred = {name: 'Fred', age: 12, hair: 'brown'};\n * var rusty = {name: 'Rusty', age: 10, hair: 'brown'};\n * var alois = {name: 'Alois', age: 15, disposition: 'surly'};\n * var kids = [abby, fred, rusty, alois];\n * var hasBrownHair = R.propEq('hair', 'brown');\n * R.filter(hasBrownHair, kids); //=> [fred, rusty]\n */\n var propEq = _curry3(function propEq(name, val, obj) {\n return propSatisfies(equals(val), name, obj);\n });\n\n /**\n * Returns `true` if the specified object property is of the given type;\n * `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Type\n * @sig Type -> String -> Object -> Boolean\n * @param {Function} type\n * @param {String} name\n * @param {*} obj\n * @return {Boolean}\n * @see R.is, R.propSatisfies\n * @example\n *\n * R.propIs(Number, 'x', {x: 1, y: 2}); //=> true\n * R.propIs(Number, 'x', {x: 'foo'}); //=> false\n * R.propIs(Number, 'x', {}); //=> false\n */\n var propIs = _curry3(function propIs(type, name, obj) {\n return propSatisfies(is(type), name, obj);\n });\n\n /**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It may use\n * `R.reduced` to shortcut the iteration.\n *\n * Note: `R.reduce` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n *\n * Dispatches to the `reduce` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig ((a, b) -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduced, R.addIndex\n * @example\n *\n * var numbers = [1, 2, 3];\n * var add = (a, b) => a + b;\n *\n * R.reduce(add, 10, numbers); //=> 16\n */\n var reduce = _curry3(_reduce);\n\n /**\n * Groups the elements of the list according to the result of calling\n * the String-returning function `keyFn` on each element and reduces the elements\n * of each group to a single value via the reducer function `valueFn`.\n *\n * This function is basically a more general `groupBy` function.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category List\n * @sig ((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}\n * @param {Function} valueFn The function that reduces the elements of each group to a single\n * value. Receives two values, accumulator for a particular group and the current element.\n * @param {*} acc The (initial) accumulator value for each group.\n * @param {Function} keyFn The function that maps the list's element into a key.\n * @param {Array} list The array to group.\n * @return {Object} An object with the output of `keyFn` for keys, mapped to the output of\n * `valueFn` for elements which produced that key when passed to `keyFn`.\n * @see R.groupBy, R.reduce\n * @example\n *\n * var reduceToNamesBy = R.reduceBy((acc, student) => acc.concat(student.name), []);\n * var namesByGrade = reduceToNamesBy(function(student) {\n * var score = student.score;\n * return score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A';\n * });\n * var students = [{name: 'Lucy', score: 92},\n * {name: 'Drew', score: 85},\n * // ...\n * {name: 'Bart', score: 62}];\n * namesByGrade(students);\n * // {\n * // 'A': ['Lucy'],\n * // 'B': ['Drew']\n * // // ...,\n * // 'F': ['Bart']\n * // }\n */\n var reduceBy = _curryN(4, [], function reduceBy(valueFn, valueAcc, keyFn, list) {\n return _reduce(function (acc, elt) {\n var key = keyFn(elt);\n acc[key] = valueFn(_has(key, acc) ? acc[key] : valueAcc, elt);\n return acc;\n }, {}, list);\n });\n\n /**\n * The complement of `filter`.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> f a\n * @param {Function} pred\n * @param {Array} filterable\n * @return {Array}\n * @see R.filter, R.transduce, R.addIndex\n * @example\n *\n * var isOdd = (n) => n % 2 === 1;\n *\n * R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]\n *\n * R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}\n */\n var reject = _curry2(function reject(pred, filterable) {\n return filter(_complement(pred), filterable);\n });\n\n /**\n * Returns a fixed list of size `n` containing a specified identical value.\n *\n * @func\n * @memberOf R\n * @since v0.1.1\n * @category List\n * @sig a -> n -> [a]\n * @param {*} value The value to repeat.\n * @param {Number} n The desired size of the output list.\n * @return {Array} A new array containing `n` `value`s.\n * @example\n *\n * R.repeat('hi', 5); //=> ['hi', 'hi', 'hi', 'hi', 'hi']\n *\n * var obj = {};\n * var repeatedObjs = R.repeat(obj, 5); //=> [{}, {}, {}, {}, {}]\n * repeatedObjs[0] === repeatedObjs[1]; //=> true\n */\n var repeat = _curry2(function repeat(value, n) {\n return times(always(value), n);\n });\n\n /**\n * Adds together all the elements of a list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list An array of numbers\n * @return {Number} The sum of all the numbers in the list.\n * @see R.reduce\n * @example\n *\n * R.sum([2,4,6,8,100,1]); //=> 121\n */\n var sum = reduce(add, 0);\n\n /**\n * Returns a new list containing the last `n` elements of the given list.\n * If `n > list.length`, returns a list of `list.length` elements.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n The number of elements to return.\n * @param {Array} xs The collection to consider.\n * @return {Array}\n * @see R.dropLast\n * @example\n *\n * R.takeLast(1, ['foo', 'bar', 'baz']); //=> ['baz']\n * R.takeLast(2, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n * R.takeLast(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.takeLast(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.takeLast(3, 'ramda'); //=> 'mda'\n */\n var takeLast = _curry2(function takeLast(n, xs) {\n return drop(n >= 0 ? xs.length - n : 0, xs);\n });\n\n /**\n * Initializes a transducer using supplied iterator function. Returns a single\n * item by iterating through the list, successively calling the transformed\n * iterator function and passing it an accumulator value and the current value\n * from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It will be\n * wrapped as a transformer to initialize the transducer. A transformer can be\n * passed directly in place of an iterator function. In both cases, iteration\n * may be stopped early with the `R.reduced` function.\n *\n * A transducer is a function that accepts a transformer and returns a\n * transformer and can be composed directly.\n *\n * A transformer is an an object that provides a 2-arity reducing iterator\n * function, step, 0-arity initial value function, init, and 1-arity result\n * extraction function, result. The step function is used as the iterator\n * function in reduce. The result function is used to convert the final\n * accumulator into the return type and in most cases is R.identity. The init\n * function can be used to provide an initial accumulator, but is ignored by\n * transduce.\n *\n * The iteration is performed with R.reduce after initializing the transducer.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category List\n * @sig (c -> c) -> (a,b -> a) -> a -> [b] -> a\n * @param {Function} xf The transducer function. Receives a transformer and returns a transformer.\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array. Wrapped as transformer, if necessary, and used to\n * initialize the transducer\n * @param {*} acc The initial accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduce, R.reduced, R.into\n * @example\n *\n * var numbers = [1, 2, 3, 4];\n * var transducer = R.compose(R.map(R.add(1)), R.take(2));\n *\n * R.transduce(transducer, R.flip(R.append), [], numbers); //=> [2, 3]\n */\n var transduce = curryN(4, function transduce(xf, fn, acc, list) {\n return _reduce(xf(typeof fn === 'function' ? _xwrap(fn) : fn), acc, list);\n });\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\n * of each list. Duplication is determined according to the value returned by\n * applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [*] -> [*] -> [*]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The first and second lists concatenated, with\n * duplicates removed.\n * @see R.union\n * @example\n *\n * var l1 = [{a: 1}, {a: 2}];\n * var l2 = [{a: 1}, {a: 4}];\n * R.unionWith(R.eqBy(R.prop('a')), l1, l2); //=> [{a: 1}, {a: 2}, {a: 4}]\n */\n var unionWith = _curry3(function unionWith(pred, list1, list2) {\n return uniqWith(pred, _concat(list1, list2));\n });\n\n /**\n * Takes a spec object and a test object; returns true if the test satisfies\n * the spec, false otherwise. An object satisfies the spec if, for each of the\n * spec's own properties, accessing that property of the object gives the same\n * value (in `R.equals` terms) as accessing that property of the spec.\n *\n * `whereEq` is a specialization of [`where`](#where).\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @sig {String: *} -> {String: *} -> Boolean\n * @param {Object} spec\n * @param {Object} testObj\n * @return {Boolean}\n * @see R.where\n * @example\n *\n * // pred :: Object -> Boolean\n * var pred = R.whereEq({a: 1, b: 2});\n *\n * pred({a: 1}); //=> false\n * pred({a: 1, b: 2}); //=> true\n * pred({a: 1, b: 2, c: 3}); //=> true\n * pred({a: 1, b: 1}); //=> false\n */\n var whereEq = _curry2(function whereEq(spec, testObj) {\n return where(map(equals, spec), testObj);\n });\n\n var _flatCat = function () {\n var preservingReduced = function (xf) {\n return {\n '@@transducer/init': _xfBase.init,\n '@@transducer/result': function (result) {\n return xf['@@transducer/result'](result);\n },\n '@@transducer/step': function (result, input) {\n var ret = xf['@@transducer/step'](result, input);\n return ret['@@transducer/reduced'] ? _forceReduced(ret) : ret;\n }\n };\n };\n return function _xcat(xf) {\n var rxf = preservingReduced(xf);\n return {\n '@@transducer/init': _xfBase.init,\n '@@transducer/result': function (result) {\n return rxf['@@transducer/result'](result);\n },\n '@@transducer/step': function (result, input) {\n return !isArrayLike(input) ? _reduce(rxf, result, [input]) : _reduce(rxf, result, input);\n }\n };\n };\n }();\n\n // Array.prototype.indexOf doesn't exist below IE9\n // manually crawl the list to distinguish between +0 and -0\n // NaN\n // non-zero numbers can utilise Set\n // all these types can utilise Set\n // null can utilise Set\n // anything else not covered above, defer to R.equals\n var _indexOf = function _indexOf(list, a, idx) {\n var inf, item;\n // Array.prototype.indexOf doesn't exist below IE9\n if (typeof list.indexOf === 'function') {\n switch (typeof a) {\n case 'number':\n if (a === 0) {\n // manually crawl the list to distinguish between +0 and -0\n inf = 1 / a;\n while (idx < list.length) {\n item = list[idx];\n if (item === 0 && 1 / item === inf) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n } else if (a !== a) {\n // NaN\n while (idx < list.length) {\n item = list[idx];\n if (typeof item === 'number' && item !== item) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }\n // non-zero numbers can utilise Set\n return list.indexOf(a, idx);\n // all these types can utilise Set\n case 'string':\n case 'boolean':\n case 'function':\n case 'undefined':\n return list.indexOf(a, idx);\n case 'object':\n if (a === null) {\n // null can utilise Set\n return list.indexOf(a, idx);\n }\n }\n }\n // anything else not covered above, defer to R.equals\n while (idx < list.length) {\n if (equals(list[idx], a)) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n };\n\n var _xchain = _curry2(function _xchain(f, xf) {\n return map(f, _flatCat(xf));\n });\n\n /**\n * Takes a list of predicates and returns a predicate that returns true for a\n * given list of arguments if every one of the provided predicates is satisfied\n * by those arguments.\n *\n * The function returned is a curried function whose arity matches that of the\n * highest-arity predicate.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Logic\n * @sig [(*... -> Boolean)] -> (*... -> Boolean)\n * @param {Array} preds\n * @return {Function}\n * @see R.anyPass\n * @example\n *\n * var isQueen = R.propEq('rank', 'Q');\n * var isSpade = R.propEq('suit', '♠︎');\n * var isQueenOfSpades = R.allPass([isQueen, isSpade]);\n *\n * isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false\n * isQueenOfSpades({rank: 'Q', suit: '♠︎'}); //=> true\n */\n var allPass = _curry1(function allPass(preds) {\n return curryN(reduce(max, 0, pluck('length', preds)), function () {\n var idx = 0;\n var len = preds.length;\n while (idx < len) {\n if (!preds[idx].apply(this, arguments)) {\n return false;\n }\n idx += 1;\n }\n return true;\n });\n });\n\n /**\n * Returns `true` if all elements are unique, in `R.equals` terms, otherwise\n * `false`.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category List\n * @sig [a] -> Boolean\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if all elements are unique, else `false`.\n * @deprecated since v0.20.0\n * @example\n *\n * R.allUniq(['1', 1]); //=> true\n * R.allUniq([1, 1]); //=> false\n * R.allUniq([[42], [42]]); //=> false\n */\n var allUniq = _curry1(function allUniq(list) {\n var len = list.length;\n var idx = 0;\n while (idx < len) {\n if (_indexOf(list, list[idx], idx + 1) >= 0) {\n return false;\n }\n idx += 1;\n }\n return true;\n });\n\n /**\n * Takes a list of predicates and returns a predicate that returns true for a\n * given list of arguments if at least one of the provided predicates is\n * satisfied by those arguments.\n *\n * The function returned is a curried function whose arity matches that of the\n * highest-arity predicate.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Logic\n * @sig [(*... -> Boolean)] -> (*... -> Boolean)\n * @param {Array} preds\n * @return {Function}\n * @see R.allPass\n * @example\n *\n * var gte = R.anyPass([R.gt, R.equals]);\n *\n * gte(3, 2); //=> true\n * gte(2, 2); //=> true\n * gte(2, 3); //=> false\n */\n var anyPass = _curry1(function anyPass(preds) {\n return curryN(reduce(max, 0, pluck('length', preds)), function () {\n var idx = 0;\n var len = preds.length;\n while (idx < len) {\n if (preds[idx].apply(this, arguments)) {\n return true;\n }\n idx += 1;\n }\n return false;\n });\n });\n\n /**\n * ap applies a list of functions to a list of values.\n *\n * Dispatches to the `ap` method of the second argument, if present. Also\n * treats functions as applicatives.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig [f] -> [a] -> [f a]\n * @param {Array} fns An array of functions\n * @param {Array} vs An array of values\n * @return {Array} An array of results of applying each of `fns` to all of `vs` in turn.\n * @example\n *\n * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]\n */\n // else\n var ap = _curry2(function ap(applicative, fn) {\n return typeof applicative.ap === 'function' ? applicative.ap(fn) : typeof applicative === 'function' ? curryN(Math.max(applicative.length, fn.length), function () {\n return applicative.apply(this, arguments)(fn.apply(this, arguments));\n }) : // else\n _reduce(function (acc, f) {\n return _concat(acc, map(f, fn));\n }, [], applicative);\n });\n\n /**\n * Given a spec object recursively mapping properties to functions, creates a\n * function producing an object of the same structure, by mapping each property\n * to the result of calling its associated function with the supplied arguments.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category Function\n * @sig {k: ((a, b, ..., m) -> v)} -> ((a, b, ..., m) -> {k: v})\n * @param {Object} spec an object recursively mapping properties to functions for\n * producing the values for these properties.\n * @return {Function} A function that returns an object of the same structure\n * as `spec', with each property set to the value returned by calling its\n * associated function with the supplied arguments.\n * @see R.juxt\n * @example\n *\n * var getMetrics = R.applySpec({\n * sum: R.add,\n * nested: { mul: R.multiply }\n * });\n * getMetrics(2, 4); // => { sum: 6, nested: { mul: 8 } }\n */\n var applySpec = _curry1(function applySpec(spec) {\n spec = map(function (v) {\n return typeof v == 'function' ? v : applySpec(v);\n }, spec);\n return curryN(reduce(max, 0, pluck('length', values(spec))), function () {\n var args = arguments;\n return map(function (f) {\n return apply(f, args);\n }, spec);\n });\n });\n\n /**\n * Returns the result of calling its first argument with the remaining\n * arguments. This is occasionally useful as a converging function for\n * `R.converge`: the left branch can produce a function while the right branch\n * produces a value to be passed to that function as an argument.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category Function\n * @sig (*... -> a),*... -> a\n * @param {Function} fn The function to apply to the remaining arguments.\n * @param {...*} args Any number of positional arguments.\n * @return {*}\n * @see R.apply\n * @example\n *\n * var indentN = R.pipe(R.times(R.always(' ')),\n * R.join(''),\n * R.replace(/^(?!$)/gm));\n *\n * var format = R.converge(R.call, [\n * R.pipe(R.prop('indent'), indentN),\n * R.prop('value')\n * ]);\n *\n * format({indent: 2, value: 'foo\\nbar\\nbaz\\n'}); //=> ' foo\\n bar\\n baz\\n'\n */\n var call = curry(function call(fn) {\n return fn.apply(this, _slice(arguments, 1));\n });\n\n /**\n * `chain` maps a function over a list and concatenates the results. `chain`\n * is also known as `flatMap` in some libraries\n *\n * Dispatches to the `chain` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig (a -> [b]) -> [a] -> [b]\n * @param {Function} fn\n * @param {Array} list\n * @return {Array}\n * @example\n *\n * var duplicate = n => [n, n];\n * R.chain(duplicate, [1, 2, 3]); //=> [1, 1, 2, 2, 3, 3]\n */\n var chain = _curry2(_dispatchable('chain', _xchain, function chain(fn, monad) {\n if (typeof monad === 'function') {\n return function () {\n return monad.call(this, fn.apply(this, arguments)).apply(this, arguments);\n };\n }\n return _makeFlat(false)(map(fn, monad));\n }));\n\n /**\n * Returns a function, `fn`, which encapsulates if/else-if/else logic.\n * `R.cond` takes a list of [predicate, transform] pairs. All of the arguments\n * to `fn` are applied to each of the predicates in turn until one returns a\n * \"truthy\" value, at which point `fn` returns the result of applying its\n * arguments to the corresponding transformer. If none of the predicates\n * matches, `fn` returns undefined.\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Logic\n * @sig [[(*... -> Boolean),(*... -> *)]] -> (*... -> *)\n * @param {Array} pairs\n * @return {Function}\n * @example\n *\n * var fn = R.cond([\n * [R.equals(0), R.always('water freezes at 0°C')],\n * [R.equals(100), R.always('water boils at 100°C')],\n * [R.T, temp => 'nothing special happens at ' + temp + '°C']\n * ]);\n * fn(0); //=> 'water freezes at 0°C'\n * fn(50); //=> 'nothing special happens at 50°C'\n * fn(100); //=> 'water boils at 100°C'\n */\n var cond = _curry1(function cond(pairs) {\n var arity = reduce(max, 0, map(function (pair) {\n return pair[0].length;\n }, pairs));\n return _arity(arity, function () {\n var idx = 0;\n while (idx < pairs.length) {\n if (pairs[idx][0].apply(this, arguments)) {\n return pairs[idx][1].apply(this, arguments);\n }\n idx += 1;\n }\n });\n });\n\n /**\n * Wraps a constructor function inside a curried function that can be called\n * with the same arguments and returns the same type. The arity of the function\n * returned is specified to allow using variadic constructor functions.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Function\n * @sig Number -> (* -> {*}) -> (* -> {*})\n * @param {Number} n The arity of the constructor function.\n * @param {Function} Fn The constructor function to wrap.\n * @return {Function} A wrapped, curried constructor function.\n * @example\n *\n * // Variadic constructor function\n * var Widget = () => {\n * this.children = Array.prototype.slice.call(arguments);\n * // ...\n * };\n * Widget.prototype = {\n * // ...\n * };\n * var allConfigs = [\n * // ...\n * ];\n * R.map(R.constructN(1, Widget), allConfigs); // a list of Widgets\n */\n var constructN = _curry2(function constructN(n, Fn) {\n if (n > 10) {\n throw new Error('Constructor with greater than ten arguments');\n }\n if (n === 0) {\n return function () {\n return new Fn();\n };\n }\n return curry(nAry(n, function ($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {\n switch (arguments.length) {\n case 1:\n return new Fn($0);\n case 2:\n return new Fn($0, $1);\n case 3:\n return new Fn($0, $1, $2);\n case 4:\n return new Fn($0, $1, $2, $3);\n case 5:\n return new Fn($0, $1, $2, $3, $4);\n case 6:\n return new Fn($0, $1, $2, $3, $4, $5);\n case 7:\n return new Fn($0, $1, $2, $3, $4, $5, $6);\n case 8:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7);\n case 9:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8);\n case 10:\n return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8, $9);\n }\n }));\n });\n\n /**\n * Accepts a converging function and a list of branching functions and returns\n * a new function. When invoked, this new function is applied to some\n * arguments, each branching function is applied to those same arguments. The\n * results of each branching function are passed as arguments to the converging\n * function to produce the return value.\n *\n * @func\n * @memberOf R\n * @since v0.4.2\n * @category Function\n * @sig (x1 -> x2 -> ... -> z) -> [(a -> b -> ... -> x1), (a -> b -> ... -> x2), ...] -> (a -> b -> ... -> z)\n * @param {Function} after A function. `after` will be invoked with the return values of\n * `fn1` and `fn2` as its arguments.\n * @param {Array} functions A list of functions.\n * @return {Function} A new function.\n * @example\n *\n * var add = (a, b) => a + b;\n * var multiply = (a, b) => a * b;\n * var subtract = (a, b) => a - b;\n *\n * //≅ multiply( add(1, 2), subtract(1, 2) );\n * R.converge(multiply, [add, subtract])(1, 2); //=> -3\n *\n * var add3 = (a, b, c) => a + b + c;\n * R.converge(add3, [multiply, add, subtract])(1, 2); //=> 4\n */\n var converge = _curry2(function converge(after, fns) {\n return curryN(reduce(max, 0, pluck('length', fns)), function () {\n var args = arguments;\n var context = this;\n return after.apply(context, _map(function (fn) {\n return fn.apply(context, args);\n }, fns));\n });\n });\n\n /**\n * Counts the elements of a list according to how many match each value of a\n * key generated by the supplied function. Returns an object mapping the keys\n * produced by `fn` to the number of occurrences in the list. Note that all\n * keys are coerced to strings because of how JavaScript objects work.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig (a -> String) -> [a] -> {*}\n * @param {Function} fn The function used to map values to keys.\n * @param {Array} list The list to count elements from.\n * @return {Object} An object mapping keys to number of occurrences in the list.\n * @example\n *\n * var numbers = [1.0, 1.1, 1.2, 2.0, 3.0, 2.2];\n * var letters = R.split('', 'abcABCaaaBBc');\n * R.countBy(Math.floor)(numbers); //=> {'1': 3, '2': 2, '3': 1}\n * R.countBy(R.toLower)(letters); //=> {'a': 5, 'b': 4, 'c': 3}\n */\n var countBy = reduceBy(function (acc, elem) {\n return acc + 1;\n }, 0);\n\n /**\n * Returns a new list without any consecutively repeating elements. Equality is\n * determined by applying the supplied predicate two consecutive elements. The\n * first element in a series of equal element is the one being preserved.\n *\n * Dispatches to the `dropRepeatsWith` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig (a, a -> Boolean) -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list The array to consider.\n * @return {Array} `list` without repeating elements.\n * @see R.transduce\n * @example\n *\n * var l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];\n * R.dropRepeatsWith(R.eqBy(Math.abs), l); //=> [1, 3, 4, -5, 3]\n */\n var dropRepeatsWith = _curry2(_dispatchable('dropRepeatsWith', _xdropRepeatsWith, function dropRepeatsWith(pred, list) {\n var result = [];\n var idx = 1;\n var len = list.length;\n if (len !== 0) {\n result[0] = list[0];\n while (idx < len) {\n if (!pred(last(result), list[idx])) {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n }\n return result;\n }));\n\n /**\n * Takes a function and two values in its domain and returns `true` if the\n * values map to the same value in the codomain; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Relation\n * @sig (a -> b) -> a -> a -> Boolean\n * @param {Function} f\n * @param {*} x\n * @param {*} y\n * @return {Boolean}\n * @example\n *\n * R.eqBy(Math.abs, 5, -5); //=> true\n */\n var eqBy = _curry3(function eqBy(f, x, y) {\n return equals(f(x), f(y));\n });\n\n /**\n * Reports whether two objects have the same value, in `R.equals` terms, for\n * the specified property. Useful as a curried predicate.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig k -> {k: v} -> {k: v} -> Boolean\n * @param {String} prop The name of the property to compare\n * @param {Object} obj1\n * @param {Object} obj2\n * @return {Boolean}\n *\n * @example\n *\n * var o1 = { a: 1, b: 2, c: 3, d: 4 };\n * var o2 = { a: 10, b: 20, c: 3, d: 40 };\n * R.eqProps('a', o1, o2); //=> false\n * R.eqProps('c', o1, o2); //=> true\n */\n var eqProps = _curry3(function eqProps(prop, obj1, obj2) {\n return equals(obj1[prop], obj2[prop]);\n });\n\n /**\n * Splits a list into sub-lists stored in an object, based on the result of\n * calling a String-returning function on each element, and grouping the\n * results according to values returned.\n *\n * Dispatches to the `groupBy` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig (a -> String) -> [a] -> {String: [a]}\n * @param {Function} fn Function :: a -> String\n * @param {Array} list The array to group\n * @return {Object} An object with the output of `fn` for keys, mapped to arrays of elements\n * that produced that key when passed to `fn`.\n * @see R.transduce\n * @example\n *\n * var byGrade = R.groupBy(function(student) {\n * var score = student.score;\n * return score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A';\n * });\n * var students = [{name: 'Abby', score: 84},\n * {name: 'Eddy', score: 58},\n * // ...\n * {name: 'Jack', score: 69}];\n * byGrade(students);\n * // {\n * // 'A': [{name: 'Dianne', score: 99}],\n * // 'B': [{name: 'Abby', score: 84}]\n * // // ...,\n * // 'F': [{name: 'Eddy', score: 58}]\n * // }\n */\n var groupBy = _curry2(_dispatchable('groupBy', _xgroupBy, reduceBy(function (acc, item) {\n if (acc == null) {\n acc = [];\n }\n acc.push(item);\n return acc;\n }, null)));\n\n /**\n * Given a function that generates a key, turns a list of objects into an\n * object indexing the objects by the given key. Note that if multiple\n * objects generate the same value for the indexing key only the last value\n * will be included in the generated object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (a -> String) -> [{k: v}] -> {k: {k: v}}\n * @param {Function} fn Function :: a -> String\n * @param {Array} array The array of objects to index\n * @return {Object} An object indexing each array element by the given property.\n * @example\n *\n * var list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];\n * R.indexBy(R.prop('id'), list);\n * //=> {abc: {id: 'abc', title: 'B'}, xyz: {id: 'xyz', title: 'A'}}\n */\n var indexBy = reduceBy(function (acc, elem) {\n return elem;\n }, null);\n\n /**\n * Returns the position of the first occurrence of an item in an array, or -1\n * if the item is not included in the array. `R.equals` is used to determine\n * equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Number\n * @param {*} target The item to find.\n * @param {Array} xs The array to search in.\n * @return {Number} the index of the target, or -1 if the target is not found.\n * @see R.lastIndexOf\n * @example\n *\n * R.indexOf(3, [1,2,3,4]); //=> 2\n * R.indexOf(10, [1,2,3,4]); //=> -1\n */\n var indexOf = _curry2(function indexOf(target, xs) {\n return typeof xs.indexOf === 'function' && !_isArray(xs) ? xs.indexOf(target) : _indexOf(xs, target, 0);\n });\n\n /**\n * juxt applies a list of functions to a list of values.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Function\n * @sig [(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])\n * @param {Array} fns An array of functions\n * @return {Function} A function that returns a list of values after applying each of the original `fns` to its parameters.\n * @see R.applySpec\n * @example\n *\n * var range = R.juxt([Math.min, Math.max]);\n * range(3, 4, 9, -3); //=> [-3, 9]\n */\n var juxt = _curry1(function juxt(fns) {\n return converge(_arrayOf, fns);\n });\n\n /**\n * Returns a lens for the given getter and setter functions. The getter \"gets\"\n * the value of the focus; the setter \"sets\" the value of the focus. The setter\n * should not mutate the data structure.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig (s -> a) -> ((a, s) -> s) -> Lens s a\n * @param {Function} getter\n * @param {Function} setter\n * @return {Lens}\n * @see R.view, R.set, R.over, R.lensIndex, R.lensProp\n * @example\n *\n * var xLens = R.lens(R.prop('x'), R.assoc('x'));\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}\n */\n var lens = _curry2(function lens(getter, setter) {\n return function (toFunctorFn) {\n return function (target) {\n return map(function (focus) {\n return setter(focus, target);\n }, toFunctorFn(getter(target)));\n };\n };\n });\n\n /**\n * Returns a lens whose focus is the specified index.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig Number -> Lens s a\n * @param {Number} n\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var headLens = R.lensIndex(0);\n *\n * R.view(headLens, ['a', 'b', 'c']); //=> 'a'\n * R.set(headLens, 'x', ['a', 'b', 'c']); //=> ['x', 'b', 'c']\n * R.over(headLens, R.toUpper, ['a', 'b', 'c']); //=> ['A', 'b', 'c']\n */\n var lensIndex = _curry1(function lensIndex(n) {\n return lens(nth(n), update(n));\n });\n\n /**\n * Returns a lens whose focus is the specified path.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig [String] -> Lens s a\n * @param {Array} path The path to use.\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var xyLens = R.lensPath(['x', 'y']);\n *\n * R.view(xyLens, {x: {y: 2, z: 3}}); //=> 2\n * R.set(xyLens, 4, {x: {y: 2, z: 3}}); //=> {x: {y: 4, z: 3}}\n * R.over(xyLens, R.negate, {x: {y: 2, z: 3}}); //=> {x: {y: -2, z: 3}}\n */\n var lensPath = _curry1(function lensPath(p) {\n return lens(path(p), assocPath(p));\n });\n\n /**\n * Returns a lens whose focus is the specified property.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Object\n * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s\n * @sig String -> Lens s a\n * @param {String} k\n * @return {Lens}\n * @see R.view, R.set, R.over\n * @example\n *\n * var xLens = R.lensProp('x');\n *\n * R.view(xLens, {x: 1, y: 2}); //=> 1\n * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n * R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}\n */\n var lensProp = _curry1(function lensProp(k) {\n return lens(prop(k), assoc(k));\n });\n\n /**\n * \"lifts\" a function to be the specified arity, so that it may \"map over\" that\n * many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig Number -> (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.lift, R.ap\n * @example\n *\n * var madd3 = R.liftN(3, R.curryN(3, (...args) => R.sum(args)));\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n */\n var liftN = _curry2(function liftN(arity, fn) {\n var lifted = curryN(arity, fn);\n return curryN(arity, function () {\n return _reduce(ap, map(lifted, arguments[0]), _slice(arguments, 1));\n });\n });\n\n /**\n * Returns the mean of the given list of numbers.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list\n * @return {Number}\n * @example\n *\n * R.mean([2, 7, 9]); //=> 6\n * R.mean([]); //=> NaN\n */\n var mean = _curry1(function mean(list) {\n return sum(list) / list.length;\n });\n\n /**\n * Returns the median of the given list of numbers.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list\n * @return {Number}\n * @example\n *\n * R.median([2, 9, 7]); //=> 7\n * R.median([7, 2, 10, 9]); //=> 8\n * R.median([]); //=> NaN\n */\n var median = _curry1(function median(list) {\n var len = list.length;\n if (len === 0) {\n return NaN;\n }\n var width = 2 - len % 2;\n var idx = (len - width) / 2;\n return mean(_slice(list).sort(function (a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n }).slice(idx, idx + width));\n });\n\n /**\n * Takes a predicate and a list or other \"filterable\" object and returns the\n * pair of filterable objects of the same type of elements which do and do not\n * satisfy, the predicate, respectively.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> [f a, f a]\n * @param {Function} pred A predicate to determine which side the element belongs to.\n * @param {Array} filterable the list (or other filterable) to partition.\n * @return {Array} An array, containing first the subset of elements that satisfy the\n * predicate, and second the subset of elements that do not satisfy.\n * @see R.filter, R.reject\n * @example\n *\n * R.partition(R.contains('s'), ['sss', 'ttt', 'foo', 'bars']);\n * // => [ [ 'sss', 'bars' ], [ 'ttt', 'foo' ] ]\n *\n * R.partition(R.contains('s'), { a: 'sss', b: 'ttt', foo: 'bars' });\n * // => [ { a: 'sss', foo: 'bars' }, { b: 'ttt' } ]\n */\n var partition = juxt([\n filter,\n reject\n ]);\n\n /**\n * Performs left-to-right function composition. The leftmost function may have\n * any arity; the remaining functions must be unary.\n *\n * In some libraries this function is named `sequence`.\n *\n * **Note:** The result of pipe is not automatically curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.compose\n * @example\n *\n * var f = R.pipe(Math.pow, R.negate, R.inc);\n *\n * f(3, 4); // -(3^4) + 1\n */\n var pipe = function pipe() {\n if (arguments.length === 0) {\n throw new Error('pipe requires at least one argument');\n }\n return _arity(arguments[0].length, reduce(_pipe, arguments[0], tail(arguments)));\n };\n\n /**\n * Performs left-to-right composition of one or more Promise-returning\n * functions. The leftmost function may have any arity; the remaining functions\n * must be unary.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.composeP\n * @example\n *\n * // followersForUser :: String -> Promise [User]\n * var followersForUser = R.pipeP(db.getUserById, db.getFollowers);\n */\n var pipeP = function pipeP() {\n if (arguments.length === 0) {\n throw new Error('pipeP requires at least one argument');\n }\n return _arity(arguments[0].length, reduce(_pipeP, arguments[0], tail(arguments)));\n };\n\n /**\n * Multiplies together all the elements of a list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Math\n * @sig [Number] -> Number\n * @param {Array} list An array of numbers\n * @return {Number} The product of all the numbers in the list.\n * @see R.reduce\n * @example\n *\n * R.product([2,4,6,8,100,1]); //=> 38400\n */\n var product = reduce(multiply, 1);\n\n /**\n * Transforms a [Traversable](https://github.com/fantasyland/fantasy-land#traversable)\n * of [Applicative](https://github.com/fantasyland/fantasy-land#applicative) into an\n * Applicative of Traversable.\n *\n * Dispatches to the `sequence` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (Applicative f, Traversable t) => (a -> f a) -> t (f a) -> f (t a)\n * @param {Function} of\n * @param {*} traversable\n * @return {*}\n * @see R.traverse\n * @example\n *\n * R.sequence(Maybe.of, [Just(1), Just(2), Just(3)]); //=> Just([1, 2, 3])\n * R.sequence(Maybe.of, [Just(1), Just(2), Nothing()]); //=> Nothing()\n *\n * R.sequence(R.of, Just([1, 2, 3])); //=> [Just(1), Just(2), Just(3)]\n * R.sequence(R.of, Nothing()); //=> [Nothing()]\n */\n var sequence = _curry2(function sequence(of, traversable) {\n return typeof traversable.sequence === 'function' ? traversable.sequence(of) : reduceRight(function (acc, x) {\n return ap(map(prepend, x), acc);\n }, of([]), traversable);\n });\n\n /**\n * Maps an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning\n * function over a [Traversable](https://github.com/fantasyland/fantasy-land#traversable),\n * then uses [`sequence`](#sequence) to transform the resulting Traversable of Applicative\n * into an Applicative of Traversable.\n *\n * Dispatches to the `sequence` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (Applicative f, Traversable t) => (a -> f a) -> (a -> f b) -> t a -> f (t b)\n * @param {Function} of\n * @param {Function} f\n * @param {*} traversable\n * @return {*}\n * @see R.sequence\n * @example\n *\n * // Returns `Nothing` if the given divisor is `0`\n * safeDiv = n => d => d === 0 ? Nothing() : Just(n / d)\n *\n * R.traverse(Maybe.of, safeDiv(10), [2, 4, 5]); //=> Just([5, 2.5, 2])\n * R.traverse(Maybe.of, safeDiv(10), [2, 0, 5]); //=> Nothing\n */\n var traverse = _curry3(function traverse(of, f, traversable) {\n return sequence(of, map(f, traversable));\n });\n\n /**\n * Shorthand for `R.chain(R.identity)`, which removes one level of nesting from\n * any [Chain](https://github.com/fantasyland/fantasy-land#chain).\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category List\n * @sig Chain c => c (c a) -> c a\n * @param {*} list\n * @return {*}\n * @see R.flatten, R.chain\n * @example\n *\n * R.unnest([1, [2], [[3]]]); //=> [1, 2, [3]]\n * R.unnest([[1, 2], [3, 4], [5, 6]]); //=> [1, 2, 3, 4, 5, 6]\n */\n var unnest = chain(_identity);\n\n var _contains = function _contains(a, list) {\n return _indexOf(list, a, 0) >= 0;\n };\n\n // mapPairs :: (Object, [String]) -> [String]\n var _toString = function _toString(x, seen) {\n var recur = function recur(y) {\n var xs = seen.concat([x]);\n return _contains(y, xs) ? '' : _toString(y, xs);\n };\n // mapPairs :: (Object, [String]) -> [String]\n var mapPairs = function (obj, keys) {\n return _map(function (k) {\n return _quote(k) + ': ' + recur(obj[k]);\n }, keys.slice().sort());\n };\n switch (Object.prototype.toString.call(x)) {\n case '[object Arguments]':\n return '(function() { return arguments; }(' + _map(recur, x).join(', ') + '))';\n case '[object Array]':\n return '[' + _map(recur, x).concat(mapPairs(x, reject(function (k) {\n return /^\\d+$/.test(k);\n }, keys(x)))).join(', ') + ']';\n case '[object Boolean]':\n return typeof x === 'object' ? 'new Boolean(' + recur(x.valueOf()) + ')' : x.toString();\n case '[object Date]':\n return 'new Date(' + (isNaN(x.valueOf()) ? recur(NaN) : _quote(_toISOString(x))) + ')';\n case '[object Null]':\n return 'null';\n case '[object Number]':\n return typeof x === 'object' ? 'new Number(' + recur(x.valueOf()) + ')' : 1 / x === -Infinity ? '-0' : x.toString(10);\n case '[object String]':\n return typeof x === 'object' ? 'new String(' + recur(x.valueOf()) + ')' : _quote(x);\n case '[object Undefined]':\n return 'undefined';\n default:\n if (typeof x.toString === 'function') {\n var repr = x.toString();\n if (repr !== '[object Object]') {\n return repr;\n }\n }\n return '{' + mapPairs(x, keys(x)).join(', ') + '}';\n }\n };\n\n /**\n * Performs right-to-left function composition. The rightmost function may have\n * any arity; the remaining functions must be unary.\n *\n * **Note:** The result of compose is not automatically curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig ((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.pipe\n * @example\n *\n * var f = R.compose(R.inc, R.negate, Math.pow);\n *\n * f(3, 4); // -(3^4) + 1\n */\n var compose = function compose() {\n if (arguments.length === 0) {\n throw new Error('compose requires at least one argument');\n }\n return pipe.apply(this, reverse(arguments));\n };\n\n /**\n * Returns the right-to-left Kleisli composition of the provided functions,\n * each of which must return a value of a type supported by [`chain`](#chain).\n *\n * `R.composeK(h, g, f)` is equivalent to `R.compose(R.chain(h), R.chain(g), R.chain(f))`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Function\n * @sig Chain m => ((y -> m z), (x -> m y), ..., (a -> m b)) -> (m a -> m z)\n * @param {...Function}\n * @return {Function}\n * @see R.pipeK\n * @example\n *\n * // parseJson :: String -> Maybe *\n * // get :: String -> Object -> Maybe *\n *\n * // getStateCode :: Maybe String -> Maybe String\n * var getStateCode = R.composeK(\n * R.compose(Maybe.of, R.toUpper),\n * get('state'),\n * get('address'),\n * get('user'),\n * parseJson\n * );\n *\n * getStateCode(Maybe.of('{\"user\":{\"address\":{\"state\":\"ny\"}}}'));\n * //=> Just('NY')\n * getStateCode(Maybe.of('[Invalid JSON]'));\n * //=> Nothing()\n */\n var composeK = function composeK() {\n return compose.apply(this, prepend(identity, map(chain, arguments)));\n };\n\n /**\n * Performs right-to-left composition of one or more Promise-returning\n * functions. The rightmost function may have any arity; the remaining\n * functions must be unary.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Function\n * @sig ((y -> Promise z), (x -> Promise y), ..., (a -> Promise b)) -> (a -> Promise z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.pipeP\n * @example\n *\n * // followersForUser :: String -> Promise [User]\n * var followersForUser = R.composeP(db.getFollowers, db.getUserById);\n */\n var composeP = function composeP() {\n if (arguments.length === 0) {\n throw new Error('composeP requires at least one argument');\n }\n return pipeP.apply(this, reverse(arguments));\n };\n\n /**\n * Wraps a constructor function inside a curried function that can be called\n * with the same arguments and returns the same type.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> {*}) -> (* -> {*})\n * @param {Function} Fn The constructor function to wrap.\n * @return {Function} A wrapped, curried constructor function.\n * @example\n *\n * // Constructor function\n * var Widget = config => {\n * // ...\n * };\n * Widget.prototype = {\n * // ...\n * };\n * var allConfigs = [\n * // ...\n * ];\n * R.map(R.construct(Widget), allConfigs); // a list of Widgets\n */\n var construct = _curry1(function construct(Fn) {\n return constructN(Fn.length, Fn);\n });\n\n /**\n * Returns `true` if the specified value is equal, in `R.equals` terms, to at\n * least one element of the given list; `false` otherwise.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig a -> [a] -> Boolean\n * @param {Object} a The item to compare against.\n * @param {Array} list The array to consider.\n * @return {Boolean} `true` if the item is in the list, `false` otherwise.\n * @see R.any\n * @example\n *\n * R.contains(3, [1, 2, 3]); //=> true\n * R.contains(4, [1, 2, 3]); //=> false\n * R.contains([42], [[42]]); //=> true\n */\n var contains = _curry2(_contains);\n\n /**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.differenceWith\n * @example\n *\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n */\n var difference = _curry2(function difference(first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n while (idx < firstLen) {\n if (!_contains(first[idx], second) && !_contains(first[idx], out)) {\n out[out.length] = first[idx];\n }\n idx += 1;\n }\n return out;\n });\n\n /**\n * Returns a new list without any consecutively repeating elements. `R.equals`\n * is used to determine equality.\n *\n * Dispatches to the `dropRepeats` method of the first argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category List\n * @sig [a] -> [a]\n * @param {Array} list The array to consider.\n * @return {Array} `list` without repeating elements.\n * @see R.transduce\n * @example\n *\n * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=> [1, 2, 3, 4, 2]\n */\n var dropRepeats = _curry1(_dispatchable('dropRepeats', _xdropRepeatsWith(equals), dropRepeatsWith(equals)));\n\n /**\n * \"lifts\" a function of arity > 1 so that it may \"map over\" a list, Function or other\n * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.liftN\n * @example\n *\n * var madd3 = R.lift(R.curry((a, b, c) => a + b + c));\n *\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n *\n * var madd5 = R.lift(R.curry((a, b, c, d, e) => a + b + c + d + e));\n *\n * madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24]\n */\n var lift = _curry1(function lift(fn) {\n return liftN(fn.length, fn);\n });\n\n /**\n * Returns a partial copy of an object omitting the keys specified.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [String] -> {String: *} -> {String: *}\n * @param {Array} names an array of String property names to omit from the new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with properties from `names` not on it.\n * @see R.pick\n * @example\n *\n * R.omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}\n */\n var omit = _curry2(function omit(names, obj) {\n var result = {};\n for (var prop in obj) {\n if (!_contains(prop, names)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n });\n\n /**\n * Returns the left-to-right Kleisli composition of the provided functions,\n * each of which must return a value of a type supported by [`chain`](#chain).\n *\n * `R.pipeK(f, g, h)` is equivalent to `R.pipe(R.chain(f), R.chain(g), R.chain(h))`.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category Function\n * @sig Chain m => ((a -> m b), (b -> m c), ..., (y -> m z)) -> (m a -> m z)\n * @param {...Function}\n * @return {Function}\n * @see R.composeK\n * @example\n *\n * // parseJson :: String -> Maybe *\n * // get :: String -> Object -> Maybe *\n *\n * // getStateCode :: Maybe String -> Maybe String\n * var getStateCode = R.pipeK(\n * parseJson,\n * get('user'),\n * get('address'),\n * get('state'),\n * R.compose(Maybe.of, R.toUpper)\n * );\n *\n * getStateCode(Maybe.of('{\"user\":{\"address\":{\"state\":\"ny\"}}}'));\n * //=> Just('NY')\n * getStateCode(Maybe.of('[Invalid JSON]'));\n * //=> Nothing()\n */\n var pipeK = function pipeK() {\n return composeK.apply(this, reverse(arguments));\n };\n\n /**\n * Returns the string representation of the given value. `eval`'ing the output\n * should result in a value equivalent to the input value. Many of the built-in\n * `toString` methods do not satisfy this requirement.\n *\n * If the given value is an `[object Object]` with a `toString` method other\n * than `Object.prototype.toString`, this method is invoked with no arguments\n * to produce the return value. This means user-defined constructor functions\n * can provide a suitable `toString` method. For example:\n *\n * function Point(x, y) {\n * this.x = x;\n * this.y = y;\n * }\n *\n * Point.prototype.toString = function() {\n * return 'new Point(' + this.x + ', ' + this.y + ')';\n * };\n *\n * R.toString(new Point(1, 2)); //=> 'new Point(1, 2)'\n *\n * @func\n * @memberOf R\n * @since v0.14.0\n * @category String\n * @sig * -> String\n * @param {*} val\n * @return {String}\n * @example\n *\n * R.toString(42); //=> '42'\n * R.toString('abc'); //=> '\"abc\"'\n * R.toString([1, 2, 3]); //=> '[1, 2, 3]'\n * R.toString({foo: 1, bar: 2, baz: 3}); //=> '{\"bar\": 2, \"baz\": 3, \"foo\": 1}'\n * R.toString(new Date('2001-02-03T04:05:06Z')); //=> 'new Date(\"2001-02-03T04:05:06.000Z\")'\n */\n var toString = _curry1(function toString(val) {\n return _toString(val, []);\n });\n\n /**\n * Returns a new list without values in the first argument.\n * `R.equals` is used to determine equality.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig [a] -> [a] -> [a]\n * @param {Array} list1 The values to be removed from `list2`.\n * @param {Array} list2 The array to remove values from.\n * @return {Array} The new array without values in `list1`.\n * @see R.transduce\n * @example\n *\n * R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]\n */\n var without = _curry2(function (xs, list) {\n return reject(flip(_contains)(xs), list);\n });\n\n // A simple Set type that honours R.equals semantics\n /* globals Set */\n /**\n * Combines the logic for checking whether an item is a member of the set and\n * for adding a new item to the set.\n *\n * @param item The item to check or add to the Set instance.\n * @param shouldAdd If true, the item will be added to the set if it doesn't\n * already exist.\n * @param set The set instance to check or add to.\n * @return {boolean} When shouldAdd is true, this will return true when a new\n * item was added otherwise false. When shouldAdd is false,\n * this will return true if the item already exists, otherwise\n * false.\n */\n // distinguish between +0 and -0\n // these types can all utilise Set\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n // compare functions for reference equality\n /* falls through */\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n // scan through all previously applied items\n var _Set = function () {\n function _Set() {\n /* globals Set */\n this._nativeSet = typeof Set === 'function' ? new Set() : null;\n this._items = {};\n }\n _Set.prototype.add = function (item) {\n return hasOrAdd(item, true, this);\n };\n _Set.prototype.has = function (item) {\n return hasOrAdd(item, false, this);\n };\n /**\n * Combines the logic for checking whether an item is a member of the set and\n * for adding a new item to the set.\n *\n * @param item The item to check or add to the Set instance.\n * @param shouldAdd If true, the item will be added to the set if it doesn't\n * already exist.\n * @param set The set instance to check or add to.\n * @return {boolean} When shouldAdd is true, this will return true when a new\n * item was added otherwise false. When shouldAdd is false,\n * this will return true if the item already exists, otherwise\n * false.\n */\n function hasOrAdd(item, shouldAdd, set) {\n var type = typeof item;\n var prevSize, newSize;\n switch (type) {\n case 'string':\n case 'number':\n // distinguish between +0 and -0\n if (item === 0 && !set._items['-0'] && 1 / item === -Infinity) {\n if (shouldAdd) {\n set._items['-0'] = true;\n }\n return shouldAdd;\n }\n // these types can all utilise Set\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize > prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = {};\n set._items[type][item] = true;\n }\n return shouldAdd;\n } else if (item in set._items[type]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type][item] = true;\n }\n return shouldAdd;\n }\n }\n case 'boolean':\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n if (type in set._items) {\n var bIdx = item ? 1 : 0;\n if (set._items[type][bIdx]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type][bIdx] = true;\n }\n return shouldAdd;\n }\n } else {\n if (shouldAdd) {\n set._items[type] = item ? [\n false,\n true\n ] : [\n true,\n false\n ];\n }\n return shouldAdd;\n }\n case 'function':\n // compare functions for reference equality\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize > prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return shouldAdd;\n }\n if (!_contains(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return shouldAdd;\n }\n }\n return !shouldAdd;\n case 'undefined':\n if (set._items[type]) {\n return !shouldAdd;\n } else {\n if (shouldAdd) {\n set._items[type] = true;\n }\n return shouldAdd;\n }\n case 'object':\n if (item === null) {\n if (!set._items['null']) {\n if (shouldAdd) {\n set._items['null'] = true;\n }\n return shouldAdd;\n }\n return !shouldAdd;\n }\n /* falls through */\n default:\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n type = Object.prototype.toString.call(item);\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return shouldAdd;\n }\n // scan through all previously applied items\n if (!_contains(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return shouldAdd;\n }\n return !shouldAdd;\n }\n }\n return _Set;\n }();\n\n /**\n * A function wrapping calls to the two functions in an `&&` operation,\n * returning the result of the first function if it is false-y and the result\n * of the second function otherwise. Note that this is short-circuited,\n * meaning that the second function will not be invoked if the first returns a\n * false-y value.\n *\n * In addition to functions, `R.both` also accepts any fantasy-land compatible\n * applicative functor.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)\n * @param {Function} f a predicate\n * @param {Function} g another predicate\n * @return {Function} a function that applies its arguments to `f` and `g` and `&&`s their outputs together.\n * @see R.and\n * @example\n *\n * var gt10 = x => x > 10;\n * var even = x => x % 2 === 0;\n * var f = R.both(gt10, even);\n * f(100); //=> true\n * f(101); //=> false\n */\n var both = _curry2(function both(f, g) {\n return _isFunction(f) ? function _both() {\n return f.apply(this, arguments) && g.apply(this, arguments);\n } : lift(and)(f, g);\n });\n\n /**\n * Takes a function `f` and returns a function `g` such that:\n *\n * - applying `g` to zero or more arguments will give __true__ if applying\n * the same arguments to `f` gives a logical __false__ value; and\n *\n * - applying `g` to zero or more arguments will give __false__ if applying\n * the same arguments to `f` gives a logical __true__ value.\n *\n * `R.complement` will work on all other functors as well.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> *) -> (*... -> Boolean)\n * @param {Function} f\n * @return {Function}\n * @see R.not\n * @example\n *\n * var isEven = n => n % 2 === 0;\n * var isOdd = R.complement(isEven);\n * isOdd(21); //=> true\n * isOdd(42); //=> false\n */\n var complement = lift(not);\n\n /**\n * A function wrapping calls to the two functions in an `||` operation,\n * returning the result of the first function if it is truth-y and the result\n * of the second function otherwise. Note that this is short-circuited,\n * meaning that the second function will not be invoked if the first returns a\n * truth-y value.\n *\n * In addition to functions, `R.either` also accepts any fantasy-land compatible\n * applicative functor.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)\n * @param {Function} f a predicate\n * @param {Function} g another predicate\n * @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.\n * @see R.or\n * @example\n *\n * var gt10 = x => x > 10;\n * var even = x => x % 2 === 0;\n * var f = R.either(gt10, even);\n * f(101); //=> true\n * f(8); //=> true\n */\n var either = _curry2(function either(f, g) {\n return _isFunction(f) ? function _either() {\n return f.apply(this, arguments) || g.apply(this, arguments);\n } : lift(or)(f, g);\n });\n\n /**\n * Turns a named method with a specified arity into a function that can be\n * called directly supplied with arguments and a target object.\n *\n * The returned function is curried and accepts `arity + 1` parameters where\n * the final parameter is the target object.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig Number -> String -> (a -> b -> ... -> n -> Object -> *)\n * @param {Number} arity Number of arguments the returned function should take\n * before the target object.\n * @param {String} method Name of the method to call.\n * @return {Function} A new curried function.\n * @example\n *\n * var sliceFrom = R.invoker(1, 'slice');\n * sliceFrom(6, 'abcdefghijklm'); //=> 'ghijklm'\n * var sliceFrom6 = R.invoker(2, 'slice')(6);\n * sliceFrom6(8, 'abcdefghijklm'); //=> 'gh'\n */\n var invoker = _curry2(function invoker(arity, method) {\n return curryN(arity + 1, function () {\n var target = arguments[arity];\n if (target != null && is(Function, target[method])) {\n return target[method].apply(target, _slice(arguments, 0, arity));\n }\n throw new TypeError(toString(target) + ' does not have a method named \"' + method + '\"');\n });\n });\n\n /**\n * Returns a string made by inserting the `separator` between each element and\n * concatenating all the elements into a single string.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig String -> [a] -> String\n * @param {Number|String} separator The string used to separate the elements.\n * @param {Array} xs The elements to join into a string.\n * @return {String} str The string made by concatenating `xs` with `separator`.\n * @see R.split\n * @example\n *\n * var spacer = R.join(' ');\n * spacer(['a', 2, 3.4]); //=> 'a 2 3.4'\n * R.join('|', [1, 2, 3]); //=> '1|2|3'\n */\n var join = invoker(1, 'join');\n\n /**\n * Creates a new function that, when invoked, caches the result of calling `fn`\n * for a given argument set and returns the result. Subsequent calls to the\n * memoized `fn` with the same argument set will not result in an additional\n * call to `fn`; instead, the cached result for that set of arguments will be\n * returned.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (*... -> a) -> (*... -> a)\n * @param {Function} fn The function to memoize.\n * @return {Function} Memoized version of `fn`.\n * @example\n *\n * var count = 0;\n * var factorial = R.memoize(n => {\n * count += 1;\n * return R.product(R.range(1, n + 1));\n * });\n * factorial(5); //=> 120\n * factorial(5); //=> 120\n * factorial(5); //=> 120\n * count; //=> 1\n */\n var memoize = _curry1(function memoize(fn) {\n var cache = {};\n return _arity(fn.length, function () {\n var key = toString(arguments);\n if (!_has(key, cache)) {\n cache[key] = fn.apply(this, arguments);\n }\n return cache[key];\n });\n });\n\n /**\n * Splits a string into an array of strings based on the given\n * separator.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category String\n * @sig (String | RegExp) -> String -> [String]\n * @param {String|RegExp} sep The pattern.\n * @param {String} str The string to separate into an array.\n * @return {Array} The array of strings from `str` separated by `str`.\n * @see R.join\n * @example\n *\n * var pathComponents = R.split('/');\n * R.tail(pathComponents('/usr/local/bin/node')); //=> ['usr', 'local', 'bin', 'node']\n *\n * R.split('.', 'a.b.c.xyz.d'); //=> ['a', 'b', 'c', 'xyz', 'd']\n */\n var split = invoker(1, 'split');\n\n /**\n * Determines whether a given string matches a given regular expression.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category String\n * @sig RegExp -> String -> Boolean\n * @param {RegExp} pattern\n * @param {String} str\n * @return {Boolean}\n * @see R.match\n * @example\n *\n * R.test(/^x/, 'xyz'); //=> true\n * R.test(/^y/, 'xyz'); //=> false\n */\n var test = _curry2(function test(pattern, str) {\n if (!_isRegExp(pattern)) {\n throw new TypeError('\\u2018test\\u2019 requires a value of type RegExp as its first argument; received ' + toString(pattern));\n }\n return _cloneRegExp(pattern).test(str);\n });\n\n /**\n * The lower case version of a string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to lower case.\n * @return {String} The lower case version of `str`.\n * @see R.toUpper\n * @example\n *\n * R.toLower('XYZ'); //=> 'xyz'\n */\n var toLower = invoker(0, 'toLowerCase');\n\n /**\n * The upper case version of a string.\n *\n * @func\n * @memberOf R\n * @since v0.9.0\n * @category String\n * @sig String -> String\n * @param {String} str The string to upper case.\n * @return {String} The upper case version of `str`.\n * @see R.toLower\n * @example\n *\n * R.toUpper('abc'); //=> 'ABC'\n */\n var toUpper = invoker(0, 'toUpperCase');\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list, based upon the value returned by applying the supplied function to\n * each list element. Prefers the first item if the supplied function produces\n * the same value on two items. `R.equals` is used for comparison.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> b) -> [a] -> [a]\n * @param {Function} fn A function used to produce a value to use during comparisons.\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=> [-1, -5, 2, 10]\n */\n var uniqBy = _curry2(function uniqBy(fn, list) {\n var set = new _Set();\n var result = [];\n var idx = 0;\n var appliedItem, item;\n while (idx < list.length) {\n item = list[idx];\n appliedItem = fn(item);\n if (set.add(appliedItem)) {\n result.push(item);\n }\n idx += 1;\n }\n return result;\n });\n\n /**\n * Returns the result of concatenating the given lists or strings.\n *\n * Dispatches to the `concat` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a] -> [a]\n * @sig String -> String -> String\n * @param {Array|String} a\n * @param {Array|String} b\n * @return {Array|String}\n *\n * @example\n *\n * R.concat([], []); //=> []\n * R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]\n * R.concat('ABC', 'DEF'); // 'ABCDEF'\n */\n var concat = flip(invoker(1, 'concat'));\n\n /**\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\n * second list, but not both.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` or `list2`, but not both.\n * @see R.symmetricDifferenceWith\n * @example\n *\n * R.symmetricDifference([1,2,3,4], [7,6,5,4,3]); //=> [1,2,7,6,5]\n * R.symmetricDifference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5,1,2]\n */\n var symmetricDifference = _curry2(function symmetricDifference(list1, list2) {\n return concat(difference(list1, list2), difference(list2, list1));\n });\n\n /**\n * Finds the set (i.e. no duplicates) of all elements contained in the first or\n * second list, but not both. Duplication is determined according to the value\n * returned by applying the supplied predicate to two list elements.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Relation\n * @sig (a -> a -> Boolean) -> [a] -> [a] -> [a]\n * @param {Function} pred A predicate used to test whether two items are equal.\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` or `list2`, but not both.\n * @see R.symmetricDifference\n * @example\n *\n * var eqA = R.eqBy(R.prop('a'));\n * var l1 = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];\n * var l2 = [{a: 3}, {a: 4}, {a: 5}, {a: 6}];\n * R.symmetricDifferenceWith(eqA, l1, l2); //=> [{a: 1}, {a: 2}, {a: 5}, {a: 6}]\n */\n var symmetricDifferenceWith = _curry3(function symmetricDifferenceWith(pred, list1, list2) {\n return concat(differenceWith(pred, list1, list2), differenceWith(pred, list2, list1));\n });\n\n /**\n * Returns a new list containing only one copy of each element in the original\n * list. `R.equals` is used to determine equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniq([1, 1, 2, 1]); //=> [1, 2]\n * R.uniq([1, '1']); //=> [1, '1']\n * R.uniq([[42], [42]]); //=> [[42]]\n */\n var uniq = uniqBy(identity);\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of those\n * elements common to both lists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The list of elements found in both `list1` and `list2`.\n * @see R.intersectionWith\n * @example\n *\n * R.intersection([1,2,3,4], [7,6,5,4,3]); //=> [4, 3]\n */\n var intersection = _curry2(function intersection(list1, list2) {\n var lookupList, filteredList;\n if (list1.length > list2.length) {\n lookupList = list1;\n filteredList = list2;\n } else {\n lookupList = list2;\n filteredList = list1;\n }\n return uniq(_filter(flip(_contains)(lookupList), filteredList));\n });\n\n /**\n * Combines two lists into a set (i.e. no duplicates) composed of the elements\n * of each list.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} as The first list.\n * @param {Array} bs The second list.\n * @return {Array} The first and second lists concatenated, with\n * duplicates removed.\n * @example\n *\n * R.union([1, 2, 3], [2, 3, 4]); //=> [1, 2, 3, 4]\n */\n var union = _curry2(compose(uniq, _concat));\n\n var R = {\n F: F,\n T: T,\n __: __,\n add: add,\n addIndex: addIndex,\n adjust: adjust,\n all: all,\n allPass: allPass,\n allUniq: allUniq,\n always: always,\n and: and,\n any: any,\n anyPass: anyPass,\n ap: ap,\n aperture: aperture,\n append: append,\n apply: apply,\n applySpec: applySpec,\n assoc: assoc,\n assocPath: assocPath,\n binary: binary,\n bind: bind,\n both: both,\n call: call,\n chain: chain,\n clamp: clamp,\n clone: clone,\n comparator: comparator,\n complement: complement,\n compose: compose,\n composeK: composeK,\n composeP: composeP,\n concat: concat,\n cond: cond,\n construct: construct,\n constructN: constructN,\n contains: contains,\n converge: converge,\n countBy: countBy,\n curry: curry,\n curryN: curryN,\n dec: dec,\n defaultTo: defaultTo,\n difference: difference,\n differenceWith: differenceWith,\n dissoc: dissoc,\n dissocPath: dissocPath,\n divide: divide,\n drop: drop,\n dropLast: dropLast,\n dropLastWhile: dropLastWhile,\n dropRepeats: dropRepeats,\n dropRepeatsWith: dropRepeatsWith,\n dropWhile: dropWhile,\n either: either,\n empty: empty,\n eqBy: eqBy,\n eqProps: eqProps,\n equals: equals,\n evolve: evolve,\n filter: filter,\n find: find,\n findIndex: findIndex,\n findLast: findLast,\n findLastIndex: findLastIndex,\n flatten: flatten,\n flip: flip,\n forEach: forEach,\n fromPairs: fromPairs,\n groupBy: groupBy,\n groupWith: groupWith,\n gt: gt,\n gte: gte,\n has: has,\n hasIn: hasIn,\n head: head,\n identical: identical,\n identity: identity,\n ifElse: ifElse,\n inc: inc,\n indexBy: indexBy,\n indexOf: indexOf,\n init: init,\n insert: insert,\n insertAll: insertAll,\n intersection: intersection,\n intersectionWith: intersectionWith,\n intersperse: intersperse,\n into: into,\n invert: invert,\n invertObj: invertObj,\n invoker: invoker,\n is: is,\n isArrayLike: isArrayLike,\n isEmpty: isEmpty,\n isNil: isNil,\n join: join,\n juxt: juxt,\n keys: keys,\n keysIn: keysIn,\n last: last,\n lastIndexOf: lastIndexOf,\n length: length,\n lens: lens,\n lensIndex: lensIndex,\n lensPath: lensPath,\n lensProp: lensProp,\n lift: lift,\n liftN: liftN,\n lt: lt,\n lte: lte,\n map: map,\n mapAccum: mapAccum,\n mapAccumRight: mapAccumRight,\n mapObjIndexed: mapObjIndexed,\n match: match,\n mathMod: mathMod,\n max: max,\n maxBy: maxBy,\n mean: mean,\n median: median,\n memoize: memoize,\n merge: merge,\n mergeAll: mergeAll,\n mergeWith: mergeWith,\n mergeWithKey: mergeWithKey,\n min: min,\n minBy: minBy,\n modulo: modulo,\n multiply: multiply,\n nAry: nAry,\n negate: negate,\n none: none,\n not: not,\n nth: nth,\n nthArg: nthArg,\n objOf: objOf,\n of: of,\n omit: omit,\n once: once,\n or: or,\n over: over,\n pair: pair,\n partial: partial,\n partialRight: partialRight,\n partition: partition,\n path: path,\n pathEq: pathEq,\n pathOr: pathOr,\n pathSatisfies: pathSatisfies,\n pick: pick,\n pickAll: pickAll,\n pickBy: pickBy,\n pipe: pipe,\n pipeK: pipeK,\n pipeP: pipeP,\n pluck: pluck,\n prepend: prepend,\n product: product,\n project: project,\n prop: prop,\n propEq: propEq,\n propIs: propIs,\n propOr: propOr,\n propSatisfies: propSatisfies,\n props: props,\n range: range,\n reduce: reduce,\n reduceBy: reduceBy,\n reduceRight: reduceRight,\n reduced: reduced,\n reject: reject,\n remove: remove,\n repeat: repeat,\n replace: replace,\n reverse: reverse,\n scan: scan,\n sequence: sequence,\n set: set,\n slice: slice,\n sort: sort,\n sortBy: sortBy,\n split: split,\n splitAt: splitAt,\n splitEvery: splitEvery,\n splitWhen: splitWhen,\n subtract: subtract,\n sum: sum,\n symmetricDifference: symmetricDifference,\n symmetricDifferenceWith: symmetricDifferenceWith,\n tail: tail,\n take: take,\n takeLast: takeLast,\n takeLastWhile: takeLastWhile,\n takeWhile: takeWhile,\n tap: tap,\n test: test,\n times: times,\n toLower: toLower,\n toPairs: toPairs,\n toPairsIn: toPairsIn,\n toString: toString,\n toUpper: toUpper,\n transduce: transduce,\n transpose: transpose,\n traverse: traverse,\n trim: trim,\n tryCatch: tryCatch,\n type: type,\n unapply: unapply,\n unary: unary,\n uncurryN: uncurryN,\n unfold: unfold,\n union: union,\n unionWith: unionWith,\n uniq: uniq,\n uniqBy: uniqBy,\n uniqWith: uniqWith,\n unless: unless,\n unnest: unnest,\n until: until,\n update: update,\n useWith: useWith,\n values: values,\n valuesIn: valuesIn,\n view: view,\n when: when,\n where: where,\n whereEq: whereEq,\n without: without,\n wrap: wrap,\n xprod: xprod,\n zip: zip,\n zipObj: zipObj,\n zipWith: zipWith\n };\n /* eslint-env amd */\n\n /* TEST_ENTRY_POINT */\n\n if (typeof exports === 'object') {\n module.exports = R;\n } else if (typeof define === 'function' && define.amd) {\n define(function() { return R; });\n } else {\n this.R = R;\n }\n\n}.call(this));\n","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === \"object\" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n"],"sourceRoot":"/source/"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy