scripts.js.map 1.3 MB

1
  1. {"version":3,"sources":["node_modules/jquery/dist/jquery.min.js","node_modules/popper.js/dist/umd/popper.min.js","node_modules/openseadragon/build/openseadragon/openseadragon.js","node_modules/bootstrap/dist/js/bootstrap.js","node_modules/prismjs/prism.js"],"names":[],"mappings":"AAAA;AACA,eAAe,aAAa,uGAAuG,2EAA2E,YAAY,MAAM,sDAAsD,aAAa,gEAAgE,sBAAsB,aAAa,4BAA4B,0BAA0B,mEAAmE,eAAe,wDAAwD,eAAe,6BAA6B,iBAAiB,qCAAqC,kBAAkB,2CAA2C,0FAA0F,gDAAgD,cAAc,6FAA6F,8BAA8B,2BAA2B,cAAc,yCAAyC,4EAA4E,kBAAkB,mDAAmD,oBAAoB,iBAAiB,4DAA4D,uBAAuB,oCAAoC,2BAA2B,kBAAkB,sBAAsB,iBAAiB,+CAA+C,qBAAqB,GAAG,kBAAkB,+CAA+C,kBAAkB,kBAAkB,iBAAiB,mBAAmB,iBAAiB,gDAAgD,cAAc,GAAG,gBAAgB,gDAAgD,WAAW,GAAG,gBAAgB,iCAAiC,8CAA8C,gBAAgB,2CAA2C,oCAAoC,iCAAiC,kCAAkC,6BAA6B,gDAAgD,qCAAqC,sBAAsB,IAAI,sLAAsL,kDAAkD,SAAS,WAAW,kFAAkF,mBAAmB,kBAAkB,2BAA2B,QAAQ,qIAAqI,2BAA2B,MAAM,oBAAoB,SAAS,4BAA4B,KAAK,iBAAiB,IAAI,oBAAoB,UAAU,SAAS,eAAe,IAAI,sCAAsC,kDAAkD,SAAS,yBAAyB,YAAY,iFAAiF,yBAAyB,gCAAgC,qBAAqB,mCAAmC,IAAI,gBAAgB,oBAAoB,sBAAsB,iCAAiC,IAAI,iCAAiC,SAAS,qBAAqB,iBAAiB,uBAAuB,IAAI,qCAAqC,iDAAiD,YAAY,kBAAkB,+KAA+K,oCAAoC,EAAE,kBAAkB,iIAAiI,uBAAuB,KAAK,yEAAyE,uBAAuB,IAAI,yBAAyB,SAAS,8KAA8K,IAAI,wfAAwf,ucAAuc,sEAAsE,IAAI,8FAA8F,IAAI,iDAAiD,4BAA4B,2FAA2F,2EAA2E,+FAA+F,eAAe,IAAI,mBAAmB,6DAA6D,EAAE,+BAA+B,EAAE,IAAI,6EAA6E,SAAS,GAAG,6BAA6B,qBAAqB,eAAe,mBAAmB,qBAAqB,eAAe,qBAAqB,wDAAwD,iEAAiE,wBAAwB,oCAAoC,UAAU,qCAAqC,+BAA+B,wEAAwE,KAAK,sDAAsD,gHAAgH,qFAAqF,0CAA0C,2IAA2I,+CAA+C,cAAc,IAAI,0CAA0C,SAAS,QAAQ,QAAQ,iCAAiC,kCAAkC,cAAc,SAAS,uBAAuB,oEAAoE,eAAe,iBAAiB,eAAe,kCAAkC,IAAI,aAAa,SAAS,SAAS,QAAQ,kDAAkD,iBAAiB,8BAA8B,+BAA+B,iBAAiB,4EAA4E,cAAc,6CAA6C,cAAc,eAAe,mBAAmB,sDAAsD,eAAe,mBAAmB,+BAA+B,+CAA+C,eAAe,mBAAmB,sNAAsN,eAAe,sBAAsB,6BAA6B,oCAAoC,yCAAyC,EAAE,EAAE,eAAe,wDAAwD,wBAAwB,wBAAwB,4DAA4D,wCAAwC,8BAA8B,iCAAiC,gPAAgP,sJAAsJ,8BAA8B,oDAAoD,wCAAwC,8EAA8E,qFAAqF,kFAAkF,qCAAqC,uBAAuB,mBAAmB,iCAAiC,yBAAyB,4CAA4C,0BAA0B,iBAAiB,2BAA2B,uBAAuB,mBAAmB,uEAAuE,uBAAuB,yBAAyB,4CAA4C,gCAAgC,MAAM,uDAAuD,6BAA6B,sEAAsE,UAAU,kDAAkD,8GAA8G,eAAe,2CAA2C,YAAY,yCAAyC,SAAS,SAAS,sDAAsD,sFAAsF,+DAA+D,MAAM,6pBAA6pB,iBAAiB,gGAAgG,+BAA+B,4WAA4W,mJAAmJ,uEAAuE,oJAAoJ,2DAA2D,4HAA4H,eAAe,4CAA4C,SAAS,mBAAmB,uBAAuB,4DAA4D,iPAAiP,eAAe,uBAAuB,oDAAoD,2DAA2D,wBAAwB,IAAI,kCAAkC,IAAI,kCAAkC,sBAAsB,8CAA8C,IAAI,0BAA0B,yBAAyB,kCAAkC,gFAAgF,kBAAkB,yEAAyE,SAAS,QAAQ,iCAAiC,2BAA2B,2CAA2C,uBAAuB,8BAA8B,+FAA+F,2GAA2G,uBAAuB,4BAA4B,sBAAsB,6DAA6D,2BAA2B,mBAAmB,kEAAkE,uCAAuC,2BAA2B,gBAAgB,0BAA0B,4BAA4B,MAAM,yBAAyB,uDAAuD,mBAAmB,EAAE,wBAAwB,wCAAwC,4BAA4B,SAAS,kBAAkB,oDAAoD,QAAQ,WAAW,KAAK,0BAA0B,MAAM,iBAAiB,MAAM,+BAA+B,MAAM,uBAAuB,YAAY,iBAAiB,yHAAyH,mBAAmB,iMAAiM,oBAAoB,oBAAoB,oLAAoL,SAAS,gBAAgB,qCAAqC,yBAAyB,SAAS,aAAa,iDAAiD,mBAAmB,eAAe,qEAAqE,0HAA0H,EAAE,sBAAsB,mBAAmB,mBAAmB,iQAAiQ,2BAA2B,kEAAkE,gCAAgC,qBAAqB,iBAAiB,mHAAmH,MAAM,MAAM,SAAS,IAAI,uEAAuE,kCAAkC,SAAS,wCAAwC,gCAAgC,iCAAiC,oDAAoD,sEAAsE,aAAa,OAAO,2CAA2C,iCAAiC,yJAAyJ,iCAAiC,0BAA0B,mCAAmC,sBAAsB,wFAAwF,wGAAwG,0BAA0B,sCAAsC,cAAc,gBAAgB,KAAK,UAAU,mBAAmB,qCAAqC,iCAAiC,kCAAkC,qCAAqC,kBAAkB,gDAAgD,qBAAqB,mBAAmB,yBAAyB,0BAA0B,sCAAsC,2CAA2C,sBAAsB,oGAAoG,MAAM,GAAG,qHAAqH,wCAAwC,UAAU,qBAAqB,kCAAkC,4BAA4B,kBAAkB,aAAa,mBAAmB,yFAAyF,oDAAoD,+BAA+B,2DAA2D,sBAAsB,gEAAgE,mBAAmB,mBAAmB,EAAE,yCAAyC,SAAS,oBAAoB,0BAA0B,oBAAoB,0BAA0B,mBAAmB,0BAA0B,oBAAoB,+BAA+B,mDAAmD,kBAAkB,MAAM,wHAAwH,qBAAqB,UAAU,wBAAwB,YAAY,wBAAwB,kBAAkB,wBAAwB,YAAY,IAAI,eAAe,SAAS,uBAAuB,YAAY,IAAI,eAAe,SAAS,wBAAwB,0BAA0B,OAAO,WAAW,SAAS,wBAAwB,oBAAoB,MAAM,WAAW,SAAS,GAAG,4BAA4B,kDAAkD,oBAAoB,SAAS,mBAAmB,oBAAoB,eAAe,eAAe,4BAA4B,IAAI,kBAAkB,SAAS,mBAAmB,wDAAwD,+BAA+B,kDAAkD,SAAS,iBAAiB,kBAAkB,MAAM,uDAAuD,6DAA6D,iCAAiC,4CAA4C,KAAK,iDAAiD,iCAAiC,UAAU,eAAe,kCAAkC,eAAe,mCAAmC,SAAS,MAAM,uBAAuB,wCAAwC,IAAI,uDAAuD,SAAS,yBAAyB,sEAAsE,oDAAoD,uBAAuB,IAAI,iBAAiB,SAAS,kFAAkF,oBAAoB,iCAAiC,2CAA2C,MAAM,SAAS,MAAM,gBAAgB,mCAAmC,iBAAiB,WAAW,4DAA4D,qEAAqE,EAAE,eAAe,+FAA+F,aAAa,wBAAwB,gBAAgB,0BAA0B,yDAAyD,gBAAgB,EAAE,IAAI,+CAA+C,KAAK,wDAAwD,UAAU,IAAI,mCAAmC,oDAAoD,+BAA+B,6EAA6E,UAAU,aAAa,wFAAwF,6BAA6B,2BAA2B,uBAAuB,SAAS,mHAAmH,iCAAiC,4FAA4F,yBAAyB,uBAAuB,YAAY,gDAAgD,4BAA4B,qCAAqC,OAAO,uBAAuB,8CAA8C,gEAAgE,2GAA2G,sBAAsB,sBAAsB,KAAK,SAAS,uCAAuC,+BAA+B,UAAU,MAAM,SAAS,iCAAiC,kBAAkB,IAAI,0BAA0B,MAAM,8CAA8C,QAAQ,+DAA+D,sBAAsB,yBAAyB,SAAS,+BAA+B,iEAAiE,yBAAyB,oGAAoG,mEAAmE,sDAAsD,oCAAoC,WAAW,qCAAqC,8FAA8F,4DAA4D,QAAQ,kEAAkE,wGAAwG,gEAAgE,iBAAiB,8EAA8E,+CAA+C,4DAA4D,+BAA+B,4GAA4G,8BAA8B,gEAAgE,iBAAiB,wCAAwC,wBAAwB,MAAM,0FAA0F,KAAK,IAAI,8KAA8K,sBAAsB,sBAAsB,kDAAkD,uBAAuB,UAAU,SAAS,iBAAiB,aAAa,EAAE,iDAAiD,SAAS,6BAA6B,gBAAgB,8DAA8D,wEAAwE,kBAAkB,mCAAmC,0BAA0B,kCAAkC,iBAAiB,0CAA0C,yBAAyB,kBAAkB,yBAAyB,WAAW,kIAAkI,sBAAsB,GAAG,cAAc,iBAAiB,6BAA6B,mEAAmE,QAAQ,IAAI,sCAAsC,GAAG,6BAA6B,IAAI,qBAAqB,6BAA6B,oBAAoB,wCAAwC,iBAAiB,wCAAwC,gBAAgB,oEAAoE,EAAE,8CAA8C,2BAA2B,QAAQ,kBAAkB,8BAA8B,qJAAqJ,SAAS,wLAAwL,YAAY,iEAAiE,2GAA2G,wBAAwB,0CAA0C,yCAAyC,gBAAgB,gCAAgC,SAAS,aAAa,gBAAgB,2BAA2B,8BAA8B,YAAY,IAAI,sCAAsC,EAAE,uBAAuB,wDAAwD,mBAAmB,IAAI,kBAAkB,SAAS,gGAAgG,UAAU,MAAM,oDAAoD,mBAAmB,2IAA2I,mBAAmB,gEAAgE,qBAAqB,oEAAoE,UAAU,mBAAmB,mBAAmB,iCAAiC,qBAAqB,yBAAyB,8BAA8B,2BAA2B,kBAAkB,0BAA0B,kBAAkB,8BAA8B,qBAAqB,0BAA0B,qBAAqB,8BAA8B,2BAA2B,4BAA4B,2BAA2B,gCAAgC,sBAAsB,0BAA0B,gBAAgB,sBAAsB,uBAAuB,sBAAsB,qIAAqI,eAAe,sBAAsB,sBAAsB,6JAA6J,EAAE,0BAA0B,cAAc,SAAS,cAAc,QAAQ,oBAAoB,MAAM,IAAI,sGAAsG,SAAS,qBAAqB,wBAAwB,QAAQ,8BAA8B,qCAAqC,QAAQ,gBAAgB,IAAI,wCAAwC,uBAAuB,SAAS,MAAM,YAAY,gFAAgF,qCAAqC,IAAI,eAAe,yDAAyD,uBAAuB,sEAAsE,EAAE,6BAA6B,mBAAmB,sCAAsC,MAAM,sDAAsD,OAAO,iBAAiB,sCAAsC,kBAAkB,sBAAsB,oBAAoB,0BAA0B,qBAAqB,SAAS,iBAAiB,kCAAkC,mBAAmB,UAAU,wBAAwB,oEAAoE,iBAAiB,uCAAuC,kBAAkB,YAAY,SAAS,WAAW,qBAAqB,sQAAsQ,iBAAiB,SAAS,mBAAmB,8CAA8C,qBAAqB,sBAAsB,iBAAiB,gBAAgB,8BAA8B,uBAAuB,0BAA0B,mBAAmB,iCAAiC,mHAAmH,EAAE,SAAS,YAAY,sBAAsB,QAAQ,oBAAoB,kBAAkB,oCAAoC,QAAQ,WAAW,kFAAkF,8MAA8M,kBAAkB,IAAI,IAAI,SAAS,yHAAyH,2FAA2F,8BAA8B,oGAAoG,YAAY,qBAAqB,gCAAgC,MAAM,8BAA8B,kBAAkB,kCAAkC,IAAI,oGAAoG,2DAA2D,2BAA2B,gCAAgC,kBAAkB,uFAAuF,mBAAmB,gFAAgF,2GAA2G,gCAAgC,oBAAoB,EAAE,+DAA+D,uCAAuC,gHAAgH,8BAA8B,wBAAwB,QAAQ,GAAG,mBAAmB,aAAa,sFAAsF,uBAAuB,sCAAsC,oBAAoB,OAAO,WAAW,yCAAyC,6FAA6F,qMAAqM,8BAA8B,6BAA6B,wDAAwD,yFAAyF,sBAAsB,WAAW,IAAI,2CAA2C,qCAAqC,yBAAyB,gBAAgB,uBAAuB,cAAc,uCAAuC,kBAAkB,qDAAqD,aAAa,+BAA+B,qBAAqB,kBAAkB,sBAAsB,eAAe,2EAA2E,wBAAwB,MAAM,qBAAqB,sBAAsB,gCAAgC,6BAA6B,SAAS,mBAAmB,uEAAuE,wBAAwB,oGAAoG,sBAAsB,wBAAwB,eAAe,eAAe,uEAAuE,yBAAyB,8FAA8F,qBAAqB,sBAAsB,yCAAyC,6BAA6B,SAAS,2BAA2B,kBAAkB,QAAQ,mHAAmH,IAAI,wFAAwF,UAAU,aAAa,cAAc,SAAS,UAAU,oBAAoB,kCAAkC,sBAAsB,uBAAuB,0BAA0B,cAAc,uBAAuB,uBAAuB,2BAA2B,eAAe,eAAe,mBAAmB,sCAAsC,eAAe,uEAAuE,WAAW,kFAAkF,2BAA2B,SAAS,8CAA8C,cAAc,qBAAqB,MAAM,+EAA+E,qBAAqB,gBAAgB,EAAE,oCAAoC,wBAAwB,4BAA4B,iBAAiB,GAAG,YAAY,sBAAsB,MAAM,sHAAsH,uBAAuB,UAAU,+DAA+D,4GAA4G,eAAe,2BAA2B,2BAA2B,qBAAqB,iCAAiC,gDAAgD,0BAA0B,EAAE,GAAG,eAAe,oBAAoB,QAAQ,sHAAsH,wBAAwB,uEAAuE,EAAE,qBAAqB,4BAA4B,kBAAkB,EAAE,wBAAwB,8BAA8B,uBAAuB,2DAA2D,2BAA2B,6CAA6C,wEAAwE,yBAAyB,EAAE,gLAAgL,qCAAqC,KAAK,aAAa,gCAAgC,0EAA0E,EAAE,qBAAqB,iGAAiG,qBAAqB,4BAA4B,eAAe,YAAY,qBAAqB,6GAA6G,gBAAgB,uBAAuB,kEAAkE,8BAA8B,uFAAuF,UAAU,iBAAiB,0CAA0C,IAAI,+XAA+X,QAAQ,IAAI,0CAA0C,SAAS,aAAa,gBAAgB,mBAAmB,iBAAiB,gBAAgB,oBAAoB,yEAAyE,uCAAuC,GAAG,EAAE,iHAAiH,yaAAya,QAAQ,oMAAoM,iBAAiB,MAAM,+LAA+L,iBAAiB,uBAAuB,IAAI,0DAA0D,+IAA+I,iBAAiB,EAAE,uBAAuB,qEAAqE,IAAI,sEAAsE,oBAAoB,yJAAyJ,wBAAwB,wDAAwD,iCAAiC,qBAAqB,oDAAoD,4DAA4D,IAAI,8CAA8C,SAAS,2FAA2F,cAAc,SAAS,cAAc,SAAS,iBAAiB,sBAAsB,IAAI,uBAAuB,WAAW,kBAAkB,yBAAyB,QAAQ,uBAAuB,mEAAmE,SAAS,iHAAiH,oBAAoB,kCAAkC,0CAA0C,oDAAoD,0BAA0B,EAAE,mBAAmB,kCAAkC,iCAAiC,wBAAwB,2BAA2B,mCAAmC,oCAAoC,gHAAgH,sEAAsE,8BAA8B,wEAAwE,iCAAiC,4CAA4C,SAAS,SAAS,yBAAyB,qCAAqC,SAAS,yLAAyL,mGAAmG,sCAAsC,kGAAkG,4DAA4D,aAAa,kIAAkI,iQAAiQ,4BAA4B,mDAAmD,oBAAoB,oCAAoC,4EAA4E,wBAAwB,0HAA0H,yMAAyM,wGAAwG,gDAAgD,iDAAiD,sBAAsB,uJAAuJ,eAAe,mBAAmB,sBAAsB,0EAA0E,sCAAsC,6CAA6C,2BAA2B,yMAAyM,oGAAoG,6DAA6D,wBAAwB,gDAAgD,wDAAwD,SAAS,6EAA6E,aAAa,KAAK,IAAI,oIAAoI,kBAAkB,kBAAkB,EAAE,kCAAkC,2BAA2B,IAAI,uBAAuB,2CAA2C,kDAAkD,mDAAmD,YAAY,mDAAmD,iBAAiB,8BAA8B,kDAAkD,GAAG,EAAE,iBAAiB,qCAAqC,UAAU,MAAM,YAAY,QAAQ,kBAAkB,cAAc,mEAAmE,qBAAqB,cAAc,gEAAgE,sBAAsB,eAAe,2EAA2E,eAAe,yBAAyB,8EAA8E,+BAA+B,kDAAkD,uBAAuB,sDAAsD,gYAAgY,oBAAoB,4IAA4I,yBAAyB,oEAAoE,4BAA4B,yBAAyB,uEAAuE,qCAAqC,yBAAyB,iHAAiH,SAAS,uWAAuW,eAAe,+IAA+I,0BAA0B,gCAAgC,eAAe,oBAAoB,iBAAiB,wBAAwB,oBAAoB,qBAAqB,iBAAiB,UAAU,kGAAkG,eAAe,oBAAoB,6CAA6C,sCAAsC,6GAA6G,eAAe,qBAAqB,wBAAwB,uBAAuB,0BAA0B,qBAAqB,QAAQ,8JAA8J,uBAAuB,8BAA8B,YAAY,uFAAuF,2BAA2B,GAAG,EAAE,oHAAoH,iBAAiB,0FAA0F,eAAe,2DAA2D,eAAe,2FAA2F,iBAAiB,gBAAgB,mBAAmB,kGAAkG,IAAI,6BAA6B,0CAA0C,iBAAiB,qBAAqB,OAAO,mDAAmD,mFAAmF,cAAc,8CAA8C,EAAE,8FAA8F,0CAA0C,IAAI,kFAAkF,uDAAuD,IAAI,qKAAqK,uCAAuC,yCAAyC,SAAS,mBAAmB,kCAAkC,eAAe,mHAAmH,SAAS,UAAU,0BAA0B,SAAS,uBAAuB,4CAA4C,0GAA0G,IAAI,kKAAkK,mDAAmD,IAAI,kBAAkB,aAAa,+DAA+D,uBAAuB,oCAAoC,kBAAkB,aAAa,mBAAmB,mFAAmF,oBAAoB,sCAAsC,eAAe,mBAAmB,qBAAqB,oBAAoB,kBAAkB,kBAAkB,0BAA0B,4DAA4D,+EAA+E,EAAE,0BAA0B,mBAAmB,qCAAqC,oFAAoF,EAAE,oBAAoB,qCAAqC,6DAA6D,iBAAiB,gCAAgC,EAAE,mBAAmB,qCAAqC,sDAAsD,EAAE,kBAAkB,qCAAqC,kEAAkE,EAAE,kBAAkB,cAAc,kBAAkB,6DAA6D,YAAY,qBAAqB,sDAAsD,yBAAyB,EAAE,kBAAkB,0BAA0B,iBAAiB,mBAAmB,iDAAiD,iFAAiF,qBAAqB,IAAI,KAAK,IAAI,sBAAsB,kDAAkD,IAAI,WAAW,0BAA0B,0BAA0B,wBAAwB,SAAS,qCAAqC,sBAAsB,uEAAuE,KAAK,UAAU,yGAAyG,eAAe,oBAAoB,uCAAuC,KAAK,iEAAiE,0BAA0B,EAAE,gEAAgE,kCAAkC,gDAAgD,oBAAoB,aAAa,2CAA2C,uCAAuC,SAAS,iCAAiC,mBAAmB,sBAAsB,uQAAuQ,iBAAiB,OAAO,eAAe,iDAAiD,kBAAkB,YAAY,aAAa,MAAM,mCAAmC,cAAc,WAAW,eAAe,UAAU,6CAA6C,cAAc,sBAAsB,gBAAgB,YAAY,WAAW,YAAY,UAAU,yCAAyC,4BAA4B,8KAA8K,cAAc,iCAAiC,kEAAkE,4JAA4J,6BAA6B,aAAa,2BAA2B,aAAa,0BAA0B,aAAa,+BAA+B,aAAa,0BAA0B,aAAa,iCAAiC,YAAY,gIAAgI,8KAA8K,GAAG,GAAG,mEAAmE,eAAe,2BAA2B,uCAAuC,gDAAgD,uCAAuC,QAAQ,gDAAgD,wDAAwD,KAAK,oCAAoC,mBAAmB,iBAAiB,gDAAgD,yBAAyB,8BAA8B,uCAAuC,KAAK,IAAI,6RAA6R,oGAAoG,mBAAmB,6IAA6I,eAAe,eAAe,SAAS,wSAAwS,uBAAuB,wCAAwC,UAAU,UAAU,SAAS,kBAAkB,MAAM,sBAAsB,sBAAsB,YAAY,iRAAiR,YAAY,yBAAyB,+CAA+C,wCAAwC,iHAAiH,kSAAkS,uBAAuB,iBAAiB,iNAAiN,0CAA0C,eAAe,oBAAoB,iIAAiI,iBAAiB,EAAE,qBAAqB,mIAAmI,iMAAiM,8DAA8D,iFAAiF,aAAa,YAAY,sCAAsC,QAAQ,UAAU,oCAAoC,eAAe,iBAAiB,mBAAmB,gBAAgB,uCAAuC,IAAI,oCAAoC,UAAU,wCAAwC,eAAe,kBAAkB,8BAA8B,YAAY,KAAK,qBAAqB,uBAAuB,IAAI,+BAA+B,SAAS,4CAA4C,0BAA0B,2BAA2B,0CAA0C,wJAAwJ,gBAAgB,8BAA8B,4DAA4D,iBAAiB,gCAAgC,0SAA0S,6CAA6C,UAAU,gBAAgB,MAAM,wIAAwI,iBAAiB,2KAA2K,qCAAqC,gBAAgB,4DAA4D,WAAW,mBAAmB,SAAS,mBAAmB,+BAA+B,kBAAkB,qCAAqC,6DAA6D,cAAc,oHAAoH,cAAc,+BAA+B,UAAU,gBAAgB,iBAAiB,aAAa,UAAU,YAAY,IAAI,8CAA8C,kCAAkC,mBAAmB,yEAAyE,IAAI,mCAAmC,mBAAmB,oEAAoE,cAAc,eAAe,cAAc,sGAAsG,IAAI,uBAAuB,6FAA6F,cAAc,wBAAwB,sBAAsB,gBAAgB,0BAA0B,sHAAsH,mEAAmE,0BAA0B,kBAAkB,8BAA8B,iBAAiB,SAAS,IAAI,uBAAuB,sFAAsF,YAAY,mBAAmB,cAAc,oMAAoM,YAAY,yBAAyB,IAAI,0HAA0H,0LAA0L,iCAAiC,KAAK,yBAAyB,UAAU,mBAAmB,4BAA4B,mCAAmC,EAAE,uBAAuB,gCAAgC,yBAAyB,IAAI,uEAAuE,6BAA6B,2DAA2D,mDAAmD,kHAAkH,gBAAgB,mCAAmC,oBAAoB,oDAAoD,EAAE,2BAA2B,wDAAwD,0CAA0C,KAAK,2BAA2B,mXAAmX,YAAY,4HAA4H,6EAA6E,kEAAkE,UAAU,mDAAmD,6DAA6D,0EAA0E,0BAA0B,kDAAkD,0BAA0B,uCAAuC,KAAK,gEAAgE,4OAA4O,4DAA4D,GAAG,cAAc,yBAAyB,8DAA8D,UAAU,QAAQ,2BAA2B,uDAAuD,yBAAyB,OAAO,uCAAuC,qEAAqE,sBAAsB,kBAAkB,aAAa,oBAAoB,4FAA4F,4DAA4D,8BAA8B,qDAAqD,eAAe,IAAI,mFAAmF,yBAAyB,EAAE,oBAAoB,+CAA+C,iFAAiF,8EAA8E,IAAI,sEAAsE,QAAQ,IAAI,8CAA8C,gBAAgB,GAAG,gDAAgD,cAAc,wBAAwB,0FAA0F,UAAU,yEAAyE,eAAe,UAAU,eAAe,aAAa,kBAAkB,eAAe,wBAAwB,8BAA8B,mCAAmC,qBAAqB,kBAAkB,WAAW,0CAA0C,gCAAgC,wBAAwB,8BAA8B,wCAAwC,iBAAiB,sBAAsB,QAAQ,cAAc,+BAA+B,0BAA0B,sEAAsE,wBAAwB,kBAAkB,mBAAmB,EAAE,0PAA0P,4BAA4B,aAAa,mBAAmB,6CAA6C,wBAAwB,4BAA4B,qBAAqB,GAAG,YAAY,qBAAqB,qBAAqB,wWAAwW,YAAY,MAAM,kBAAkB,6CAA6C,cAAc,oDAAoD,0BAA0B,0BAA0B,0DAA0D,MAAM,oBAAoB,sDAAsD,6DAA6D,yBAAyB,sBAAsB,0BAA0B,+DAA+D,EAAE,gEAAgE,eAAe,iCAAiC,eAAe,mDAAmD,eAAe,6DAA6D,aAAa,mBAAmB,6CAA6C,wBAAwB,4BAA4B,6BAA6B,GAAG,YAAY,qBAAqB,qBAAqB,gMAAgM,YAAY,UAAU,gBAAgB,gCAAgC,gFAAgF,UAAU,qCAAqC,wCAAwC,gBAAgB,mBAAmB,wDAAwD,iBAAiB,mBAAmB,+DAA+D,iJAAiJ,mCAAmC,eAAe,qBAAqB,sBAAsB,qCAAqC,0CAA0C,EAAE,kFAAkF,IAAI,kDAAkD,yCAAyC,YAAY,yBAAyB,sBAAsB,qCAAqC,6CAA6C,EAAE,kDAAkD,kFAAkF,IAAI,wEAAwE,yCAAyC,YAAY,2BAA2B,gDAAgD,+FAA+F,iDAAiD,uBAAuB,YAAY,MAAM,sBAAsB,4DAA4D,yKAAyK,EAAE,sBAAsB,YAAY,YAAY,gFAAgF,UAAU,EAAE,aAAa,aAAa,gBAAgB,oBAAoB,sDAAsD,MAAM,sIAAsI,uBAAuB,kIAAkI,gLAAgL,YAAY,UAAU,QAAQ,gBAAgB,6BAA6B,gCAAgC,SAAS,gBAAgB,6FAA6F,kBAAkB,IAAI,uGAAuG,2BAA2B,UAAU,SAAS,mBAAmB,gDAAgD,+EAA+E,oCAAoC,yCAAyC,kBAAkB,kBAAkB,iEAAiE,8CAA8C,mDAAmD,EAAE,4BAA4B,wDAAwD,qBAAqB,kBAAkB,0BAA0B,2GAA2G,0bAA0b,4CAA4C,2BAA2B,uDAAuD,EAAE,6BAA6B,mEAAmE,IAAI,uPAAuP,8TAA8T,0BAA0B,8BAA8B,sBAAsB,EAAE,2BAA2B,eAAe,sBAAsB,4BAA4B,0BAA0B,EAAE,8BAA8B,cAAc,uCAAuC,qBAAqB,gCAAgC,eAAe,kBAAkB,6CAA6C,oBAAoB,iBAAiB,8DAA8D,qDAAqD,qBAAqB,gEAAgE,kEAAkE,EAAE,sBAAsB,gBAAgB,SAAS,uBAAuB,MAAM,sCAAsC,IAAI,kDAAkD,SAAS,SAAS,uFAAuF,8GAA8G,qBAAqB,MAAM,2CAA2C,4EAA4E,EAAE,kCAAkC,yCAAyC,sBAAsB,2BAA2B,iBAAiB,wEAAwE,oBAAoB,uEAAuE,wBAAwB,EAAE,+BAA+B,mBAAmB,cAAc,qBAAqB,sCAAsC,2BAA2B,2BAA2B,8BAA8B,6BAA6B,oBAAoB,gBAAgB,6GAA6G,oBAAoB,oBAAoB,yDAAyD,OAAO,wCAAwC,GAAG,wCAAwC,SAAS,EAAE,+GAA+G,MAAM,6CAA6C,eAAe,qBAAqB,gCAAgC,yCAAyC,0GAA0G,qBAAqB,QAAQ,UAAU,cAAc,MAAM,6CAA6C,eAAe,mFAAmF,IAAI,0CAA0C,iBAAiB,yCAAyC,2CAA2C,YAAY,6BAA6B,0BAA0B,wBAAwB,QAAQ,eAAe,8LAA8L,yBAAyB,mHAAmH,WAAW,4CAA4C,iBAAiB,0DAA0D,aAAa,4EAA4E,cAAc,mBAAmB,yBAAyB,yDAAyD,8DAA8D,2CAA2C,wCAAwC,kIAAkI,KAAK,KAAK,iBAAiB,2CAA2C,MAAM,MAAM,OAAO,KAAK,0FAA0F,yBAAyB,iCAAiC,kCAAkC,gBAAgB,gCAAgC,yEAAyE,8BAA8B,oCAAoC,wBAAwB,MAAM,gCAAgC,iCAAiC,YAAY,mBAAmB,WAAW,mCAAmC,sMAAsM,uBAAuB,IAAI,0FAA0F,SAAS,kBAAkB,kHAAkH,03BAA03B,0EAA0E,qEAAqE,iFAAiF,4DAA4D,iDAAiD,mBAAmB,aAAa,IAAI,iBAAiB,SAAS,aAAa,SAAS,0BAA0B,oBAAoB,kBAAkB,mHAAmH,uCAAuC,2FAA2F,uCAAuC,aAAa,MAAM,mBAAmB,KAAK,YAAY,oCAAoC,IAAI,MAAM,SAAS,OAAO,wCAAwC,0FAA0F,sBAAsB,kBAAkB,uBAAuB,iEAAiE,YAAY,8IAA8I,wBAAwB,sGAAsG,kDAAkD,MAAM,mCAAmC,SAAS,OAAO,SAAS,OAAO,iEAAiE,OAAO,wBAAwB,0hBAA0hB,SAAS,yBAAyB,2BAA2B,yBAAyB,mCAAmC,sCAAsC,uBAAuB,oDAAoD,yCAAyC,0BAA0B,8BAA8B,MAAM,sFAAsF,6BAA6B,eAAe,2EAA2E,2BAA2B,wBAAwB,qBAAqB,EAAE,cAAc,oBAAoB,MAAM,qJAAqJ,WAAW,gDAAgD,SAAS,qBAAqB,uBAAuB,kCAAkC,kCAAkC,uBAAuB,6BAA6B,kCAAkC,EAAE,kBAAkB,WAAW,6BAA6B,oCAAoC,EAAE,oBAAoB,kDAAkD,qCAAqC,QAAQ,oCAAoC,iCAAiC,oCAAoC,mEAAmE,+BAA+B,IAAI,4BAA4B,YAAY,QAAQ,eAAe,yBAAyB,+EAA+E,QAAQ,qCAAqC,mBAAmB,gBAAgB,2GAA2G,oLAAoL,cAAc,kBAAkB,uRAAuR,kBAAkB,EAAE,oBAAoB,8BAA8B,gHAAgH,0CAA0C,OAAO,EAAE,cAAc,IAAI,mCAAmC,SAAS,cAAc,kBAAkB,SAAS,8BAA8B,sCAAsC,eAAe,SAAS,mGAAmG,WAAW,iCAAiC,aAAa,0BAA0B,2BAA2B,uCAAuC,6DAA6D,uCAAuC,QAAQ,uCAAuC,mBAAmB,sCAAsC,QAAQ,kCAAkC,gCAAgC,wDAAwD,2BAA2B,kBAAkB,SAAS,EAAE,oCAAoC,aAAa,0CAA0C,wCAAwC,qBAAqB,+CAA+C,wKAAwK,iPAAiP,4CAA4C,8CAA8C,YAAY,qBAAqB,oHAAoH,WAAW,uKAAuK,kUAAkU,UAAU,2BAA2B,kCAAkC,wHAAwH,2CAA2C,mBAAmB,kEAAkE,0BAA0B,kBAAkB,sCAAsC,EAAE,OAAO,qCAAqC,mCAAmC,kBAAkB,SAAS,WAAW,0BAA0B,kDAAkD,6PAA6P,wMAAwM,cAAc,mBAAmB,iEAAiE,6BAA6B,EAAE,kBAAkB,+FAA+F,kDAAkD,GAAG,aAAa,QAAQ,qBAAqB,YAAY,uBAAuB,cAAc,6DAA6D,KAAK,sEAAsE,4FAA4F,sHAAsH,OAAO,sFAAsF,yBAAyB,2BAA2B,wBAAwB,yDAAyD,aAAa,GAAG,UAAU,iDAAiD,eAAe,wBAAwB,oBAAoB,8BAA8B,MAAM,4EAA4E,yDAAyD,wBAAwB,sCAAsC,+CAA+C,2DAA2D,EAAE,UAAU,8BAA8B,eAAe,QAAQ,yCAAyC,eAAe,sBAAsB,yFAAyF,8BAA8B,MAAM,+PAA+P,kBAAkB,EAAE,oGAAoG,oBAAoB,qBAAqB,eAAe,qBAAqB,2BAA2B,sBAAsB,0BAA0B,4BAA4B,wBAAwB,4BAA4B,mEAAmE,qBAAqB,4CAA4C,0NAA0N,sBAAsB,+DAA+D,EAAE,4CAA4C,sBAAsB,UAAU,wFAAwF,oDAAoD,iCAAiC,yBAAyB,4BAA4B,uJAAuJ,gBAAgB,4DAA4D,oBAAoB,wCAAwC,sEAAsE,SAAS,EAAE,uBAAuB,gCAAgC,0DAA0D,2CAA2C;;CCD5yuF;AACA;AACA;AACA,kBAAkB,qIAAqI,kBAAkB,aAAa,cAAc,kCAAkC,kBAAkB,gBAAgB,2BAA2B,+DAA+D,gBAAgB,cAAc,iDAAiD,cAAc,2BAA2B,mBAAmB,kDAAkD,+BAA+B,oDAAoD,qDAAqD,cAAc,4CAA4C,cAAc,kCAAkC,cAAc,sCAAsC,0DAA0D,4BAA4B,yCAAyC,oBAAoB,4KAA4K,cAAc,iBAAiB,2DAA2D,cAAc,6CAA6C,gBAAgB,oEAAoE,6GAA6G,8BAA8B,gCAAgC,kDAAkD,WAAW,yCAAyC,cAAc,qHAAqH,2BAA2B,4EAA4E,YAAY,YAAY,gBAAgB,kGAAkG,2DAA2D,gBAAgB,wDAAwD,2EAA2E,oBAAoB,yNAAyN,cAAc,8DAA8D,OAAO,iDAAiD,cAAc,YAAY,IAAI,2CAA2C,EAAE,cAAc,SAAS,IAAI,UAAU,4BAA4B,+BAA+B,0CAA0C,iCAAiC,UAAU,OAAO,iEAAiE,4CAA4C,6GAA6G,SAAS,WAAW,+CAA+C,YAAY,gBAAgB,uLAAuL,8CAA8C,SAAS,qEAAqE,EAAE,uCAAuC,yDAAyD,+EAA+E,qEAAqE,cAAc,6NAA6N,qEAAqE,YAAY,cAAc,iBAAiB,mCAAmC,sCAAsC,WAAW,gBAAgB,cAAc,6DAA6D,0BAA0B,6BAA6B,mBAAmB,mCAAmC,oBAAoB,iEAAiE,aAAa,oBAAoB,2BAA2B,KAAK,MAAM,2IAA2I,eAAe,+BAA+B,8CAA8C,uFAAuF,SAAS,OAAO,yBAAyB,qGAAqG,cAAc,yBAAyB,WAAW,sBAAsB,+DAA+D,mCAAmC,oBAAoB,KAAK,iCAAiC,QAAQ,sCAAsC,SAAS,uCAAuC,OAAO,qCAAqC,kCAAkC,WAAW,MAAM,OAAO,aAAa,EAAE,qBAAqB,qBAAqB,yBAAyB,yBAAyB,2CAA2C,mDAAmD,sBAAsB,kBAAkB,qFAAqF,gBAAgB,cAAc,mLAAmL,+CAA+C,SAAS,cAAc,OAAO,qDAAqD,sDAAsD,YAAY,EAAE,kBAAkB,kBAAkB,cAAc,8BAA8B,gHAAgH,8DAA8D,gBAAgB,qDAAqD,kBAAkB,4DAA4D,gBAAgB,EAAE,sBAAsB,gBAAgB,EAAE,oBAAoB,kBAAkB,4CAA4C,6BAA6B,qFAAqF,0BAA0B,4GAA4G,IAAI,aAAa,4BAA4B,OAAO,uBAAuB,eAAe,cAAc,wBAAwB,0kBAA0kB,gBAAgB,0BAA0B,yBAAyB,gBAAgB,EAAE,cAAc,kFAAkF,WAAW,KAAK,wBAAwB,uDAAuD,YAAY,aAAa,2aAA2a,cAAc,sBAAsB,8BAA8B,oBAAoB,4DAA4D,wBAAwB,WAAW,wCAAwC,oBAAoB,8DAA8D,WAAW,EAAE,WAAW,0FAA0F,aAAa,qGAAqG,gBAAgB,4FAA4F,8CAA8C,kFAAkF,aAAa,8GAA8G,cAAc,iDAAiD,gBAAgB,mCAAmC,SAAS,sGAAsG,EAAE,gBAAgB,mCAAmC,WAAW,mDAAmD,EAAE,gBAAgB,2DAA2D,SAAS,yIAAyI,OAAO,gGAAgG,kBAAkB,sBAAsB,aAAa,aAAa,4BAA4B,8CAA8C,EAAE,OAAO,gBAAgB,wHAAwH,SAAS,cAAc,4CAA4C,cAAc,oHAAoH,uBAAuB,oBAAoB,0DAA0D,eAAe,uBAAuB,MAAM,UAAU,aAAa,MAAM,8BAA8B,WAAW,kBAAkB,uBAAuB,MAAM,wJAAwJ,SAAS,oBAAoB,oFAAoF,gBAAgB,8BAA8B,4BAA4B,GAAG,2HAA2H,mHAAmH,6BAA6B,yCAAyC,8BAA8B,qHAAqH,qBAAqB,kBAAkB,EAAE,0BAA0B,wBAAwB,oCAAoC,EAAE,IAAI,gBAAgB,sFAAsF,yMAAyM,8JAA8J,2CAA2C,WAAW,0DAA0D,SAAS,2CAA2C,SAAS,kBAAkB,kDAAkD,SAAS,IAAI,aAAa,SAAS,kBAAkB,+BAA+B,SAAS,OAAO,2HAA2H,8EAA8E,eAAe,gBAAgB,cAAc,WAAW,yHAAyH,uBAAuB,wCAAwC,sBAAsB,yCAAyC,kDAAkD,WAAW,+BAA+B,cAAc,mBAAmB,yFAAyF,SAAS,sOAAsO,sEAAsE,eAAe,gBAAgB,uEAAuE,0CAA0C,uCAAuC,0DAA0D,2BAA2B,6CAA6C,2FAA2F,kBAAkB,wDAAwD,4BAA4B,4BAA4B,8BAA8B,EAAE,qEAAqE,WAAW,OAAO,yBAAyB,qBAAqB,uBAAuB,qCAAqC,2EAA2E,gBAAgB,iCAAiC,0DAA0D,cAAc,8BAA8B,qBAAqB,EAAE,+BAA+B,qBAAqB,EAAE,4CAA4C,qBAAqB,EAAE,6CAA6C,qBAAqB,KAAK,GAAG,qGAAqG,6FAA6F,sBAAsB,YAAY,OAAO,oCAAoC,sDAAsD,MAAM,qHAAqH,WAAW,kBAAkB,oBAAoB,sBAAsB,SAAS,UAAU,SAAS,mCAAmC,kBAAkB,sCAAsC,gDAAgD,mCAAmC,uEAAuE,2BAA2B,4EAA4E,uCAAuC,uCAAuC,oBAAoB,WAAW,iEAAiE,MAAM,uBAAuB,sCAAsC,+FAA+F,QAAQ,6BAA6B,2DAA2D,OAAO,YAAY,uBAAuB,qFAAqF,eAAe,oCAAoC,uKAAuK,uGAAuG,QAAQ,sCAAsC,MAAM,4DAA4D,gBAAgB,uBAAuB,qDAAqD,8HAA8H,gNAAgN,uIAAuI,yIAAyI,iEAAiE,8BAA8B,qBAAqB,OAAO,sCAAsC,4CAA4C,yDAAyD,sKAAsK,mBAAmB,qBAAqB,MAAM,yBAAyB,MAAM,mCAAmC,MAAM,sBAAsB,+BAA+B,kCAAkC,mCAAmC,4kBAA4kB,yGAAyG,4GAA4G,IAAI,qGAAqG,QAAQ,oCAAoC,6IAA6I,oGAAoG,OAAO,oCAAoC,8DAA8D,+DAA+D,iCAAiC,aAAa,mEAAmE,wBAAwB,iDAAiD,KAAK,wBAAwB,iDAAiD,UAAU,eAAe,sCAAsC,wEAAwE,4BAA4B,kBAAkB,0JAA0J,0EAA0E,oBAAoB,mHAAmH,2PAA2P,KAAK,yCAAyC,wCAAwC,OAAO,2BAA2B,yBAAyB,+BAA+B,gCAAgC,kCAAkC,yCAAyC,aAAa,oCAAoC,4JAA4J,4BAA4B,kHAAkH,4CAA4C,4CAA4C,IAAI,0BAA0B,IAAI;AAClkpB;;CCJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,sEAAsE;AACtE,SAAS,gCAAgC;AACzC;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,SAAS,yCAAyC;AAClD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,yCAAyC,6CAA6C;AACtF;AACA,eAAe,6CAA6C;AAC5D;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,8EAA8E,gEAAgE;AAC9I;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO,oBAAoB;AAC1C;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,mDAAmD;AACnD;AACA;AACA,eAAe,8BAA8B;AAC7C,yEAAyE,oCAAoC;AAC7G,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,eAAe,8BAA8B;AAC7C,yEAAyE,oCAAoC;AAC7G,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,eAAe,8BAA8B;AAC7C,uEAAuE,oCAAoC;AAC3G,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,eAAe,8BAA8B;AAC7C,0EAA0E,oCAAoC;AAC9G,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB,sNAAsN;AACtN;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,kDAAkD;AACjE;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,kDAAkD;AACjE;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,kDAAkD;AACjE;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,kDAAkD;AACjE;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,0EAA0E;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iDAAiD,+BAA+B;AAChF;AACA,eAAe,QAAQ;AACvB;AACA,iDAAiD,+BAA+B;AAChF;AACA,eAAe,OAAO,gBAAgB;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;;;AAGA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,kBAAkB,OAAO;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uEAAuE,4BAA4B;AACnG;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,uBAAuB;AACvB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB,oBAAoB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC;;AAEhC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,mCAAmC,qBAAqB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,oBAAoB;AACvC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,mBAAmB,MAAM;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,MAAM;AACzB,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM;AACzB,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oCAAoC,YAAY;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,mBAAmB,eAAe;AAClC,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA,mBAAmB,MAAM;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,MAAM;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;;AAEA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;;AAEA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,KAAK;AACxB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,SAAS;AAC5B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B,oBAAoB;AACpB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS;;;AAGT;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;;AAGL;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA,cAAc;AACd,kBAAkB,uBAAuB,sBAAsB,6BAA6B;AAC5F,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iEAAiE,GAAG,OAAO,GAAG;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,kBAAkB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,qBAAqB,aAAa;AAClC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kBAAkB,QAAQ;AAC1B,kBAAkB,SAAS;AAC3B,kBAAkB,SAAS;AAC3B,kBAAkB,SAAS;AAC3B,kBAAkB,SAAS;AAC3B,kBAAkB,SAAS;AAC3B,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA,kCAAkC,cAAc,EAAE;AAClD,0CAA0C,aAAa,EAAE;AACzD,wCAAwC;AACxC,qCAAqC;AACrC,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA,eAAe,QAAQ;AACvB;AACA,aAAa,yDAAyD;AACtE,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD;AAChD;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA,uDAAuD,yBAAyB,EAAE;AAClF,uDAAuD,4BAA4B,EAAE;AACrF,uDAAuD,2BAA2B,EAAE;AACpF,uDAAuD,yBAAyB,EAAE;AAClF,uDAAuD,4BAA4B,EAAE;AACrF,uDAAuD,yBAAyB,EAAE;AAClF,uDAAuD,wBAAwB,EAAE;;AAEjF,uDAAuD,yBAAyB,EAAE;AAClF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,8BAA8B,EAAE;;AAEvF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,4BAA4B,EAAE;AACrF,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,2BAA2B,EAAE;AACpF,uDAAuD,mCAAmC,EAAE;AAC5F,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,qCAAqC,EAAE;;AAE9F,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,4BAA4B,EAAE;AACrF,uDAAuD,oCAAoC,EAAE;AAC7F,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,qCAAqC,EAAE;AAC9F,uDAAuD,+BAA+B,EAAE;;AAExF,uDAAuD,gCAAgC,EAAE;AACzF,uDAAuD,iCAAiC,EAAE;;AAE1F,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,8BAA8B,EAAE;AACvF,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,6BAA6B,EAAE;AACtF,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,+BAA+B,EAAE;AACxF,uDAAuD,iCAAiC,EAAE;AAC1F,uDAAuD,iCAAiC,EAAE;AAC1F,uDAAuD,qCAAqC,EAAE;AAC9F,uDAAuD,uCAAuC,EAAE;;AAEhG;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,wBAAwB,mEAAmE;AAC3F;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA,2BAA2B,yCAAyC;AACpE;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA,wBAAwB,mEAAmE;AAC3F,uCAAuC,mEAAmE;AAC1G;AACA,mBAAmB,OAAO;AAC1B,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,SAAS;AACjC;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA,mBAAmB,QAAQ;AAC3B,oGAAoG;AACpG,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA,mBAAmB,QAAQ;AAC3B,oGAAoG;AACpG,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,kCAAkC,EAAE;;AAEpC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,6CAA6C,EAAE;;AAE/C;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,qCAAqC,EAAE;;AAEvC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,+CAA+C,EAAE;;AAEjD;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,kCAAkC,EAAE;;AAEpC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,oCAAoC,EAAE;;AAEtC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,sCAAsC,EAAE;;AAExC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,kCAAkC,EAAE;;AAEpC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,qCAAqC,EAAE;;AAEvC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,gDAAgD;AACnE;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,oBAAoB;AACvC;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mBAAmB,QAAQ;AAC3B,qGAAqG;AACrG,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,kCAAkC,EAAE;;AAEpC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,qCAAqC,EAAE;;AAEvC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,iCAAiC,EAAE;;AAEnC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,mCAAmC,EAAE;;AAErC;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,2BAA2B;AAC9C;AACA,mBAAmB,OAAO;AAC1B;AACA,mBAAmB,QAAQ;AAC3B;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,kCAAkC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,QAAQ;AAC1B;AACA,kBAAkB,QAAQ;AAC1B;AACA,kBAAkB,QAAQ;AAC1B;AACA,kBAAkB,QAAQ;AAC1B;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,oBAAoB;AACtC;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,oBAAoB;AACtC;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,oBAAoB;AACtC;AACA,kBAAkB,OAAO;AACzB;AACA;;;AAGA;AACA;AACA,+DAA+D,2DAA2D;AAC1H;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qBAAqB,gDAAgD;AACrE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mBAAmB,wCAAwC;AAC3D,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,6CAA6C;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA,mBAAmB,OAAO;AAC1B,qBAAqB,6CAA6C;AAClE;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qBAAqB,6CAA6C;AAClE;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,2CAA2C;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,2CAA2C;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;;AAEA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;;AAEA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA,iEAAiE;AACjE;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA,eAAe,wCAAwC;AACvD;AACA,iBAAiB,OAAO;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA,eAAe,wCAAwC;AACvD;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,6BAA6B;AAChD;AACA,+DAA+D;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC,2DAA2D;;AAE3D;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,gDAAgD;AAC/D;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,4BAA4B;AACvC;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,6GAA6G;AAC7G;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sDAAsD,QAAQ;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET,qCAAqC;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA,oBAAoB;AACpB;AACA;AACA;;AAEA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;;AAEA;AACA,SAAS;;;AAGT;AACA;AACA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;;AAEA,+CAA+C,QAAQ;AACvD;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,iBAAiB,OAAO,uBAAuB,gCAAgC;AAC/E,6BAA6B,mCAAmC;AAChE,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,6BAA6B,qCAAqC;AAClE,iCAAiC,+CAA+C;AAChF,0BAA0B,kCAAkC;AAC5D,oBAAoB,QAAQ;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;;AAEnC;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,0CAA0C,wBAAwB;AAClE;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,gCAAgC;AAChD;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,uEAAuE;AACvE;AACA,KAAK;;AAEL;AACA;AACA,8EAA8E;AAC9E;AACA,KAAK;;AAEL;AACA;AACA;AACA,QAAQ,4CAA4C;AACpD;AACA;AACA,eAAe,6BAA6B;AAC5C;AACA,iDAAiD,yCAAyC;AAC1F,qCAAqC;AACrC;AACA,qCAAqC,yCAAyC;AAC9E,eAAe,OAAO;AACtB;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,2BAA2B;AACnE;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,kCAAkC,qBAAqB;AACvD,kCAAkC,yBAAyB;AAC3D,kCAAkC,QAAQ;AAC1C;AACA;AACA,+CAA+C,iBAAiB;AAChE,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,kCAAkC,qBAAqB;AACvD,kCAAkC,OAAO;AACzC,kCAAkC,OAAO;AACzC,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qFAAqF;AACrF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,wCAAwC;AAC3E;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAkD,iCAAiC;AACnF;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,8CAA8C;AACzH;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA,2CAA2C,mBAAmB;AAC9D;AACA,KAAK;;;AAGL;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,yEAAyE,8CAA8C;AACvH;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA,8CAA8C,mBAAmB;AACjE;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;;AAEA,uBAAuB,+BAA+B;AACtD;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kFAAkF,uCAAuC;AACzH;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,oDAAoD;;AAEpD,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kDAAkD,EAAE;;AAEpD;;AAEA;AACA;AACA;;AAEA;AACA,2EAA2E,uCAAuC;AAClH;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA,uCAAuC,qBAAqB;;AAE5D;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oFAAoF,yCAAyC;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qFAAqF,yCAAyC;AAC9H;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,QAAQ;AACtC,8BAA8B,QAAQ;AACtC;AACA,kDAAkD,2BAA2B;AAC7E;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA,2DAA2D,sCAAsC;AACjG;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,QAAQ;AAC9B;AACA,qCAAqC,mBAAmB;AACxD;AACA,KAAK;;AAEL;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,eAAe,OAAO;AACtB,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC;AACA,eAAe,wBAAwB;AACvC;AACA,eAAe,mBAAmB;AAClC;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,wCAAwC,4BAA4B;AACpE,eAAe,OAAO;AACtB;AACA,kFAAkF,4BAA4B;AAC9G;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,6CAA6C,uCAAuC,4BAA4B;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,6CAA6C;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,OAAO;AACjC,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,gDAAgD;AAChD;AACA;AACA,eAAe,OAAO,gBAAgB;AACtC;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,wEAAwE;;AAExE,sCAAsC;AACtC;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,KAAK;;AAEL;AACA;AACA,+EAA+E;AAC/E;AACA,KAAK;;AAEL;AACA;AACA,+EAA+E;AAC/E;AACA,KAAK;;AAEL;AACA;AACA,8EAA8E;AAC9E;AACA,KAAK;;AAEL;AACA;AACA,6EAA6E;AAC7E;AACA,KAAK;;AAEL;AACA;AACA,2EAA2E;AAC3E;AACA,KAAK;;AAEL;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,wGAAwG,oCAAoC;AAC5I;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA,sCAAsC,aAAa;AACnD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,qCAAqC,4BAA4B;AACjE;AACA,eAAe,uCAAuC;AACtD;AACA,eAAe,wBAAwB;AACvC;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,+DAA+D,sCAAsC;AACrG;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B,sBAAsB,uCAAuC;AAC7D,sBAAsB,wBAAwB;AAC9C,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,eAAe,uCAAuC;AACtD;AACA,eAAe,wBAAwB;AACvC;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yCAAyC;AAC9D;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C;AACA,0BAA0B,QAAQ;AAClC,0BAA0B,uCAAuC;AACjE,0BAA0B,wBAAwB;AAClD,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yCAAyC;AAC9D;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C;AACA,0BAA0B,QAAQ;AAClC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,yCAAyC;AAC/G;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B;AACA,4CAA4C;AAC5C;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,sBAAsB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D,SAAS,oCAAoC,QAAQ;AACrD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;;AAEb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,6CAA6C,QAAQ;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,kCAAkC;AACxG;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wEAAwE,kCAAkC;AAC1G;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+EAA+E,kCAAkC;AACjH;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kEAAkE,kCAAkC;AACpG;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,kCAAkC;AAClG;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,yCAAyC,kCAAkC;AAC3E;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,OAAO;AACzB,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ,qGAAqG;AAC/H,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,yCAAyC,kCAAkC;AAC3E;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,OAAO;AACzB,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ,qGAAqG;AAC/H,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,+EAA+E,kCAAkC;AACjH;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,OAAO;AACzB,kBAAkB,oBAAoB;AACtC,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,8EAA8E,kCAAkC;AAChH;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,OAAO;AACzB,kBAAkB,oBAAoB;AACtC,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,qEAAqE,kCAAkC;AACvG;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,sEAAsE,kCAAkC;AACxG;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,kCAAkC;AAClF;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,gDAAgD;AAClE,kBAAkB,oBAAoB;AACtC,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kCAAkC;AACvF;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,2BAA2B;AACjD,sBAAsB,oBAAoB;AAC1C,sBAAsB,OAAO;AAC7B,sBAAsB,QAAQ;AAC9B,sBAAsB,OAAO;AAC7B,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C,qCAAqC;AAC/E;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ,qGAAqG;AAC/H,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,qCAAqC;AAC/E;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ,qGAAqG;AAC/H,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,QAAQ;AAC9B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,QAAQ;AAC1B;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,kCAAkC,EAAE,SAAS;;AAE3D;;AAEA;AACA;AACA;AACA,qCAAqC;;AAErC,qCAAqC;AACrC,qCAAqC;AACrC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA,sCAAsC;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qCAAqC;AACnF;AACA;AACA;AACA,YAAY;AACZ,gBAAgB,qBAAqB;AACrC,gBAAgB,2BAA2B;AAC3C,gBAAgB,oBAAoB;AACpC,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,OAAO;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qCAAqC;AACpF;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,QAAQ;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qCAAqC;AACtF;AACA;AACA;AACA,cAAc;AACd,kBAAkB,qBAAqB;AACvC,kBAAkB,2BAA2B;AAC7C,kBAAkB,oBAAoB;AACtC,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B,kBAAkB,OAAO;AACzB,kBAAkB,QAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,EAAE;AACpD;AACA;AACA,iEAAiE,EAAE,EAAE,EAAE;AACvE,yCAAyC,EAAE,GAAG,EAAE;AAChD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB;;AAEA,iCAAiC,KAAK;AACtC;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,SAAS;AACpB;AACA,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA,gCAAgC;AAChC;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,yBAAyB;AACvD,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,kDAAkD,oDAAoD;AACtG;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,yBAAyB;AACnD,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA,wCAAwC,0BAA0B;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,kCAAkC,yBAAyB;AAC3D,kCAAkC,OAAO;AACzC,kCAAkC,OAAO;AACzC,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,OAAO;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6BAA6B;AAC5C,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK,mCAAmC;AACxC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,4BAA4B;AACvC,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,4BAA4B;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,+CAA+C,QAAQ;AACvD;AACA,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,QAAQ;AAC3C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,gBAAgB,yBAAyB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2BAA2B,uBAAuB;AAClD,gCAAgC,wCAAwC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,+BAA+B,kCAAkC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA,eAAe,MAAM;AACrB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;;;;AAIA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,CAAC;;;AAGD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;AAGD,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL,CAAC;;;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,MAAM;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,SAAS;;AAET;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,mBAAmB;AAC3C;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD,yDAAyD,YAAY;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,2CAA2C,kBAAkB;AAC7D,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA,SAAS;AACT;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,wDAAwD;AACxD;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ,oFAAoF,OAAO;AAC9G,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,2BAA2B,oDAAoD,uCAAuC;AACjI,WAAW,2BAA2B,sDAAsD,yCAAyC;AACrI,WAAW,2BAA2B,oDAAoD,uCAAuC;AACjI,WAAW,2BAA2B,oDAAoD,uCAAuC;AACjI,WAAW,2BAA2B,mDAAmD,sCAAsC;AAC/H,WAAW,2BAA2B,oDAAoD,uCAAuC;AACjI,WAAW,2BAA2B,mDAAmD,sCAAsC;AAC/H;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,4CAA4C,qCAAqC;AACjF,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA,wCAAwC,qCAAqC;AAC7E,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,2CAA2C,qCAAqC;AAChF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA,uCAAuC,qCAAqC;AAC5E,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA,wCAAwC,qCAAqC;AAC7E,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,8CAA8C,qCAAqC;AACnF,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,2CAA2C,qCAAqC;AAChF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,4CAA4C,qCAAqC;AACjF;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,8BAA8B,qBAAqB;AACnD,8BAA8B,OAAO;AACrC,8BAA8B,QAAQ;AACtC;AACA,8CAA8C,qCAAqC;AACnF;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;AAGD;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;AAIA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,4BAA4B,0BAA0B;AACtD;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4BAA4B;AAChE,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D;AACA;;;AAGA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,cAAc,oBAAoB;AAClC,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,+BAA+B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,+BAA+B;;AAE/C;AACA;;AAEA;AACA;AACA;AACA,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,iCAAiC;AACvE;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;;;;AAKD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA,gCAAgC,gDAAgD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,yCAAyC;AACzC,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,oEAAoE;AAC/G;AACA;AACA,2CAA2C,qEAAqE;AAChH;AACA;AACA,2CAA2C,qEAAqE;AAChH;AACA;AACA,2CAA2C,oEAAoE;AAC/G;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,oEAAoE;AAC/G;AACA;AACA,2CAA2C,qEAAqE;AAChH;AACA;AACA;AACA;AACA,2CAA2C,oEAAoE;AAC/G;AACA;AACA;AACA,2CAA2C,qEAAqE;AAChH;AACA;AACA,2CAA2C,qEAAqE;AAChH;AACA;AACA,2CAA2C,oEAAoE;AAC/G;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sDAAsD,yBAAyB;AAC/E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gBAAgB,OAAO;AACvB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,gBAAgB,OAAO;AACvB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,OAAO;AACvB;AACA,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wFAAwF,4BAA4B;AACtI,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,QAAQ;AACvB;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,OAAO;AAClB,WAAW,yBAAyB;AACpC;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B,oFAAoF;AACpF;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,uBAAuB,wBAAwB;AAC/C;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,iDAAiD;;AAEzE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB,kBAAkB,OAAO;AACzB;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,uCAAuC;AACtD,mDAAmD;AACnD;AACA,sCAAsC,yBAAyB;AAC/D;AACA;AACA,eAAe,wBAAwB;AACvC;AACA,eAAe,qCAAqC;AACpD,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;;AAEA;AACA,8CAA8C,4BAA4B;AAC1E;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC,mBAAmB,oBAAoB;AACvC,mBAAmB,QAAQ;AAC3B;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,8CAA8C;AACjE;AACA;AACA,mBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iDAAiD,2BAA2B;AAC5E,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC,WAAW,uBAAuB;AAClC,WAAW,QAAQ;AACnB,WAAW,OAAO,mDAAmD,4BAA4B;AACjG;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,wEAAwE;AACxE;;AAEA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;;AAEA;AACA;AACA;AACA,sBAAsB,kCAAkC;AACxD,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,aAAa,UAAU,uDAAuD,OAAO;AACrF,yBAAyB,qCAAqC;AAC9D,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,+BAA+B,kCAAkC,eAAe,UAAU;AAC1F,gBAAgB,OAAO;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA,8BAA8B,qCAAqC;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,SAAS;AACxB,uBAAuB,wBAAwB;AAC/C,eAAe,QAAQ;AACvB;AACA,eAAe,MAAM;AACrB,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,eAAe,OAAO;AACtB,oCAAoC;AACpC,QAAQ,4BAA4B;AACpC,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,+BAA+B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,oCAAoC;AACpC,QAAQ,4BAA4B;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO,6CAA6C,4BAA4B;AAC3F,WAAW,OAAO,qDAAqD,4BAA4B;AACnG,WAAW,OAAO,iDAAiD,4BAA4B;AAC/F,WAAW,OAAO,yDAAyD,4BAA4B;AACvG,WAAW,OAAO,yDAAyD,4BAA4B;AACvG,WAAW,OAAO,qDAAqD,4BAA4B;AACnG,WAAW,QAAQ,mDAAmD,4BAA4B;AAClG,WAAW,QAAQ,+CAA+C,4BAA4B;AAC9F,WAAW,OAAO,uDAAuD,4BAA4B;AACrG,WAAW,OAAO,+CAA+C,4BAA4B;AAC7F,WAAW,OAAO,+CAA+C,4BAA4B;AAC7F,WAAW,OAAO,qCAAqC,4BAA4B;AACnF,WAAW,QAAQ,qDAAqD,4BAA4B;AACpG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,uBAAuB;;AAE5B;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,8EAA8E;AAC9E;AACA,KAAK;;AAEL;AACA,eAAe,mBAAmB;AAClC;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,8CAA8C;AACnE;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,oBAAoB;AAC9C,0BAA0B,mBAAmB;AAC7C,0BAA0B,mBAAmB;AAC7C;AACA,0BAA0B,OAAO;AACjC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC;AACnC;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,QAAQ,2CAA2C;AACnD;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,6DAA6D,oCAAoC;AACjG;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,QAAQ;AAClC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,0BAA0B,iBAAiB;AAC3C,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,QAAQ,uCAAuC;AAC/C;AACA,eAAe,QAAQ,8CAA8C;AACrE,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,sEAAsE,8CAA8C;AACpH;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,QAAQ;AAClC;AACA,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,sBAAsB;AACtB;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAsD;AAClE;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uCAAuC;AACnD;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,QAAQ,8CAA8C;AACrE,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,wDAAwD,mCAAmC,MAAM,mCAAmC;AACpI;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,oBAAoB;AAC9C,0BAA0B,QAAQ;AAClC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;;AAEA;AACA;AACA,iEAAiE,oCAAoC,MAAM,oCAAoC;AAC/I;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,OAAO;AACjC,0BAA0B,oBAAoB;AAC9C,0BAA0B,QAAQ;AAClC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,OAAO;AAC7B,sBAAsB,QAAQ;AAC9B;AACA,0CAA0C,mBAAmB;AAC7D;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,oCAAoC;AAC3F;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,oBAAoB;AAC9C,0BAA0B,QAAQ;AAClC,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,eAAe,6BAA6B;AAC5C;AACA,eAAe,OAAO;AACtB,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,eAAe,+BAA+B;AAC9C;AACA,eAAe,OAAO;AACtB,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,eAAe,8BAA8B;AAC7C;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB,qBAAqB;AACzC,oBAAoB,OAAO;AAC3B,oBAAoB,QAAQ;AAC5B;AACA,sCAAsC,iBAAiB;AACvD;AACA;;AAEA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA,+DAA+D;AAC/D,UAAU,gCAAgC,KAAK,yCAAyC;AACxF;AACA;AACA;AACA,iDAAiD,2BAA2B;AAC5E;AACA,WAAW,OAAO;AAClB,WAAW,yBAAyB;AACpC,WAAW,qBAAqB;AAChC,WAAW,wBAAwB;AACnC,WAAW,qBAAqB;AAChC,WAAW,0BAA0B;AACrC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B;AACA,WAAW,wBAAwB;AACnC;AACA,WAAW,mBAAmB;AAC9B;AACA;AACA,WAAW,OAAO,kCAAkC,4BAA4B;AAChF,WAAW,QAAQ,gCAAgC,4BAA4B;AAC/E,WAAW,OAAO,oCAAoC,4BAA4B;AAClF,WAAW,QAAQ,iCAAiC,4BAA4B;AAChF,WAAW,QAAQ,+BAA+B,4BAA4B;AAC9E,WAAW,QAAQ,kCAAkC,4BAA4B;AACjF,WAAW,OAAO,4BAA4B,4BAA4B;AAC1E,WAAW,QAAQ,8BAA8B,4BAA4B;AAC7E,WAAW,OAAO,gCAAgC,4BAA4B;AAC9E,WAAW,OAAO,yCAAyC,4BAA4B;AACvF,WAAW,QAAQ,4BAA4B,4BAA4B;AAC3E,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO,8EAA8E,4BAA4B,4BAA4B;AACxJ,WAAW,QAAQ,4BAA4B,4BAA4B;AAC3E,WAAW,6CAA6C,uCAAuC,4BAA4B;AAC3H,WAAW,eAAe,oCAAoC,4BAA4B;AAC1F,WAAW,QAAQ,sCAAsC,4BAA4B;AACrF,WAAW,QAAQ;AACnB;AACA,oCAAoC,4BAA4B;AAChE,WAAW,OAAO,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA,YAAY,+BAA+B;AAC3C,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,0BAA0B;AAC1B,0BAA0B,oDAAoD;AAC9E,2BAA2B,mDAAmD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uEAAuE,UAAU;AACjF;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB,qBAAqB;AACzC,oBAAoB,mBAAmB;AACvC,oBAAoB,yBAAyB;AAC7C,oBAAoB,mBAAmB;AACvC,oBAAoB,mBAAmB;AACvC,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,QAAQ;AAC9B,sBAAsB,yBAAyB;AAC/C,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,QAAQ,sCAAsC;AAC9C;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,mEAAmE;AACnE;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,0EAA0E,0BAA0B;AACpG,eAAe,2BAA2B;AAC1C,eAAe,OAAO;AACtB,eAAe,QAAQ,yDAAyD;AAChF,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,0EAA0E,0BAA0B;AACpG,eAAe,2BAA2B;AAC1C,eAAe,OAAO;AACtB,eAAe,QAAQ,yDAAyD;AAChF,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,2EAA2E,yBAAyB;AACpG,eAAe,0BAA0B;AACzC,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ,yDAAyD;AAChF,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,2EAA2E,yBAAyB;AACpG,eAAe,0BAA0B;AACzC,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ,yDAAyD;AAChF,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,wBAAwB;AACvC;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,yBAAyB;AAC/C;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,OAAO;AAC7B,sBAAsB,yBAAyB;AAC/C;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,OAAO;AAC7B,sBAAsB,yBAAyB;AAC/C;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,yBAAyB;AAC/C;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,sBAAsB;AAC5D;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,yBAAyB;AAC/C,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,mBAAmB;AACzC,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B,wBAAwB;AACvD,mCAAmC,wBAAwB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,mBAAmB;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,yBAAyB;AAC/C,sBAAsB,mBAAmB;AACzC,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,yBAAyB;AACpC,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,eAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,mBAAmB;AACzC,sBAAsB,yBAAyB;AAC/C,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,mBAAmB;AAC9B,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kBAAkB,MAAM;AACxB,kBAAkB,yBAAyB;AAC3C,kBAAkB,mBAAmB;AACrC,kBAAkB,eAAe;AACjC,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,QAAQ;AACnB,WAAW,uBAAuB;AAClC,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,yBAAyB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;;AAEA;AACA,wBAAwB;AACxB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,mBAAmB;AAC9B,aAAa,mBAAmB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,qBAAqB;AAC/C,0BAA0B,yBAAyB;AACnD,0BAA0B,mBAAmB;AAC7C,0BAA0B,QAAQ;AAClC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,qBAAqB;AAChC;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD,2BAA2B;AAC9E;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,IAAI,4BAA4B;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,yBAAyB;AACxC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAAuD,QAAQ;AAC/D;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,yBAAyB;AAC/C,sBAAsB,mBAAmB;AACzC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,qBAAqB;AAC3C,sBAAsB,yBAAyB;AAC/C,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,yBAAyB;AACxC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,yBAAyB;AACxC,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,oBAAoB;AAC1C,sBAAsB,yBAAyB;AAC/C;AACA,sBAAsB,OAAO;AAC7B,sBAAsB,OAAO;AAC7B,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,OAAO,6CAA6C,4BAA4B;AAC/F,eAAe,OAAO,yCAAyC,4BAA4B;AAC3F,eAAe,OAAO,+CAA+C,4BAA4B;AACjG,eAAe,OAAO,iDAAiD,4BAA4B;AACnG,eAAe,OAAO,qDAAqD,4BAA4B;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B,oBAAoB;AAC9C,0BAA0B,QAAQ;AAClC;AACA,gDAAgD;AAChD;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,sBAAsB,oBAAoB;AAC1C,sBAAsB,yBAAyB;AAC/C,sBAAsB,QAAQ;AAC9B;AACA,yCAAyC,aAAa;AACtD;AACA,CAAC;;AAED,CAAC;;AAED,yC;CC5jsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,CAAC,uCAAuC;;AAExC;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAqC;;AAErC;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;;AAEA,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C,OAAO;;AAEP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA,6DAA6D;;AAE7D;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6BAA6B;AAC7B,KAAK;AACL;;AAEA;AACA,+BAA+B;;AAE/B;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;;AAGL;;AAEA,2CAA2C,WAAW;AACtD;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B,+BAA+B;;AAE/B,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B;;AAE3B;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,uCAAuC,aAAa;;AAEpD;AACA,qCAAqC,aAAa;AAClD;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,oCAAoC,sBAAsB;;AAE1D;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,2CAA2C,SAAS;AACpD;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,gCAAgC,eAAe;AAC/C,6CAA6C;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uCAAuC,eAAe,kBAAkB,oDAAoD;;AAE5H;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B,yBAAyB;;AAEzB,sBAAsB;;AAEtB,4BAA4B;;AAE5B,8BAA8B;;AAE9B,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT,oDAAoD;;AAEpD;AACA;AACA;AACA,SAAS;AACT;AACA;;;AAGA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA,gCAAgC,8BAA8B,6BAA6B;AAC3F;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;;AAE3C;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,0CAA0C,kBAAkB,4DAA4D;AACxH;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;;AAEA,8BAA8B,kBAAkB;AAChD,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,2CAA2C,SAAS;AACpD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gGAAgG;;AAEhG;AACA;AACA;AACA;AACA,SAAS,EAAE;;AAEX;AACA;AACA;AACA;AACA,SAAS,EAAE;;AAEX;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,uCAAuC,eAAe,oBAAoB,oDAAoD;;AAE9H;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,0EAA0E,sBAAsB;;AAEhG;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,uIAAuI;;AAEvI;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK,EAAE;;AAEP,sCAAsC,OAAO;AAC7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,0CAA0C,SAAS;AACnD;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,2CAA2C;AAC3C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B,qBAAqB;AACnD;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,0CAA0C,kBAAkB,0DAA0D;AACtH;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,gCAAgC,8BAA8B,oBAAoB,oDAAoD;;AAEtI;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,GAAG;;AAEH,uCAAuC;AACvC;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC;;AAEzC;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,gCAAgC,eAAe,oDAAoD;;AAEnG;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,gCAAgC,KAAK;AACrC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;;AAEP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,2CAA2C;AAC3C;;AAEA,wIAAwI;;AAExI;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA,kCAAkC,KAAK;AACvC;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;;AAGL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,gCAAgC,eAAe,6BAA6B,oDAAoD;AAChI;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,cAAc;;AAE9D,CAAC;AACD;;;ACv6IA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ,sCAAsC,sBAAsB;AAC5D;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,wCAAwC,oBAAoB;AAC5D;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;;AAEN;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF,YAAY;;AAEZ;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,0BAA0B,6BAA6B;AACvD;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,qBAAqB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,uCAAuC,mBAAmB;;AAE1D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mCAAmC,mEAAmE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,EAAE;;AAEF;AACA,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,yEAAyE;AACzE,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE;AACF,uBAAuB,KAAK;AAC5B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,sDAAsD;AACtD;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED,yDAAyD;AACzD;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,0BAA0B,YAAY,uCAAuC;AAC7E;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,wBAAwB;AACxB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA,CAAC;;;AAGD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,+EAA+E,EAAE;AACjF,CAAC;;AAED;;AAEA;AACA;AACA,0GAA0G,IAAI,wCAAwC,EAAE;AACxJ;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,8cAA8c;AAC9c;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,4BAA4B,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,gCAAgC,EAAE,MAAM,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG;AACxE;AACA;AACA;AACA,oBAAoB,EAAE;AACtB;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,EAAE;;AAEF,CAAC","file":"scripts.js","sourcesContent":["/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */\n!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return t(e)}:t(e)}(\"undefined\"!=typeof window?window:this,function(C,e){\"use strict\";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return\"function\"==typeof e&&\"number\"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement(\"script\");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[o.call(e)]||\"object\":typeof e}var f=\"3.5.1\",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&\"length\"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for(\"boolean\"==typeof a&&(l=a,a=arguments[s]||{},s++),\"object\"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],\"__proto__\"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:\"jQuery\"+(f+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==o.call(e))&&(!(t=r(e))||\"function\"==typeof(n=v.call(t,\"constructor\")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,\"string\"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),\"function\"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){n[\"[object \"+t+\"]\"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S=\"sizzle\"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",M=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",I=\"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",W=\"\\\\[\"+M+\"*(\"+I+\")(?:\"+M+\"*([*^$|!~]?=)\"+M+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+I+\"))|)\"+M+\"*\\\\]\",F=\":(\"+I+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+W+\")*)|.*)\\\\)|)\",B=new RegExp(M+\"+\",\"g\"),$=new RegExp(\"^\"+M+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+M+\"+$\",\"g\"),_=new RegExp(\"^\"+M+\"*,\"+M+\"*\"),z=new RegExp(\"^\"+M+\"*([>+~]|\"+M+\")\"+M+\"*\"),U=new RegExp(M+\"|>\"),X=new RegExp(F),V=new RegExp(\"^\"+I+\"$\"),G={ID:new RegExp(\"^#(\"+I+\")\"),CLASS:new RegExp(\"^\\\\.(\"+I+\")\"),TAG:new RegExp(\"^(\"+I+\"|[*])\"),ATTR:new RegExp(\"^\"+W),PSEUDO:new RegExp(\"^\"+F),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+M+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+M+\"*(?:([+-]|)\"+M+\"*(\\\\d+)|))\"+M+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+R+\")$\",\"i\"),needsContext:new RegExp(\"^\"+M+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+M+\"*((?:-\\\\d)?\\\\d*)\"+M+\"*\\\\)|)(?=[^-]|$)\",\"i\")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\\d$/i,K=/^[^{]+\\{\\s*\\[native \\w/,Z=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,ee=/[+~]/,te=new RegExp(\"\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\",\"g\"),ne=function(e,t){var n=\"0x\"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,ie=function(e,t){return t?\"\\0\"===e?\"\\ufffd\":e.slice(0,-1)+\"\\\\\"+e.charCodeAt(e.length-1).toString(16)+\" \":\"\\\\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&\"fieldset\"===e.nodeName.toLowerCase()},{dir:\"parentNode\",next:\"legend\"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],\"string\"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+\" \"]&&(!v||!v.test(t))&&(1!==p||\"object\"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute(\"id\"))?s=s.replace(re,ie):e.setAttribute(\"id\",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?\"#\"+s:\":scope\")+\" \"+xe(l[o]);c=l.join(\",\")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute(\"id\")}}}return g(t.replace($,\"$1\"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+\" \")>b.cacheLength&&delete e[r.shift()],e[t+\" \"]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement(\"fieldset\");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split(\"|\"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return\"input\"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return(\"input\"===t||\"button\"===t)&&e.type===n}}function ge(t){return function(e){return\"form\"in e?e.parentNode&&!1===e.disabled?\"label\"in e?\"label\"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:\"label\"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&\"undefined\"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||\"HTML\")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener(\"unload\",oe,!1):n.attachEvent&&n.attachEvent(\"onunload\",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement(\"div\")),\"undefined\"!=typeof e.querySelectorAll&&!e.querySelectorAll(\":scope fieldset div\").length}),d.attributes=ce(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute(\"id\")===t}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t=\"undefined\"!=typeof e.getAttributeNode&&e.getAttributeNode(\"id\");return t&&t.value===n}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return\"undefined\"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if(\"*\"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(\"undefined\"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML=\"<a id='\"+S+\"'></a><select id='\"+S+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",e.querySelectorAll(\"[msallowcapture^='']\").length&&v.push(\"[*^$]=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||v.push(\"\\\\[\"+M+\"*(?:value|\"+R+\")\"),e.querySelectorAll(\"[id~=\"+S+\"-]\").length||v.push(\"~=\"),(t=C.createElement(\"input\")).setAttribute(\"name\",\"\"),e.appendChild(t),e.querySelectorAll(\"[name='']\").length||v.push(\"\\\\[\"+M+\"*name\"+M+\"*=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\":checked\").length||v.push(\":checked\"),e.querySelectorAll(\"a#\"+S+\"+*\").length||v.push(\".#.+[+~]\"),e.querySelectorAll(\"\\\\\\f\"),v.push(\"[\\\\r\\\\n\\\\f]\")}),ce(function(e){e.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var t=C.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"name\",\"D\"),e.querySelectorAll(\"[name=d]\").length&&v.push(\"name\"+M+\"*[*^$|!~]?=\"),2!==e.querySelectorAll(\":enabled\").length&&v.push(\":enabled\",\":disabled\"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(\":disabled\").length&&v.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),v.push(\",.*:\")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,\"*\"),c.call(e,\"[s!='']:x\"),s.push(\"!=\",F)}),v=v.length&&new RegExp(v.join(\"|\")),s=s.length&&new RegExp(s.join(\"|\")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+\" \"]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+\"\").replace(re,ie)},se.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n=\"\",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||\"\").replace(te,ne),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||\"\":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(\")\",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+\" \"];return t||(t=new RegExp(\"(^|\"+M+\")\"+e+\"(\"+M+\"|$)\"))&&m(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||\"undefined\"!=typeof e.getAttribute&&e.getAttribute(\"class\")||\"\")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?\"!=\"===r:!r||(t+=\"\",\"=\"===r?t===i:\"!=\"===r?t!==i:\"^=\"===r?i&&0===t.indexOf(i):\"*=\"===r?i&&-1<t.indexOf(i):\"$=\"===r?i&&t.slice(-i.length)===i:\"~=\"===r?-1<(\" \"+t.replace(B,\" \")+\" \").indexOf(i):\"|=\"===r&&(t===i||t.slice(0,i.length+1)===i+\"-\"))}},CHILD:function(h,e,t,g,v){var y=\"nth\"!==h.slice(0,3),m=\"last\"!==h.slice(-4),x=\"of-type\"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?\"nextSibling\":\"previousSibling\",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l=\"only\"===h&&!u&&\"nextSibling\"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error(\"unsupported pseudo: \"+e);return a[S]?a(o):1<a.length?(t=[e,e,\"\",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,\"$1\"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||\"\")||se.error(\"unsupported lang: \"+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute(\"xml:lang\")||e.getAttribute(\"lang\"))return(t=t.toLowerCase())===n||0===t.indexOf(n+\"-\")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||\"text\"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r=\"\";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&\"parentNode\"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||\"*\",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[\" \"],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:\" \"===e[s-2].type?\"*\":\"\"})).replace($,\"$1\"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+\" \"];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($,\" \")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+\" \"];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l=\"0\",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG(\"*\",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l=\"function\"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&\"ID\"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split(\"\").sort(D).join(\"\")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement(\"fieldset\"))}),ce(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===e.firstChild.getAttribute(\"href\")})||fe(\"type|href|height|width\",function(e,t,n){if(!n)return e.getAttribute(t,\"type\"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML=\"<input/>\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||fe(\"value\",function(e,t,n){if(!n&&\"input\"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute(\"disabled\")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[\":\"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):\"string\"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if(\"string\"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,\"string\"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,\"string\"==typeof e){if(!(r=\"<\"===e[0]&&\">\"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a=\"string\"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?\"string\"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,\"parentNode\")},parentsUntil:function(e,t,n){return h(e,\"parentNode\",n)},next:function(e){return O(e,\"nextSibling\")},prev:function(e){return O(e,\"previousSibling\")},nextAll:function(e){return h(e,\"nextSibling\")},prevAll:function(e){return h(e,\"previousSibling\")},nextUntil:function(e,t,n){return h(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return h(e,\"previousSibling\",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,\"template\")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return\"Until\"!==r.slice(-5)&&(t=e),t&&\"string\"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\\x20\\t\\r\\n\\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r=\"string\"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:\"\")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&\"string\"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t=\"\",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=\"\"),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[[\"notify\",\"progress\",S.Callbacks(\"memory\"),S.Callbacks(\"memory\"),2],[\"resolve\",\"done\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),1,\"rejected\"]],i=\"pending\",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},\"catch\":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+\"With\"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError(\"Thenable self-resolution\");t=e&&(\"object\"==typeof e||\"function\"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+\"With\"](this===s?void 0:this,arguments),this},s[t[0]+\"With\"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),\"pending\"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn(\"jQuery.Deferred exception: \"+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener(\"DOMContentLoaded\",B),C.removeEventListener(\"load\",B),S.ready()}S.fn.ready=function(e){return F.then(e)[\"catch\"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,\"complete\"===E.readyState||\"loading\"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener(\"DOMContentLoaded\",B),C.addEventListener(\"load\",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if(\"object\"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,\"ms-\").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if(\"string\"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&\"string\"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r=\"data-\"+t.replace(K,\"-$&\").toLowerCase(),\"string\"==typeof(n=e.getAttribute(r))){try{n=\"true\"===(i=n)||\"false\"!==i&&(\"null\"===i?null:i===+i+\"\"?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,\"hasDataAttrs\"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf(\"data-\")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,\"hasDataAttrs\",!0)}return i}return\"object\"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||\"fx\")+\"queue\",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||\"fx\";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);\"inprogress\"===i&&(i=n.shift(),r--),i&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks(\"once memory\").add(function(){Y.remove(e,[t+\"queue\",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return\"string\"!=typeof t&&(n=t,t=\"fx\",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),\"fx\"===t&&\"inprogress\"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};\"string\"!=typeof e&&(t=e,e=void 0),e=e||\"fx\";while(a--)(n=Y.get(o[a],e+\"queueHooks\"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,te=new RegExp(\"^(?:([+-])=|)(\"+ee+\")([a-z%]*)$\",\"i\"),ne=[\"Top\",\"Right\",\"Bottom\",\"Left\"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return\"none\"===(e=t||e).style.display||\"\"===e.style.display&&ie(e)&&\"none\"===S.css(e,\"display\")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,\"\")},u=s(),l=n&&n[3]||(S.cssNumber[t]?\"\":\"px\"),c=e.nodeType&&(S.cssNumber[t]||\"px\"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?(\"none\"===n&&(l[c]=Y.get(r,\"display\")||null,l[c]||(r.style.display=\"\")),\"\"===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,\"display\"),o.parentNode.removeChild(o),\"none\"===u&&(u=\"block\"),ue[s]=u)))):\"none\"!==n&&(l[c]=\"none\",Y.set(r,\"display\",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i,he=/^$|^module$|\\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement(\"div\")),(fe=E.createElement(\"input\")).setAttribute(\"type\",\"radio\"),fe.setAttribute(\"checked\",\"checked\"),fe.setAttribute(\"name\",\"t\"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML=\"<textarea>x</textarea>\",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML=\"<option></option>\",y.option=!!ce.lastChild;var ge={thead:[1,\"<table>\",\"</table>\"],col:[2,\"<table><colgroup>\",\"</colgroup></table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:[0,\"\",\"\"]};function ve(e,t){var n;return n=\"undefined\"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||\"*\"):\"undefined\"!=typeof e.querySelectorAll?e.querySelectorAll(t||\"*\"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],\"globalEval\",!t||Y.get(t[n],\"globalEval\"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,\"<select multiple='multiple'>\",\"</select>\"]);var me=/<|&#?\\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if(\"object\"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement(\"div\")),s=(de.exec(o)||[\"\",\"\"])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=\"\"}else p.push(t.createTextNode(o));f.textContent=\"\",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),\"script\"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||\"\")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==(\"focus\"===t)}function ke(e,t,n,r,i,o){var a,s;if(\"object\"==typeof t){for(s in\"string\"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&(\"string\"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return\"undefined\"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||\"\").match(P)||[\"\"]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(\".\")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||\"\").match(P)||[\"\"]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&(\"**\"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,\"handle events\")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,\"events\")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!(\"click\"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(\"click\"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+\" \"]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Y.get(t,\"click\")||A(t,\"a\")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,\"char\":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+\".\"+r.namespace:r.origType,r.selector,r.handler),this;if(\"object\"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&\"function\"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\\s*(?:[^=]|=\\s*.checked.)/i,je=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;function qe(e,t){return A(e,\"table\")&&A(11!==t.nodeType?t:t.firstChild,\"tr\")&&S(e).children(\"tbody\")[0]||e}function Le(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function He(e){return\"true/\"===(e.type||\"\").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute(\"type\"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,\"handle events\"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&\"string\"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,\"script\"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,\"script\"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||\"\")&&!Y.access(u,\"globalEval\")&&S.contains(l,u)&&(u.src&&\"module\"!==(u.type||\"\").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute(\"nonce\")},l):b(u.textContent.replace(je,\"\"),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,\"script\")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,\"input\"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:\"input\"!==l&&\"textarea\"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,\"script\")).length&&ye(a,!f&&ve(e,\"script\")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if(\"string\"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp(\"^(\"+ee+\")(?!px)[a-z%]+$\",\"i\"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join(\"|\"),\"i\");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(\"\"!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+\"\":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText=\"position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0\",l.style.cssText=\"position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%\",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n=\"1%\"!==e.top,s=12===t(e.marginLeft),l.style.right=\"60%\",o=36===t(e.right),r=36===t(e.width),l.style.position=\"absolute\",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement(\"div\"),l=E.createElement(\"div\");l.style&&(l.style.backgroundClip=\"content-box\",l.cloneNode(!0).style.backgroundClip=\"\",y.clearCloneStyle=\"content-box\"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement(\"table\"),t=E.createElement(\"tr\"),n=E.createElement(\"div\"),e.style.cssText=\"position:absolute;left:-11111px\",t.style.height=\"1px\",n.style.height=\"9px\",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=[\"Webkit\",\"Moz\",\"ms\"],ze=E.createElement(\"div\").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:\"absolute\",visibility:\"hidden\",display:\"block\"},Qe={letterSpacing:\"0\",fontWeight:\"400\"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||\"px\"):t}function Ke(e,t,n,r,i,o){var a=\"width\"===t?1:0,s=0,u=0;if(n===(r?\"border\":\"content\"))return 0;for(;a<4;a+=2)\"margin\"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?(\"content\"===n&&(u-=S.css(e,\"padding\"+ne[a],!0,i)),\"margin\"!==n&&(u-=S.css(e,\"border\"+ne[a]+\"Width\",!0,i))):(u+=S.css(e,\"padding\"+ne[a],!0,i),\"padding\"!==n?u+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i):s+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e[\"offset\"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,r),o=i,a=Be(e,t,r),s=\"offset\"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a=\"auto\"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,\"tr\")||\"auto\"===a||!parseFloat(a)&&\"inline\"===S.css(e,\"display\",!1,r))&&e.getClientRects().length&&(i=\"border-box\"===S.css(e,\"boxSizing\",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?\"border\":\"content\"),o,r,a)+\"px\"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&\"get\"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];\"string\"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o=\"number\"),null!=n&&n==n&&(\"number\"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?\"\":\"px\")),y.clearCloneStyle||\"\"!==n||0!==t.indexOf(\"background\")||(l[t]=\"inherit\"),a&&\"set\"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&\"get\"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),\"normal\"===i&&t in Qe&&(i=Qe[t]),\"\"===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each([\"height\",\"width\"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,\"display\"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&\"absolute\"===i.position,a=(o||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e[\"offset\"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,\"border\",!1,i)-.5)),s&&(r=te.exec(t))&&\"px\"!==(r[3]||\"px\")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,\"marginLeft\"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+\"px\"}),S.each({margin:\"\",padding:\"\",border:\"Width\"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r=\"string\"==typeof e?e.split(\" \"):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},\"margin\"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?\"\":\"px\")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i[\"margin\"+(n=ne[r])]=i[\"padding\"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners[\"*\"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&\"expand\"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=[\"*\"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f=\"width\"in t||\"height\"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,\"fxshow\");for(r in n.queue||(null==(a=S._queueHooks(e,\"fx\")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,\"fx\").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||\"toggle\"===i,i===(g?\"hide\":\"show\")){if(\"show\"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,\"display\")),\"none\"===(c=S.css(e,\"display\"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,\"display\"),le([e]))),(\"inline\"===c||\"inline-block\"===c&&null!=l)&&\"none\"===S.css(e,\"float\")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l=\"none\"===c?\"\":c)),h.display=\"inline-block\")),n.overflow&&(h.overflow=\"hidden\",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?\"hidden\"in v&&(g=v.hidden):v=Y.access(e,\"fxshow\",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,\"fxshow\"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&\"object\"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:\"number\"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue=\"fx\"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css(\"opacity\",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,\"finish\"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return\"string\"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||\"fx\",[]),this.each(function(){var e=!0,t=null!=i&&i+\"queueHooks\",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||\"fx\"),this.each(function(){var e,t=Y.get(this),n=t[a+\"queue\"],r=t[a+\"queueHooks\"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each([\"toggle\",\"show\",\"hide\"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||\"boolean\"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt(\"show\"),slideUp:lt(\"hide\"),slideToggle:lt(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||\"fx\",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement(\"input\"),it=E.createElement(\"select\").appendChild(E.createElement(\"option\")),rt.type=\"checkbox\",y.checkOn=\"\"!==rt.value,y.optSelected=it.selected,(rt=E.createElement(\"input\")).value=\"t\",rt.type=\"radio\",y.radioValue=\"t\"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return\"undefined\"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+\"\"),n):i&&\"get\"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&\"radio\"===t&&A(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(\" \")}function yt(e){return e.getAttribute&&e.getAttribute(\"class\")||\"\"}function mt(e){return Array.isArray(e)?e:\"string\"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&\"get\"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,\"tabindex\");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{\"for\":\"htmlFor\",\"class\":\"className\"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])r.indexOf(\" \"+o+\" \")<0&&(r+=o+\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])while(-1<r.indexOf(\" \"+o+\" \"))r=r.replace(\" \"+o+\" \",\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},toggleClass:function(i,t){var o=typeof i,a=\"string\"===o||Array.isArray(i);return\"boolean\"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&\"boolean\"!==o||((e=yt(this))&&Y.set(this,\"__className__\",e),this.setAttribute&&this.setAttribute(\"class\",e||!1===i?\"\":Y.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,r=0;t=\" \"+e+\" \";while(n=this[r++])if(1===n.nodeType&&-1<(\" \"+vt(yt(n))+\" \").indexOf(t))return!0;return!1}});var xt=/\\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t=\"\":\"number\"==typeof t?t+=\"\":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?\"\":e+\"\"})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&\"set\"in r&&void 0!==r.set(this,t,\"value\")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&\"get\"in r&&void 0!==(e=r.get(t,\"value\"))?e:\"string\"==typeof(e=t.value)?e.replace(xt,\"\"):null==e?\"\":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,\"value\");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a=\"select-one\"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,\"optgroup\"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each([\"radio\",\"checkbox\"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})}),y.focusin=\"onfocusin\"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,\"type\")?e.type:e,h=v.call(e,\"namespace\")?e.namespace.split(\".\"):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(\".\")&&(d=(h=d.split(\".\")).shift(),h.sort()),u=d.indexOf(\":\")<0&&\"on\"+d,(e=e[S.expando]?e:new S.Event(d,\"object\"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join(\".\"),e.rnamespace=e.namespace?new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,\"events\")||Object.create(null))[e.type]&&Y.get(o,\"handle\"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:\"focusin\",blur:\"focusout\"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\\?/;S.parseXML=function(e){var t;if(!e||\"string\"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,\"text/xml\")}catch(e){t=void 0}return t&&!t.getElementsByTagName(\"parsererror\").length||S.error(\"Invalid XML: \"+e),t};var St=/\\[\\]$/,kt=/\\r?\\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+\"[\"+(\"object\"==typeof t&&null!=t?e:\"\")+\"]\",t,r,i)});else if(r||\"object\"!==w(e))i(n,e);else for(t in e)Dt(n+\"[\"+t+\"]\",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(null==e)return\"\";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join(\"&\")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,\"elements\");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(\":disabled\")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,\"\\r\\n\")}}):{name:t.name,value:n.replace(kt,\"\\r\\n\")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\\/\\//,Rt={},Mt={},It=\"*/\".concat(\"*\"),Wt=E.createElement(\"a\");function Ft(o){return function(e,t){\"string\"!=typeof e&&(t=e,e=\"*\");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])\"+\"===n[0]?(n=n.slice(1)||\"*\",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return\"string\"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s[\"*\"]&&l(\"*\")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":It,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":JSON.parse,\"text xml\":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){\"object\"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks(\"once memory\"),w=v.statusCode||{},a={},s={},u=\"canceled\",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+\" \"]=(n[t[1].toLowerCase()+\" \"]||[]).concat(t[2])}t=n[e.toLowerCase()+\" \"]}return null==t?null:t.join(\", \")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+\"\").replace(Pt,Tt.protocol+\"//\"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||\"*\").toLowerCase().match(P)||[\"\"],null==v.crossDomain){r=E.createElement(\"a\");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+\"//\"+Wt.host!=r.protocol+\"//\"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&\"string\"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger(\"ajaxStart\"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,\"\"),v.hasContent?v.data&&v.processData&&0===(v.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(v.data=v.data.replace(jt,\"+\")):(o=v.url.slice(f.length),v.data&&(v.processData||\"string\"==typeof v.data)&&(f+=(Et.test(f)?\"&\":\"?\")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,\"$1\"),o=(Et.test(f)?\"&\":\"?\")+\"_=\"+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader(\"If-Modified-Since\",S.lastModified[f]),S.etag[f]&&T.setRequestHeader(\"If-None-Match\",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader(\"Content-Type\",v.contentType),T.setRequestHeader(\"Accept\",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+(\"*\"!==v.dataTypes[0]?\", \"+It+\"; q=0.01\":\"\"):v.accepts[\"*\"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u=\"abort\",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger(\"ajaxSend\",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort(\"timeout\")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,\"No Transport\");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||\"\",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while(\"*\"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+\" \"+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray(\"script\",v.dataTypes)&&(v.converters[\"text script\"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if(\"*\"===o)o=u;else if(\"*\"!==u&&u!==o){if(!(a=l[u+\" \"+o]||l[\"* \"+o]))for(i in l)if((s=i.split(\" \"))[1]===o&&(a=l[u+\" \"+s[0]]||l[\"* \"+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e[\"throws\"])t=a(t);else try{t=a(t)}catch(e){return{state:\"parsererror\",error:a?e:\"No conversion from \"+u+\" to \"+o}}}return{state:\"success\",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader(\"Last-Modified\"))&&(S.lastModified[f]=u),(u=T.getResponseHeader(\"etag\"))&&(S.etag[f]=u)),204===e||\"HEAD\"===v.type?l=\"nocontent\":304===e?l=\"notmodified\":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l=\"error\",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+\"\",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?\"ajaxSuccess\":\"ajaxError\",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger(\"ajaxComplete\",[T,v]),--S.active||S.event.trigger(\"ajaxStop\")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,\"json\")},getScript:function(e,t){return S.get(e,void 0,t,\"script\")}}),S.each([\"get\",\"post\"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)\"content-type\"===t.toLowerCase()&&(e.contentType=e.headers[t]||\"\")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,converters:{\"text script\":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&\"withCredentials\"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e[\"X-Requested-With\"]||(e[\"X-Requested-With\"]=\"XMLHttpRequest\"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,\"abort\"===e?r.abort():\"error\"===e?\"number\"!=typeof r.status?t(0,\"error\"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,\"text\"!==(r.responseType||\"text\")||\"string\"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o(\"error\"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o(\"abort\");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),S.ajaxTransport(\"script\",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S(\"<script>\").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on(\"load error\",i=function(e){r.remove(),i=null,e&&t(\"error\"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\\?(?=&|$)|\\?\\?/;S.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=Xt.pop()||S.expando+\"_\"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter(\"json jsonp\",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?\"url\":\"string\"==typeof e.data&&0===(e.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Vt.test(e.data)&&\"data\");if(a||\"jsonp\"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,\"$1\"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?\"&\":\"?\")+e.jsonp+\"=\"+r),e.converters[\"script json\"]=function(){return o||S.error(r+\" was not called\"),o[0]},e.dataTypes[0]=\"json\",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),\"script\"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument(\"\").body).innerHTML=\"<form></form><form></form>\",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return\"string\"!=typeof e?[]:(\"boolean\"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument(\"\")).createElement(\"base\")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(\" \");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&\"object\"==typeof t&&(i=\"POST\"),0<a.length&&S.ajax({url:e,type:i||\"GET\",dataType:\"html\",data:t}).done(function(e){o=arguments,a.html(r?S(\"<div>\").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,\"position\"),c=S(e),f={};\"static\"===l&&(e.style.position=\"relative\"),s=c.offset(),o=S.css(e,\"top\"),u=S.css(e,\"left\"),(\"absolute\"===l||\"fixed\"===l)&&-1<(o+u).indexOf(\"auto\")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),\"using\"in t?t.using.call(e,f):(\"number\"==typeof f.top&&(f.top+=\"px\"),\"number\"==typeof f.left&&(f.left+=\"px\"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(\"fixed\"===S.css(r,\"position\"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&\"static\"===S.css(e,\"position\"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,\"borderTopWidth\",!0),i.left+=S.css(e,\"borderLeftWidth\",!0))}return{top:t.top-i.top-S.css(r,\"marginTop\",!0),left:t.left-i.left-S.css(r,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&\"static\"===S.css(e,\"position\"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(t,i){var o=\"pageYOffset\"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each([\"top\",\"left\"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+\"px\":t})}),S.each({Height:\"height\",Width:\"width\"},function(a,s){S.each({padding:\"inner\"+a,content:s,\"\":\"outer\"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||\"boolean\"!=typeof e),i=r||(!0===e||!0===t?\"margin\":\"border\");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf(\"outer\")?e[\"inner\"+a]:e.document.documentElement[\"client\"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body[\"scroll\"+a],r[\"scroll\"+a],e.body[\"offset\"+a],r[\"offset\"+a],r[\"client\"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each(\"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu\".split(\" \"),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if(\"string\"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return(\"number\"===t||\"string\"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?\"\":(e+\"\").replace(Gt,\"\")},\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},\"undefined\"==typeof e&&(C.jQuery=C.$=S),S});\n","/*\n Copyright (C) Federico Zivolo 2020\n Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).\n */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',n=e.nodeName;if('BODY'===n||'HTML'===n){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[o]}return e[o]}function f(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=l(t,'top'),i=l(t,'left'),r=o?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function m(e,t){var o='x'===t?'Left':'Top',n='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'])+parseFloat(e['border'+n+'Width'])}function h(e,t,o,n){return ee(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],r(10)?parseInt(o['offset'+e])+parseInt(n['margin'+('Height'===e?'Top':'Left')])+parseInt(n['margin'+('Height'===e?'Bottom':'Right')]):0)}function c(e){var t=e.body,o=e.documentElement,n=r(10)&&getComputedStyle(o);return{height:h('Height',t,o,n),width:h('Width',t,o,n)}}function g(e){return le({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};try{if(r(10)){o=e.getBoundingClientRect();var n=l(e,'top'),i=l(e,'left');o.top+=n,o.left+=i,o.bottom+=n,o.right+=i}else o=e.getBoundingClientRect()}catch(t){}var p={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},s='HTML'===e.nodeName?c(e.ownerDocument):{},d=s.width||e.clientWidth||p.width,a=s.height||e.clientHeight||p.height,f=e.offsetWidth-d,h=e.offsetHeight-a;if(f||h){var u=t(e);f-=m(u,'x'),h-=m(u,'y'),p.width-=f,p.height-=h}return g(p)}function b(e,o){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],p=r(10),s='HTML'===o.nodeName,d=u(e),a=u(o),l=n(e),m=t(o),h=parseFloat(m.borderTopWidth),c=parseFloat(m.borderLeftWidth);i&&s&&(a.top=ee(a.top,0),a.left=ee(a.left,0));var b=g({top:d.top-a.top-h,left:d.left-a.left-c,width:d.width,height:d.height});if(b.marginTop=0,b.marginLeft=0,!p&&s){var w=parseFloat(m.marginTop),y=parseFloat(m.marginLeft);b.top-=h-w,b.bottom-=h-w,b.left-=c-y,b.right-=c-y,b.marginTop=w,b.marginLeft=y}return(p&&!i?o.contains(l):o===l&&'BODY'!==l.nodeName)&&(b=f(b,o)),b}function w(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=e.ownerDocument.documentElement,n=b(e,o),i=ee(o.clientWidth,window.innerWidth||0),r=ee(o.clientHeight,window.innerHeight||0),p=t?0:l(o),s=t?0:l(o,'left'),d={top:p-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return g(d)}function y(e){var n=e.nodeName;if('BODY'===n||'HTML'===n)return!1;if('fixed'===t(e,'position'))return!0;var i=o(e);return!!i&&y(i)}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var o=e.parentElement;o&&'none'===t(o,'transform');)o=o.parentElement;return o||document.documentElement}function v(e,t,r,p){var s=4<arguments.length&&void 0!==arguments[4]&&arguments[4],d={top:0,left:0},l=s?E(e):a(e,i(t));if('viewport'===p)d=w(l,s);else{var f;'scrollParent'===p?(f=n(o(t)),'BODY'===f.nodeName&&(f=e.ownerDocument.documentElement)):'window'===p?f=e.ownerDocument.documentElement:f=p;var m=b(f,l,s);if('HTML'===f.nodeName&&!y(l)){var h=c(e.ownerDocument),g=h.height,u=h.width;d.top+=m.top-m.marginTop,d.bottom=g+m.top,d.left+=m.left-m.marginLeft,d.right=u+m.left}else d=m}r=r||0;var v='number'==typeof r;return d.left+=v?r:r.left||0,d.top+=v?r:r.top||0,d.right-=v?r:r.right||0,d.bottom-=v?r:r.bottom||0,d}function x(e){var t=e.width,o=e.height;return t*o}function O(e,t,o,n,i){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var p=v(o,n,r,i),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return le({key:e},s[e],{area:x(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,n=e.height;return t>=o.clientWidth&&n>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split('-')[1];return l+(f?'-'+f:'')}function L(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=n?E(t):a(t,i(o));return b(o,r,n)}function S(e){var t=e.ownerDocument.defaultView,o=t.getComputedStyle(e),n=parseFloat(o.marginTop||0)+parseFloat(o.marginBottom||0),i=parseFloat(o.marginLeft||0)+parseFloat(o.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function T(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function C(e,t,o){o=o.split('-')[0];var n=S(e),i={width:n.width,height:n.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',s=r?'left':'top',d=r?'height':'width',a=r?'width':'height';return i[p]=t[p]+t[d]/2-n[d]/2,i[s]=o===s?t[s]-n[a]:t[T(s)],i}function D(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function N(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var n=D(e,function(e){return e[t]===o});return e.indexOf(n)}function P(t,o,n){var i=void 0===n?t:t.slice(0,N(t,'name',n));return i.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var n=t['function']||t.fn;t.enabled&&e(n)&&(o.offsets.popper=g(o.offsets.popper),o.offsets.reference=g(o.offsets.reference),o=n(o,t))}),o}function k(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=O(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=C(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=P(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function W(e,t){return e.some(function(e){var o=e.name,n=e.enabled;return n&&o===t})}function B(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function H(){return this.state.isDestroyed=!0,W(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[B('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function M(e,t,o,i){var r='BODY'===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0}),r||M(n(p.parentNode),t,o,i),i.push(p)}function F(e,t,o,i){o.updateBound=i,A(e).addEventListener('resize',o.updateBound,{passive:!0});var r=n(e);return M(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function I(){this.state.eventsEnabled||(this.state=F(this.reference,this.options,this.state,this.scheduleUpdate))}function R(e,t){return A(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function U(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=R(this.reference,this.state))}function Y(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function V(e,t){Object.keys(t).forEach(function(o){var n='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&Y(t[o])&&(n='px'),e.style[o]=t[o]+n})}function j(e,t){Object.keys(t).forEach(function(o){var n=t[o];!1===n?e.removeAttribute(o):e.setAttribute(o,t[o])})}function q(e,t){var o=e.offsets,n=o.popper,i=o.reference,r=$,p=function(e){return e},s=r(i.width),d=r(n.width),a=-1!==['left','right'].indexOf(e.placement),l=-1!==e.placement.indexOf('-'),f=t?a||l||s%2==d%2?r:Z:p,m=t?r:p;return{left:f(1==s%2&&1==d%2&&!l&&t?n.left-1:n.left),top:m(n.top),bottom:m(n.bottom),right:f(n.right)}}function K(e,t,o){var n=D(e,function(e){var o=e.name;return o===t}),i=!!n&&e.some(function(e){return e.name===o&&e.enabled&&e.order<n.order});if(!i){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return i}function z(e){return'end'===e?'start':'start'===e?'end':e}function G(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=he.indexOf(e),n=he.slice(o+1).concat(he.slice(0,o));return t?n.reverse():n}function _(e,t,o,n){var i=e.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/),r=+i[1],p=i[2];if(!r)return e;if(0===p.indexOf('%')){var s;switch(p){case'%p':s=o;break;case'%':case'%r':default:s=n;}var d=g(s);return d[t]/100*r}if('vh'===p||'vw'===p){var a;return a='vh'===p?ee(document.documentElement.clientHeight,window.innerHeight||0):ee(document.documentElement.clientWidth,window.innerWidth||0),a/100*r}return r}function X(e,t,o,n){var i=[0,0],r=-1!==['right','left'].indexOf(n),p=e.split(/(\\+|\\-)/).map(function(e){return e.trim()}),s=p.indexOf(D(p,function(e){return-1!==e.search(/,|\\s/)}));p[s]&&-1===p[s].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var d=/\\s*,\\s*|\\s+/,a=-1===s?[p]:[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))];return a=a.map(function(e,n){var i=(1===n?!r:r)?'height':'width',p=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t)},[]).map(function(e){return _(e,i,t,o)})}),a.forEach(function(e,t){e.forEach(function(o,n){Y(o)&&(i[t]+=o*('-'===e[n-1]?-1:1))})}),i}function J(e,t){var o,n=t.offset,i=e.placement,r=e.offsets,p=r.popper,s=r.reference,d=i.split('-')[0];return o=Y(+n)?[+n,0]:X(n,p,s,d),'left'===d?(p.top+=o[0],p.left-=o[1]):'right'===d?(p.top+=o[0],p.left+=o[1]):'top'===d?(p.left+=o[0],p.top-=o[1]):'bottom'===d&&(p.left+=o[0],p.top+=o[1]),e.popper=p,e}var Q=Math.min,Z=Math.floor,$=Math.round,ee=Math.max,te='undefined'!=typeof window&&'undefined'!=typeof document&&'undefined'!=typeof navigator,oe=function(){for(var e=['Edge','Trident','Firefox'],t=0;t<e.length;t+=1)if(te&&0<=navigator.userAgent.indexOf(e[t]))return 1;return 0}(),ne=te&&window.Promise,ie=ne?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},oe))}},re=te&&!!(window.MSInputMethodContext&&document.documentMode),pe=te&&/MSIE 10/.test(navigator.userAgent),se=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},de=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),ae=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},le=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},fe=te&&/Firefox/i.test(navigator.userAgent),me=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],he=me.slice(3),ce={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},ge=function(){function t(o,n){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};se(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=ie(this.update.bind(this)),this.options=le({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=o&&o.jquery?o[0]:o,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(le({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=le({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return le({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var p=this.options.eventsEnabled;p&&this.enableEventListeners(),this.state.eventsEnabled=p}return de(t,[{key:'update',value:function(){return k.call(this)}},{key:'destroy',value:function(){return H.call(this)}},{key:'enableEventListeners',value:function(){return I.call(this)}},{key:'disableEventListeners',value:function(){return U.call(this)}}]),t}();return ge.Utils=('undefined'==typeof window?global:window).PopperUtils,ge.placements=me,ge.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],n=t.split('-')[1];if(n){var i=e.offsets,r=i.reference,p=i.popper,s=-1!==['bottom','top'].indexOf(o),d=s?'left':'top',a=s?'width':'height',l={start:ae({},d,r[d]),end:ae({},d,r[d]+r[a]-p[a])};e.offsets.popper=le({},p,l[n])}return e}},offset:{order:200,enabled:!0,fn:J,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||p(e.instance.popper);e.instance.reference===o&&(o=p(o));var n=B('transform'),i=e.instance.popper.style,r=i.top,s=i.left,d=i[n];i.top='',i.left='',i[n]='';var a=v(e.instance.popper,e.instance.reference,t.padding,o,e.positionFixed);i.top=r,i.left=s,i[n]=d,t.boundaries=a;var l=t.priority,f=e.offsets.popper,m={primary:function(e){var o=f[e];return f[e]<a[e]&&!t.escapeWithReference&&(o=ee(f[e],a[e])),ae({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=f[o];return f[e]>a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]<r(n[d])&&(e.offsets.popper[d]=r(n[d])-o[a]),o[d]>r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-u<s[m]&&(e.offsets.popper[m]-=s[m]-(d[c]-u)),d[m]+u>s[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f]),E=parseFloat(w['border'+f+'Width']),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)<f(l.right)||'top'===n&&f(a.bottom)>f(l.top)||'bottom'===n&&f(a.top)<f(l.bottom),h=f(a.left)<f(o.left),c=f(a.right)>f(o.right),g=f(a.top)<f(o.top),u=f(a.bottom)>f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,n=t.y,i=e.offsets.popper,r=D(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,d,a=void 0===r?t.gpuAcceleration:r,l=p(e.instance.popper),f=u(l),m={position:i.position},h=q(e,2>window.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={\"x-placement\":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});\n//# sourceMappingURL=popper.min.js.map\n","//! openseadragon 2.4.1\n//! Built on 2019-07-03\n//! Git commit: v2.4.1-0-244790e\n//! http://openseadragon.github.io\n//! License: http://openseadragon.github.io/license/\n\n/*\n * OpenSeadragon\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * Portions of this source file taken from jQuery:\n *\n * Copyright 2011 John Resig\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*\n * Portions of this source file taken from mattsnider.com:\n *\n * Copyright (c) 2006-2013 Matt Snider\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\n * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n * THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n/**\n * @namespace OpenSeadragon\n * @version openseadragon 2.4.1\n * @classdesc The root namespace for OpenSeadragon. All utility methods\n * and classes are defined on or below this namespace.\n *\n */\n\n\n// Typedefs\n\n /**\n * All required and optional settings for instantiating a new instance of an OpenSeadragon image viewer.\n *\n * @typedef {Object} Options\n * @memberof OpenSeadragon\n *\n * @property {String} id\n * Id of the element to append the viewer's container element to. If not provided, the 'element' property must be provided.\n * If both the element and id properties are specified, the viewer is appended to the element provided in the element property.\n *\n * @property {Element} element\n * The element to append the viewer's container element to. If not provided, the 'id' property must be provided.\n * If both the element and id properties are specified, the viewer is appended to the element provided in the element property.\n *\n * @property {Array|String|Function|Object} [tileSources=null]\n * Tile source(s) to open initially. This is a complex parameter; see\n * {@link OpenSeadragon.Viewer#open} for details.\n *\n * @property {Number} [tabIndex=0]\n * Tabbing order index to assign to the viewer element. Positive values are selected in increasing order. When tabIndex is 0\n * source order is used. A negative value omits the viewer from the tabbing order.\n *\n * @property {Array} overlays Array of objects defining permanent overlays of\n * the viewer. The overlays added via this option and later removed with\n * {@link OpenSeadragon.Viewer#removeOverlay} will be added back when a new\n * image is opened.\n * To add overlays which can be definitively removed, one must use\n * {@link OpenSeadragon.Viewer#addOverlay}\n * If displaying a sequence of images, the overlays can be associated\n * with a specific page by passing the overlays array to the page's\n * tile source configuration.\n * Expected properties:\n * * x, y, (or px, py for pixel coordinates) to define the location.\n * * width, height in point if using x,y or in pixels if using px,py. If width\n * and height are specified, the overlay size is adjusted when zooming,\n * otherwise the size stays the size of the content (or the size defined by CSS).\n * * className to associate a class to the overlay\n * * id to set the overlay element. If an element with this id already exists,\n * it is reused, otherwise it is created. If not specified, a new element is\n * created.\n * * placement a string to define the relative position to the viewport.\n * Only used if no width and height are specified. Default: 'TOP_LEFT'.\n * See {@link OpenSeadragon.Placement} for possible values.\n *\n * @property {String} [xmlPath=null]\n * <strong>DEPRECATED</strong>. A relative path to load a DZI file from the server.\n * Prefer the newer Options.tileSources.\n *\n * @property {String} [prefixUrl='/images/']\n * Prepends the prefixUrl to navImages paths, which is very useful\n * since the default paths are rarely useful for production\n * environments.\n *\n * @property {OpenSeadragon.NavImages} [navImages]\n * An object with a property for each button or other built-in navigation\n * control, eg the current 'zoomIn', 'zoomOut', 'home', and 'fullpage'.\n * Each of those in turn provides an image path for each state of the button\n * or navigation control, eg 'REST', 'GROUP', 'HOVER', 'PRESS'. Finally the\n * image paths, by default assume there is a folder on the servers root path\n * called '/images', eg '/images/zoomin_rest.png'. If you need to adjust\n * these paths, prefer setting the option.prefixUrl rather than overriding\n * every image path directly through this setting.\n *\n * @property {Boolean} [debugMode=false]\n * TODO: provide an in-screen panel providing event detail feedback.\n *\n * @property {String} [debugGridColor=['#437AB2', '#1B9E77', '#D95F02', '#7570B3', '#E7298A', '#66A61E', '#E6AB02', '#A6761D', '#666666']]\n * The colors of grids in debug mode. Each tiled image's grid uses a consecutive color.\n * If there are more tiled images than provided colors, the color vector is recycled.\n *\n * @property {Number} [blendTime=0]\n * Specifies the duration of animation as higher or lower level tiles are\n * replacing the existing tile.\n *\n * @property {Boolean} [alwaysBlend=false]\n * Forces the tile to always blend. By default the tiles skip blending\n * when the blendTime is surpassed and the current animation frame would\n * not complete the blend.\n *\n * @property {Boolean} [autoHideControls=true]\n * If the user stops interacting with the viewport, fade the navigation\n * controls. Useful for presentation since the controls are by default\n * floated on top of the image the user is viewing.\n *\n * @property {Boolean} [immediateRender=false]\n * Render the best closest level first, ignoring the lowering levels which\n * provide the effect of very blurry to sharp. It is recommended to change\n * setting to true for mobile devices.\n *\n * @property {Number} [defaultZoomLevel=0]\n * Zoom level to use when image is first opened or the home button is clicked.\n * If 0, adjusts to fit viewer.\n *\n * @property {Number} [opacity=1]\n * Default proportional opacity of the tiled images (1=opaque, 0=hidden)\n * Hidden images do not draw and only load when preloading is allowed.\n *\n * @property {Boolean} [preload=false]\n * Default switch for loading hidden images (true loads, false blocks)\n *\n * @property {String} [compositeOperation=null]\n * Valid values are 'source-over', 'source-atop', 'source-in', 'source-out',\n * 'destination-over', 'destination-atop', 'destination-in',\n * 'destination-out', 'lighter', 'copy' or 'xor'\n *\n * @property {Boolean} [imageSmoothingEnabled=true]\n * Image smoothing for canvas rendering (only if canvas is used). Note: Ignored\n * by some (especially older) browsers which do not support this canvas property.\n * This property can be changed in {@link Viewer.Drawer.setImageSmoothingEnabled}.\n *\n * @property {String|CanvasGradient|CanvasPattern|Function} [placeholderFillStyle=null]\n * Draws a colored rectangle behind the tile if it is not loaded yet.\n * You can pass a CSS color value like \"#FF8800\".\n * When passing a function the tiledImage and canvas context are available as argument which is useful when you draw a gradient or pattern.\n *\n * @property {Number} [degrees=0]\n * Initial rotation.\n *\n * @property {Boolean} [flipped=false]\n * Initial flip state.\n *\n * @property {Number} [minZoomLevel=null]\n *\n * @property {Number} [maxZoomLevel=null]\n *\n * @property {Boolean} [homeFillsViewer=false]\n * Make the 'home' button fill the viewer and clip the image, instead\n * of fitting the image to the viewer and letterboxing.\n *\n * @property {Boolean} [panHorizontal=true]\n * Allow horizontal pan.\n *\n * @property {Boolean} [panVertical=true]\n * Allow vertical pan.\n *\n * @property {Boolean} [constrainDuringPan=false]\n *\n * @property {Boolean} [wrapHorizontal=false]\n * Set to true to force the image to wrap horizontally within the viewport.\n * Useful for maps or images representing the surface of a sphere or cylinder.\n *\n * @property {Boolean} [wrapVertical=false]\n * Set to true to force the image to wrap vertically within the viewport.\n * Useful for maps or images representing the surface of a sphere or cylinder.\n *\n * @property {Number} [minZoomImageRatio=0.9]\n * The minimum percentage ( expressed as a number between 0 and 1 ) of\n * the viewport height or width at which the zoom out will be constrained.\n * Setting it to 0, for example will allow you to zoom out infinity.\n *\n * @property {Number} [maxZoomPixelRatio=1.1]\n * The maximum ratio to allow a zoom-in to affect the highest level pixel\n * ratio. This can be set to Infinity to allow 'infinite' zooming into the\n * image though it is less effective visually if the HTML5 Canvas is not\n * available on the viewing device.\n *\n * @property {Number} [smoothTileEdgesMinZoom=1.1]\n * A zoom percentage ( where 1 is 100% ) of the highest resolution level.\n * When zoomed in beyond this value alternative compositing will be used to\n * smooth out the edges between tiles. This will have a performance impact.\n * Can be set to Infinity to turn it off.\n * Note: This setting is ignored on iOS devices due to a known bug (See {@link https://github.com/openseadragon/openseadragon/issues/952})\n *\n * @property {Boolean} [iOSDevice=?]\n * True if running on an iOS device, false otherwise.\n * Used to disable certain features that behave differently on iOS devices.\n *\n * @property {Boolean} [autoResize=true]\n * Set to false to prevent polling for viewer size changes. Useful for providing custom resize behavior.\n *\n * @property {Boolean} [preserveImageSizeOnResize=false]\n * Set to true to have the image size preserved when the viewer is resized. This requires autoResize=true (default).\n *\n * @property {Number} [minScrollDeltaTime=50]\n * Number of milliseconds between canvas-scroll events. This value helps normalize the rate of canvas-scroll\n * events between different devices, causing the faster devices to slow down enough to make the zoom control\n * more manageable.\n *\n * @property {Number} [rotationIncrement=90]\n * The number of degrees to rotate right or left when the rotate buttons or keyboard shortcuts are activated.\n *\n * @property {Number} [pixelsPerWheelLine=40]\n * For pixel-resolution scrolling devices, the number of pixels equal to one scroll line.\n *\n * @property {Number} [pixelsPerArrowPress=40]\n * The number of pixels viewport moves when an arrow key is pressed.\n *\n * @property {Number} [visibilityRatio=0.5]\n * The percentage ( as a number from 0 to 1 ) of the source image which\n * must be kept within the viewport. If the image is dragged beyond that\n * limit, it will 'bounce' back until the minimum visibility ratio is\n * achieved. Setting this to 0 and wrapHorizontal ( or wrapVertical ) to\n * true will provide the effect of an infinitely scrolling viewport.\n *\n * @property {Object} [viewportMargins={}]\n * Pushes the \"home\" region in from the sides by the specified amounts.\n * Possible subproperties (Numbers, in screen coordinates): left, top, right, bottom.\n *\n * @property {Number} [imageLoaderLimit=0]\n * The maximum number of image requests to make concurrently. By default\n * it is set to 0 allowing the browser to make the maximum number of\n * image requests in parallel as allowed by the browsers policy.\n *\n * @property {Number} [clickTimeThreshold=300]\n * The number of milliseconds within which a pointer down-up event combination\n * will be treated as a click gesture.\n *\n * @property {Number} [clickDistThreshold=5]\n * The maximum distance allowed between a pointer down event and a pointer up event\n * to be treated as a click gesture.\n *\n * @property {Number} [dblClickTimeThreshold=300]\n * The number of milliseconds within which two pointer down-up event combinations\n * will be treated as a double-click gesture.\n *\n * @property {Number} [dblClickDistThreshold=20]\n * The maximum distance allowed between two pointer click events\n * to be treated as a double-click gesture.\n *\n * @property {Number} [springStiffness=6.5]\n *\n * @property {Number} [animationTime=1.2]\n * Specifies the animation duration per each {@link OpenSeadragon.Spring}\n * which occur when the image is dragged or zoomed.\n *\n * @property {OpenSeadragon.GestureSettings} [gestureSettingsMouse]\n * Settings for gestures generated by a mouse pointer device. (See {@link OpenSeadragon.GestureSettings})\n * @property {Boolean} [gestureSettingsMouse.scrollToZoom=true] - Zoom on scroll gesture\n * @property {Boolean} [gestureSettingsMouse.clickToZoom=true] - Zoom on click gesture\n * @property {Boolean} [gestureSettingsMouse.dblClickToZoom=false] - Zoom on double-click gesture. Note: If set to true\n * then clickToZoom should be set to false to prevent multiple zooms.\n * @property {Boolean} [gestureSettingsMouse.pinchToZoom=false] - Zoom on pinch gesture\n * @property {Boolean} [gestureSettingsMouse.zoomToRefPoint=true] - If zoomToRefPoint is true, the zoom is centered at the pointer position. Otherwise,\n * the zoom is centered at the canvas center.\n * @property {Boolean} [gestureSettingsMouse.flickEnabled=false] - Enable flick gesture\n * @property {Number} [gestureSettingsMouse.flickMinSpeed=120] - If flickEnabled is true, the minimum speed to initiate a flick gesture (pixels-per-second)\n * @property {Number} [gestureSettingsMouse.flickMomentum=0.25] - If flickEnabled is true, the momentum factor for the flick gesture\n * @property {Boolean} [gestureSettingsMouse.pinchRotate=false] - If pinchRotate is true, the user will have the ability to rotate the image using their fingers.\n *\n * @property {OpenSeadragon.GestureSettings} [gestureSettingsTouch]\n * Settings for gestures generated by a touch pointer device. (See {@link OpenSeadragon.GestureSettings})\n * @property {Boolean} [gestureSettingsTouch.scrollToZoom=false] - Zoom on scroll gesture\n * @property {Boolean} [gestureSettingsTouch.clickToZoom=false] - Zoom on click gesture\n * @property {Boolean} [gestureSettingsTouch.dblClickToZoom=true] - Zoom on double-click gesture. Note: If set to true\n * then clickToZoom should be set to false to prevent multiple zooms.\n * @property {Boolean} [gestureSettingsTouch.pinchToZoom=true] - Zoom on pinch gesture\n * @property {Boolean} [gestureSettingsTouch.zoomToRefPoint=true] - If zoomToRefPoint is true, the zoom is centered at the pointer position. Otherwise,\n * the zoom is centered at the canvas center.\n * @property {Boolean} [gestureSettingsTouch.flickEnabled=true] - Enable flick gesture\n * @property {Number} [gestureSettingsTouch.flickMinSpeed=120] - If flickEnabled is true, the minimum speed to initiate a flick gesture (pixels-per-second)\n * @property {Number} [gestureSettingsTouch.flickMomentum=0.25] - If flickEnabled is true, the momentum factor for the flick gesture\n * @property {Boolean} [gestureSettingsTouch.pinchRotate=false] - If pinchRotate is true, the user will have the ability to rotate the image using their fingers.\n *\n * @property {OpenSeadragon.GestureSettings} [gestureSettingsPen]\n * Settings for gestures generated by a pen pointer device. (See {@link OpenSeadragon.GestureSettings})\n * @property {Boolean} [gestureSettingsPen.scrollToZoom=false] - Zoom on scroll gesture\n * @property {Boolean} [gestureSettingsPen.clickToZoom=true] - Zoom on click gesture\n * @property {Boolean} [gestureSettingsPen.dblClickToZoom=false] - Zoom on double-click gesture. Note: If set to true\n * then clickToZoom should be set to false to prevent multiple zooms.\n * @property {Boolean} [gestureSettingsPen.pinchToZoom=false] - Zoom on pinch gesture\n * @property {Boolean} [gestureSettingsPan.zoomToRefPoint=true] - If zoomToRefPoint is true, the zoom is centered at the pointer position. Otherwise,\n * the zoom is centered at the canvas center.\n * @property {Boolean} [gestureSettingsPen.flickEnabled=false] - Enable flick gesture\n * @property {Number} [gestureSettingsPen.flickMinSpeed=120] - If flickEnabled is true, the minimum speed to initiate a flick gesture (pixels-per-second)\n * @property {Number} [gestureSettingsPen.flickMomentum=0.25] - If flickEnabled is true, the momentum factor for the flick gesture\n * @property {Boolean} [gestureSettingsPen.pinchRotate=false] - If pinchRotate is true, the user will have the ability to rotate the image using their fingers.\n *\n * @property {OpenSeadragon.GestureSettings} [gestureSettingsUnknown]\n * Settings for gestures generated by unknown pointer devices. (See {@link OpenSeadragon.GestureSettings})\n * @property {Boolean} [gestureSettingsUnknown.scrollToZoom=true] - Zoom on scroll gesture\n * @property {Boolean} [gestureSettingsUnknown.clickToZoom=false] - Zoom on click gesture\n * @property {Boolean} [gestureSettingsUnknown.dblClickToZoom=true] - Zoom on double-click gesture. Note: If set to true\n * then clickToZoom should be set to false to prevent multiple zooms.\n * @property {Boolean} [gestureSettingsUnknown.pinchToZoom=true] - Zoom on pinch gesture\n * @property {Boolean} [gestureSettingsUnknown.zoomToRefPoint=true] - If zoomToRefPoint is true, the zoom is centered at the pointer position. Otherwise,\n * the zoom is centered at the canvas center.\n * @property {Boolean} [gestureSettingsUnknown.flickEnabled=true] - Enable flick gesture\n * @property {Number} [gestureSettingsUnknown.flickMinSpeed=120] - If flickEnabled is true, the minimum speed to initiate a flick gesture (pixels-per-second)\n * @property {Number} [gestureSettingsUnknown.flickMomentum=0.25] - If flickEnabled is true, the momentum factor for the flick gesture\n * @property {Boolean} [gestureSettingsUnknown.pinchRotate=false] - If pinchRotate is true, the user will have the ability to rotate the image using their fingers.\n *\n * @property {Number} [zoomPerClick=2.0]\n * The \"zoom distance\" per mouse click or touch tap. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the click-to-zoom feature (also see gestureSettings[Mouse|Touch|Pen].clickToZoom/dblClickToZoom).</em>\n *\n * @property {Number} [zoomPerScroll=1.2]\n * The \"zoom distance\" per mouse scroll or touch pinch. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the mouse-wheel zoom feature (also see gestureSettings[Mouse|Touch|Pen].scrollToZoom}).</em>\n *\n * @property {Number} [zoomPerSecond=1.0]\n * The number of seconds to animate a single zoom event over.\n *\n * @property {Boolean} [showNavigator=false]\n * Set to true to make the navigator minimap appear.\n *\n * @property {String} [navigatorId=navigator-GENERATED DATE]\n * The ID of a div to hold the navigator minimap.\n * If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, navigator[Top|Left|Height|Width] and navigatorAutoFade options will be ignored.\n * If an ID is not specified, a div element will be generated and placed on top of the main image.\n *\n * @property {String} [navigatorPosition='TOP_RIGHT']\n * Valid values are 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', 'BOTTOM_RIGHT', or 'ABSOLUTE'.<br>\n * If 'ABSOLUTE' is specified, then navigator[Top|Left|Height|Width] determines the size and position of the navigator minimap in the viewer, and navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.<br>\n * For 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', and 'BOTTOM_RIGHT', the navigatorSizeRatio or navigator[Height|Width] values determine the size of the navigator minimap.\n *\n * @property {Number} [navigatorSizeRatio=0.2]\n * Ratio of navigator size to viewer size. Ignored if navigator[Height|Width] are specified.\n *\n * @property {Boolean} [navigatorMaintainSizeRatio=false]\n * If true, the navigator minimap is resized (using navigatorSizeRatio) when the viewer size changes.\n *\n * @property {Number|String} [navigatorTop=null]\n * Specifies the location of the navigator minimap (see navigatorPosition).\n *\n * @property {Number|String} [navigatorLeft=null]\n * Specifies the location of the navigator minimap (see navigatorPosition).\n *\n * @property {Number|String} [navigatorHeight=null]\n * Specifies the size of the navigator minimap (see navigatorPosition).\n * If specified, navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.\n *\n * @property {Number|String} [navigatorWidth=null]\n * Specifies the size of the navigator minimap (see navigatorPosition).\n * If specified, navigatorSizeRatio and navigatorMaintainSizeRatio are ignored.\n *\n * @property {Boolean} [navigatorAutoResize=true]\n * Set to false to prevent polling for navigator size changes. Useful for providing custom resize behavior.\n * Setting to false can also improve performance when the navigator is configured to a fixed size.\n *\n * @property {Boolean} [navigatorAutoFade=true]\n * If the user stops interacting with the viewport, fade the navigator minimap.\n * Setting to false will make the navigator minimap always visible.\n *\n * @property {Boolean} [navigatorRotate=true]\n * If true, the navigator will be rotated together with the viewer.\n *\n * @property {String} [navigatorBackground='#000']\n * Specifies the background color of the navigator minimap\n *\n * @property {Number} [navigatorOpacity=0.8]\n * Specifies the opacity of the navigator minimap.\n *\n * @property {String} [navigatorBorderColor='#555']\n * Specifies the border color of the navigator minimap\n *\n * @property {String} [navigatorDisplayRegionColor='#900']\n * Specifies the border color of the display region rectangle of the navigator minimap\n *\n * @property {Number} [controlsFadeDelay=2000]\n * The number of milliseconds to wait once the user has stopped interacting\n * with the interface before beginning to fade the controls. Assumes\n * showNavigationControl and autoHideControls are both true.\n *\n * @property {Number} [controlsFadeLength=1500]\n * The number of milliseconds to animate the controls fading out.\n *\n * @property {Number} [maxImageCacheCount=200]\n * The max number of images we should keep in memory (per drawer).\n *\n * @property {Number} [timeout=30000]\n * The max number of milliseconds that an image job may take to complete.\n *\n * @property {Boolean} [useCanvas=true]\n * Set to false to not use an HTML canvas element for image rendering even if canvas is supported.\n *\n * @property {Number} [minPixelRatio=0.5]\n * The higher the minPixelRatio, the lower the quality of the image that\n * is considered sufficient to stop rendering a given zoom level. For\n * example, if you are targeting mobile devices with less bandwidth you may\n * try setting this to 1.5 or higher.\n *\n * @property {Boolean} [mouseNavEnabled=true]\n * Is the user able to interact with the image via mouse or touch. Default\n * interactions include draging the image in a plane, and zooming in toward\n * and away from the image.\n *\n * @property {Boolean} [showNavigationControl=true]\n * Set to false to prevent the appearance of the default navigation controls.<br>\n * Note that if set to false, the customs buttons set by the options\n * zoomInButton, zoomOutButton etc, are rendered inactive.\n *\n * @property {OpenSeadragon.ControlAnchor} [navigationControlAnchor=TOP_LEFT]\n * Placement of the default navigation controls.\n * To set the placement of the sequence controls, see the\n * sequenceControlAnchor option.\n *\n * @property {Boolean} [showZoomControl=true]\n * If true then + and - buttons to zoom in and out are displayed.<br>\n * Note: {@link OpenSeadragon.Options.showNavigationControl} is overriding\n * this setting when set to false.\n *\n * @property {Boolean} [showHomeControl=true]\n * If true then the 'Go home' button is displayed to go back to the original\n * zoom and pan.<br>\n * Note: {@link OpenSeadragon.Options.showNavigationControl} is overriding\n * this setting when set to false.\n *\n * @property {Boolean} [showFullPageControl=true]\n * If true then the 'Toggle full page' button is displayed to switch\n * between full page and normal mode.<br>\n * Note: {@link OpenSeadragon.Options.showNavigationControl} is overriding\n * this setting when set to false.\n *\n * @property {Boolean} [showRotationControl=false]\n * If true then the rotate left/right controls will be displayed as part of the\n * standard controls. This is also subject to the browser support for rotate\n * (e.g. viewer.drawer.canRotate()).<br>\n * Note: {@link OpenSeadragon.Options.showNavigationControl} is overriding\n * this setting when set to false.\n *\n * @property {Boolean} [showFlipControl=false]\n * If true then the flip controls will be displayed as part of the\n * standard controls.\n *\n * @property {Boolean} [showSequenceControl=true]\n * If sequenceMode is true, then provide buttons for navigating forward and\n * backward through the images.\n *\n * @property {OpenSeadragon.ControlAnchor} [sequenceControlAnchor=TOP_LEFT]\n * Placement of the default sequence controls.\n *\n * @property {Boolean} [navPrevNextWrap=false]\n * If true then the 'previous' button will wrap to the last image when\n * viewing the first image and the 'next' button will wrap to the first\n * image when viewing the last image.\n *\n * @property {String} zoomInButton\n * Set the id of the custom 'Zoom in' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} zoomOutButton\n * Set the id of the custom 'Zoom out' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} homeButton\n * Set the id of the custom 'Go home' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} fullPageButton\n * Set the id of the custom 'Toggle full page' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} rotateLeftButton\n * Set the id of the custom 'Rotate left' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} rotateRightButton\n * Set the id of the custom 'Rotate right' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} previousButton\n * Set the id of the custom 'Previous page' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {String} nextButton\n * Set the id of the custom 'Next page' button to use.\n * This is useful to have a custom button anywhere in the web page.<br>\n * To only change the button images, consider using\n * {@link OpenSeadragon.Options.navImages}\n *\n * @property {Boolean} [sequenceMode=false]\n * Set to true to have the viewer treat your tilesources as a sequence of images to\n * be opened one at a time rather than all at once.\n *\n * @property {Number} [initialPage=0]\n * If sequenceMode is true, display this page initially.\n *\n * @property {Boolean} [preserveViewport=false]\n * If sequenceMode is true, then normally navigating through each image resets the\n * viewport to 'home' position. If preserveViewport is set to true, then the viewport\n * position is preserved when navigating between images in the sequence.\n *\n * @property {Boolean} [preserveOverlays=false]\n * If sequenceMode is true, then normally navigating through each image\n * resets the overlays.\n * If preserveOverlays is set to true, then the overlays added with {@link OpenSeadragon.Viewer#addOverlay}\n * are preserved when navigating between images in the sequence.\n * Note: setting preserveOverlays overrides any overlays specified in the global\n * \"overlays\" option for the Viewer. It's also not compatible with specifying\n * per-tileSource overlays via the options, as those overlays will persist\n * even after the tileSource is closed.\n *\n * @property {Boolean} [showReferenceStrip=false]\n * If sequenceMode is true, then display a scrolling strip of image thumbnails for\n * navigating through the images.\n *\n * @property {String} [referenceStripScroll='horizontal']\n *\n * @property {Element} [referenceStripElement=null]\n *\n * @property {Number} [referenceStripHeight=null]\n *\n * @property {Number} [referenceStripWidth=null]\n *\n * @property {String} [referenceStripPosition='BOTTOM_LEFT']\n *\n * @property {Number} [referenceStripSizeRatio=0.2]\n *\n * @property {Boolean} [collectionMode=false]\n * Set to true to have the viewer arrange your TiledImages in a grid or line.\n *\n * @property {Number} [collectionRows=3]\n * If collectionMode is true, specifies how many rows the grid should have. Use 1 to make a line.\n * If collectionLayout is 'vertical', specifies how many columns instead.\n *\n * @property {Number} [collectionColumns=0]\n * If collectionMode is true, specifies how many columns the grid should have. Use 1 to make a line.\n * If collectionLayout is 'vertical', specifies how many rows instead. Ignored if collectionRows is not set to a falsy value.\n *\n * @property {String} [collectionLayout='horizontal']\n * If collectionMode is true, specifies whether to arrange vertically or horizontally.\n *\n * @property {Number} [collectionTileSize=800]\n * If collectionMode is true, specifies the size, in viewport coordinates, for each TiledImage to fit into.\n * The TiledImage will be centered within a square of the specified size.\n *\n * @property {Number} [collectionTileMargin=80]\n * If collectionMode is true, specifies the margin, in viewport coordinates, between each TiledImage.\n *\n * @property {String|Boolean} [crossOriginPolicy=false]\n * Valid values are 'Anonymous', 'use-credentials', and false. If false, canvas requests will\n * not use CORS, and the canvas will be tainted.\n *\n * @property {Boolean} [ajaxWithCredentials=false]\n * Whether to set the withCredentials XHR flag for AJAX requests.\n * Note that this can be overridden at the {@link OpenSeadragon.TileSource} level.\n *\n * @property {Boolean} [loadTilesWithAjax=false]\n * Whether to load tile data using AJAX requests.\n * Note that this can be overridden at the {@link OpenSeadragon.TileSource} level.\n *\n * @property {Object} [ajaxHeaders={}]\n * A set of headers to include when making AJAX requests for tile sources or tiles.\n *\n */\n\n /**\n * Settings for gestures generated by a pointer device.\n *\n * @typedef {Object} GestureSettings\n * @memberof OpenSeadragon\n *\n * @property {Boolean} scrollToZoom\n * Set to false to disable zooming on scroll gestures.\n *\n * @property {Boolean} clickToZoom\n * Set to false to disable zooming on click gestures.\n *\n * @property {Boolean} dblClickToZoom\n * Set to false to disable zooming on double-click gestures. Note: If set to true\n * then clickToZoom should be set to false to prevent multiple zooms.\n *\n * @property {Boolean} pinchToZoom\n * Set to false to disable zooming on pinch gestures.\n *\n * @property {Boolean} flickEnabled\n * Set to false to disable the kinetic panning effect (flick) at the end of a drag gesture.\n *\n * @property {Number} flickMinSpeed\n * If flickEnabled is true, the minimum speed (in pixels-per-second) required to cause the kinetic panning effect (flick) at the end of a drag gesture.\n *\n * @property {Number} flickMomentum\n * If flickEnabled is true, a constant multiplied by the velocity to determine the distance of the kinetic panning effect (flick) at the end of a drag gesture.\n * A larger value will make the flick feel \"lighter\", while a smaller value will make the flick feel \"heavier\".\n * Note: springStiffness and animationTime also affect the \"spring\" used to stop the flick animation.\n *\n */\n\n/**\n * The names for the image resources used for the image navigation buttons.\n *\n * @typedef {Object} NavImages\n * @memberof OpenSeadragon\n *\n * @property {Object} zoomIn - Images for the zoom-in button.\n * @property {String} zoomIn.REST\n * @property {String} zoomIn.GROUP\n * @property {String} zoomIn.HOVER\n * @property {String} zoomIn.DOWN\n *\n * @property {Object} zoomOut - Images for the zoom-out button.\n * @property {String} zoomOut.REST\n * @property {String} zoomOut.GROUP\n * @property {String} zoomOut.HOVER\n * @property {String} zoomOut.DOWN\n *\n * @property {Object} home - Images for the home button.\n * @property {String} home.REST\n * @property {String} home.GROUP\n * @property {String} home.HOVER\n * @property {String} home.DOWN\n *\n * @property {Object} fullpage - Images for the full-page button.\n * @property {String} fullpage.REST\n * @property {String} fullpage.GROUP\n * @property {String} fullpage.HOVER\n * @property {String} fullpage.DOWN\n *\n * @property {Object} rotateleft - Images for the rotate left button.\n * @property {String} rotateleft.REST\n * @property {String} rotateleft.GROUP\n * @property {String} rotateleft.HOVER\n * @property {String} rotateleft.DOWN\n *\n * @property {Object} rotateright - Images for the rotate right button.\n * @property {String} rotateright.REST\n * @property {String} rotateright.GROUP\n * @property {String} rotateright.HOVER\n * @property {String} rotateright.DOWN\n *\n * @property {Object} flip - Images for the flip button.\n * @property {String} flip.REST\n * @property {String} flip.GROUP\n * @property {String} flip.HOVER\n * @property {String} flip.DOWN\n *\n * @property {Object} previous - Images for the previous button.\n * @property {String} previous.REST\n * @property {String} previous.GROUP\n * @property {String} previous.HOVER\n * @property {String} previous.DOWN\n *\n * @property {Object} next - Images for the next button.\n * @property {String} next.REST\n * @property {String} next.GROUP\n * @property {String} next.HOVER\n * @property {String} next.DOWN\n *\n */\n\n\nfunction OpenSeadragon( options ){\n return new OpenSeadragon.Viewer( options );\n}\n\n(function( $ ){\n\n\n /**\n * The OpenSeadragon version.\n *\n * @member {Object} OpenSeadragon.version\n * @property {String} versionStr - The version number as a string ('major.minor.revision').\n * @property {Number} major - The major version number.\n * @property {Number} minor - The minor version number.\n * @property {Number} revision - The revision number.\n * @since 1.0.0\n */\n $.version = {\n versionStr: '2.4.1',\n major: parseInt('2', 10),\n minor: parseInt('4', 10),\n revision: parseInt('1', 10)\n };\n\n\n /**\n * Taken from jquery 1.6.1\n * [[Class]] -> type pairs\n * @private\n */\n var class2type = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regexp',\n '[object Object]': 'object'\n },\n // Save a reference to some core methods\n toString = Object.prototype.toString,\n hasOwn = Object.prototype.hasOwnProperty;\n\n /**\n * Taken from jQuery 1.6.1\n * @function isFunction\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.isFunction = function( obj ) {\n return $.type(obj) === \"function\";\n };\n\n\n /**\n * Taken from jQuery 1.6.1\n * @function isArray\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.isArray = Array.isArray || function( obj ) {\n return $.type(obj) === \"array\";\n };\n\n\n /**\n * A crude way of determining if an object is a window.\n * Taken from jQuery 1.6.1\n * @function isWindow\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.isWindow = function( obj ) {\n return obj && typeof obj === \"object\" && \"setInterval\" in obj;\n };\n\n\n /**\n * Taken from jQuery 1.6.1\n * @function type\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.type = function( obj ) {\n return ( obj === null ) || ( obj === undefined ) ?\n String( obj ) :\n class2type[ toString.call(obj) ] || \"object\";\n };\n\n\n /**\n * Taken from jQuery 1.6.1\n * @function isPlainObject\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.isPlainObject = function( obj ) {\n // Must be an Object.\n // Because of IE, we also have to check the presence of the constructor property.\n // Make sure that DOM nodes and window objects don't pass through, as well\n if ( !obj || OpenSeadragon.type(obj) !== \"object\" || obj.nodeType || $.isWindow( obj ) ) {\n return false;\n }\n\n // Not own constructor property must be Object\n if ( obj.constructor &&\n !hasOwn.call(obj, \"constructor\") &&\n !hasOwn.call(obj.constructor.prototype, \"isPrototypeOf\") ) {\n return false;\n }\n\n // Own properties are enumerated firstly, so to speed up,\n // if last one is own, then all properties are own.\n\n var lastKey;\n for (var key in obj ) {\n lastKey = key;\n }\n\n return lastKey === undefined || hasOwn.call( obj, lastKey );\n };\n\n\n /**\n * Taken from jQuery 1.6.1\n * @function isEmptyObject\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.isEmptyObject = function( obj ) {\n for ( var name in obj ) {\n return false;\n }\n return true;\n };\n\n /**\n * Shim around Object.freeze. Does nothing if Object.freeze is not supported.\n * @param {Object} obj The object to freeze.\n * @return {Object} obj The frozen object.\n */\n $.freezeObject = function(obj) {\n if (Object.freeze) {\n $.freezeObject = Object.freeze;\n } else {\n $.freezeObject = function(obj) {\n return obj;\n };\n }\n return $.freezeObject(obj);\n };\n\n /**\n * True if the browser supports the HTML5 canvas element\n * @member {Boolean} supportsCanvas\n * @memberof OpenSeadragon\n */\n $.supportsCanvas = (function () {\n var canvasElement = document.createElement( 'canvas' );\n return !!( $.isFunction( canvasElement.getContext ) &&\n canvasElement.getContext( '2d' ) );\n }());\n\n /**\n * Test whether the submitted canvas is tainted or not.\n * @argument {Canvas} canvas The canvas to test.\n * @returns {Boolean} True if the canvas is tainted.\n */\n $.isCanvasTainted = function(canvas) {\n var isTainted = false;\n try {\n // We test if the canvas is tainted by retrieving data from it.\n // An exception will be raised if the canvas is tainted.\n canvas.getContext('2d').getImageData(0, 0, 1, 1);\n } catch (e) {\n isTainted = true;\n }\n return isTainted;\n };\n\n /**\n * A ratio comparing the device screen's pixel density to the canvas's backing store pixel density,\n * clamped to a minimum of 1. Defaults to 1 if canvas isn't supported by the browser.\n * @member {Number} pixelDensityRatio\n * @memberof OpenSeadragon\n */\n $.pixelDensityRatio = (function () {\n if ( $.supportsCanvas ) {\n var context = document.createElement('canvas').getContext('2d');\n var devicePixelRatio = window.devicePixelRatio || 1;\n var backingStoreRatio = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio || 1;\n return Math.max(devicePixelRatio, 1) / backingStoreRatio;\n } else {\n return 1;\n }\n }());\n\n}( OpenSeadragon ));\n\n/**\n * This closure defines all static methods available to the OpenSeadragon\n * namespace. Many, if not most, are taked directly from jQuery for use\n * to simplify and reduce common programming patterns. More static methods\n * from jQuery may eventually make their way into this though we are\n * attempting to avoid an explicit dependency on jQuery only because\n * OpenSeadragon is a broadly useful code base and would be made less broad\n * by requiring jQuery fully.\n *\n * Some static methods have also been refactored from the original OpenSeadragon\n * project.\n */\n(function( $ ){\n\n /**\n * Taken from jQuery 1.6.1\n * @function extend\n * @memberof OpenSeadragon\n * @see {@link http://www.jquery.com/ jQuery}\n */\n $.extend = function() {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[ 0 ] || {},\n length = arguments.length,\n deep = false,\n i = 1;\n\n // Handle a deep copy situation\n if ( typeof target === \"boolean\" ) {\n deep = target;\n target = arguments[ 1 ] || {};\n // skip the boolean and the target\n i = 2;\n }\n\n // Handle case when target is a string or something (possible in deep copy)\n if ( typeof target !== \"object\" && !OpenSeadragon.isFunction( target ) ) {\n target = {};\n }\n\n // extend jQuery itself if only one argument is passed\n if ( length === i ) {\n target = this;\n --i;\n }\n\n for ( ; i < length; i++ ) {\n // Only deal with non-null/undefined values\n options = arguments[ i ];\n if ( options !== null || options !== undefined ) {\n // Extend the base object\n for ( name in options ) {\n src = target[ name ];\n copy = options[ name ];\n\n // Prevent never-ending loop\n if ( target === copy ) {\n continue;\n }\n\n // Recurse if we're merging plain objects or arrays\n if ( deep && copy && ( OpenSeadragon.isPlainObject( copy ) || ( copyIsArray = OpenSeadragon.isArray( copy ) ) ) ) {\n if ( copyIsArray ) {\n copyIsArray = false;\n clone = src && OpenSeadragon.isArray( src ) ? src : [];\n\n } else {\n clone = src && OpenSeadragon.isPlainObject( src ) ? src : {};\n }\n\n // Never move original objects, clone them\n target[ name ] = OpenSeadragon.extend( deep, clone, copy );\n\n // Don't bring in undefined values\n } else if ( copy !== undefined ) {\n target[ name ] = copy;\n }\n }\n }\n }\n\n // Return the modified object\n return target;\n };\n\n var isIOSDevice = function () {\n if (typeof navigator !== 'object') {\n return false;\n }\n var userAgent = navigator.userAgent;\n if (typeof userAgent !== 'string') {\n return false;\n }\n return userAgent.indexOf('iPhone') !== -1 ||\n userAgent.indexOf('iPad') !== -1 ||\n userAgent.indexOf('iPod') !== -1;\n };\n\n $.extend( $, /** @lends OpenSeadragon */{\n /**\n * The default values for the optional settings documented at {@link OpenSeadragon.Options}.\n * @static\n * @type {Object}\n */\n DEFAULT_SETTINGS: {\n //DATA SOURCE DETAILS\n xmlPath: null,\n tileSources: null,\n tileHost: null,\n initialPage: 0,\n crossOriginPolicy: false,\n ajaxWithCredentials: false,\n loadTilesWithAjax: false,\n ajaxHeaders: {},\n\n //PAN AND ZOOM SETTINGS AND CONSTRAINTS\n panHorizontal: true,\n panVertical: true,\n constrainDuringPan: false,\n wrapHorizontal: false,\n wrapVertical: false,\n visibilityRatio: 0.5, //-> how much of the viewer can be negative space\n minPixelRatio: 0.5, //->closer to 0 draws tiles meant for a higher zoom at this zoom\n defaultZoomLevel: 0,\n minZoomLevel: null,\n maxZoomLevel: null,\n homeFillsViewer: false,\n\n //UI RESPONSIVENESS AND FEEL\n clickTimeThreshold: 300,\n clickDistThreshold: 5,\n dblClickTimeThreshold: 300,\n dblClickDistThreshold: 20,\n springStiffness: 6.5,\n animationTime: 1.2,\n gestureSettingsMouse: {\n scrollToZoom: true,\n clickToZoom: true,\n dblClickToZoom: false,\n pinchToZoom: false,\n zoomToRefPoint: true,\n flickEnabled: false,\n flickMinSpeed: 120,\n flickMomentum: 0.25,\n pinchRotate: false\n },\n gestureSettingsTouch: {\n scrollToZoom: false,\n clickToZoom: false,\n dblClickToZoom: true,\n pinchToZoom: true,\n zoomToRefPoint: true,\n flickEnabled: true,\n flickMinSpeed: 120,\n flickMomentum: 0.25,\n pinchRotate: false\n },\n gestureSettingsPen: {\n scrollToZoom: false,\n clickToZoom: true,\n dblClickToZoom: false,\n pinchToZoom: false,\n zoomToRefPoint: true,\n flickEnabled: false,\n flickMinSpeed: 120,\n flickMomentum: 0.25,\n pinchRotate: false\n },\n gestureSettingsUnknown: {\n scrollToZoom: false,\n clickToZoom: false,\n dblClickToZoom: true,\n pinchToZoom: true,\n zoomToRefPoint: true,\n flickEnabled: true,\n flickMinSpeed: 120,\n flickMomentum: 0.25,\n pinchRotate: false\n },\n zoomPerClick: 2,\n zoomPerScroll: 1.2,\n zoomPerSecond: 1.0,\n blendTime: 0,\n alwaysBlend: false,\n autoHideControls: true,\n immediateRender: false,\n minZoomImageRatio: 0.9, //-> closer to 0 allows zoom out to infinity\n maxZoomPixelRatio: 1.1, //-> higher allows 'over zoom' into pixels\n smoothTileEdgesMinZoom: 1.1, //-> higher than maxZoomPixelRatio disables it\n iOSDevice: isIOSDevice(),\n pixelsPerWheelLine: 40,\n pixelsPerArrowPress: 40,\n autoResize: true,\n preserveImageSizeOnResize: false, // requires autoResize=true\n minScrollDeltaTime: 50,\n rotationIncrement: 90,\n\n //DEFAULT CONTROL SETTINGS\n showSequenceControl: true, //SEQUENCE\n sequenceControlAnchor: null, //SEQUENCE\n preserveViewport: false, //SEQUENCE\n preserveOverlays: false, //SEQUENCE\n navPrevNextWrap: false, //SEQUENCE\n showNavigationControl: true, //ZOOM/HOME/FULL/ROTATION\n navigationControlAnchor: null, //ZOOM/HOME/FULL/ROTATION\n showZoomControl: true, //ZOOM\n showHomeControl: true, //HOME\n showFullPageControl: true, //FULL\n showRotationControl: false, //ROTATION\n showFlipControl: false, //FLIP\n controlsFadeDelay: 2000, //ZOOM/HOME/FULL/SEQUENCE\n controlsFadeLength: 1500, //ZOOM/HOME/FULL/SEQUENCE\n mouseNavEnabled: true, //GENERAL MOUSE INTERACTIVITY\n\n //VIEWPORT NAVIGATOR SETTINGS\n showNavigator: false,\n navigatorId: null,\n navigatorPosition: null,\n navigatorSizeRatio: 0.2,\n navigatorMaintainSizeRatio: false,\n navigatorTop: null,\n navigatorLeft: null,\n navigatorHeight: null,\n navigatorWidth: null,\n navigatorAutoResize: true,\n navigatorAutoFade: true,\n navigatorRotate: true,\n navigatorBackground: '#000',\n navigatorOpacity: 0.8,\n navigatorBorderColor: '#555',\n navigatorDisplayRegionColor: '#900',\n\n // INITIAL ROTATION\n degrees: 0,\n\n // INITIAL FLIP STATE\n flipped: false,\n\n // APPEARANCE\n opacity: 1,\n preload: false,\n compositeOperation: null,\n imageSmoothingEnabled: true,\n placeholderFillStyle: null,\n\n //REFERENCE STRIP SETTINGS\n showReferenceStrip: false,\n referenceStripScroll: 'horizontal',\n referenceStripElement: null,\n referenceStripHeight: null,\n referenceStripWidth: null,\n referenceStripPosition: 'BOTTOM_LEFT',\n referenceStripSizeRatio: 0.2,\n\n //COLLECTION VISUALIZATION SETTINGS\n collectionRows: 3, //or columns depending on layout\n collectionColumns: 0, //columns in horizontal layout, rows in vertical layout\n collectionLayout: 'horizontal', //vertical\n collectionMode: false,\n collectionTileSize: 800,\n collectionTileMargin: 80,\n\n //PERFORMANCE SETTINGS\n imageLoaderLimit: 0,\n maxImageCacheCount: 200,\n timeout: 30000,\n useCanvas: true, // Use canvas element for drawing if available\n\n //INTERFACE RESOURCE SETTINGS\n prefixUrl: \"/images/\",\n navImages: {\n zoomIn: {\n REST: 'zoomin_rest.png',\n GROUP: 'zoomin_grouphover.png',\n HOVER: 'zoomin_hover.png',\n DOWN: 'zoomin_pressed.png'\n },\n zoomOut: {\n REST: 'zoomout_rest.png',\n GROUP: 'zoomout_grouphover.png',\n HOVER: 'zoomout_hover.png',\n DOWN: 'zoomout_pressed.png'\n },\n home: {\n REST: 'home_rest.png',\n GROUP: 'home_grouphover.png',\n HOVER: 'home_hover.png',\n DOWN: 'home_pressed.png'\n },\n fullpage: {\n REST: 'fullpage_rest.png',\n GROUP: 'fullpage_grouphover.png',\n HOVER: 'fullpage_hover.png',\n DOWN: 'fullpage_pressed.png'\n },\n rotateleft: {\n REST: 'rotateleft_rest.png',\n GROUP: 'rotateleft_grouphover.png',\n HOVER: 'rotateleft_hover.png',\n DOWN: 'rotateleft_pressed.png'\n },\n rotateright: {\n REST: 'rotateright_rest.png',\n GROUP: 'rotateright_grouphover.png',\n HOVER: 'rotateright_hover.png',\n DOWN: 'rotateright_pressed.png'\n },\n flip: { // Flip icon designed by Yaroslav Samoylov from the Noun Project and modified by Nelson Campos ncampos@criteriamarathon.com, https://thenounproject.com/term/flip/136289/\n REST: 'flip_rest.png',\n GROUP: 'flip_grouphover.png',\n HOVER: 'flip_hover.png',\n DOWN: 'flip_pressed.png'\n },\n previous: {\n REST: 'previous_rest.png',\n GROUP: 'previous_grouphover.png',\n HOVER: 'previous_hover.png',\n DOWN: 'previous_pressed.png'\n },\n next: {\n REST: 'next_rest.png',\n GROUP: 'next_grouphover.png',\n HOVER: 'next_hover.png',\n DOWN: 'next_pressed.png'\n }\n },\n\n //DEVELOPER SETTINGS\n debugMode: false,\n debugGridColor: ['#437AB2', '#1B9E77', '#D95F02', '#7570B3', '#E7298A', '#66A61E', '#E6AB02', '#A6761D', '#666666']\n },\n\n\n /**\n * TODO: get rid of this. I can't see how it's required at all. Looks\n * like an early legacy code artifact.\n * @static\n * @ignore\n */\n SIGNAL: \"----seadragon----\",\n\n\n /**\n * Returns a function which invokes the method as if it were a method belonging to the object.\n * @function\n * @param {Object} object\n * @param {Function} method\n * @returns {Function}\n */\n delegate: function( object, method ) {\n return function(){\n var args = arguments;\n if ( args === undefined ){\n args = [];\n }\n return method.apply( object, args );\n };\n },\n\n\n /**\n * An enumeration of Browser vendors.\n * @static\n * @type {Object}\n * @property {Number} UNKNOWN\n * @property {Number} IE\n * @property {Number} FIREFOX\n * @property {Number} SAFARI\n * @property {Number} CHROME\n * @property {Number} OPERA\n */\n BROWSERS: {\n UNKNOWN: 0,\n IE: 1,\n FIREFOX: 2,\n SAFARI: 3,\n CHROME: 4,\n OPERA: 5\n },\n\n\n /**\n * Returns a DOM Element for the given id or element.\n * @function\n * @param {String|Element} element Accepts an id or element.\n * @returns {Element} The element with the given id, null, or the element itself.\n */\n getElement: function( element ) {\n if ( typeof ( element ) == \"string\" ) {\n element = document.getElementById( element );\n }\n return element;\n },\n\n\n /**\n * Determines the position of the upper-left corner of the element.\n * @function\n * @param {Element|String} element - the element we want the position for.\n * @returns {OpenSeadragon.Point} - the position of the upper left corner of the element.\n */\n getElementPosition: function( element ) {\n var result = new $.Point(),\n isFixed,\n offsetParent;\n\n element = $.getElement( element );\n isFixed = $.getElementStyle( element ).position == \"fixed\";\n offsetParent = getOffsetParent( element, isFixed );\n\n while ( offsetParent ) {\n\n result.x += element.offsetLeft;\n result.y += element.offsetTop;\n\n if ( isFixed ) {\n result = result.plus( $.getPageScroll() );\n }\n\n element = offsetParent;\n isFixed = $.getElementStyle( element ).position == \"fixed\";\n offsetParent = getOffsetParent( element, isFixed );\n }\n\n return result;\n },\n\n\n /**\n * Determines the position of the upper-left corner of the element adjusted for current page and/or element scroll.\n * @function\n * @param {Element|String} element - the element we want the position for.\n * @returns {OpenSeadragon.Point} - the position of the upper left corner of the element adjusted for current page and/or element scroll.\n */\n getElementOffset: function( element ) {\n element = $.getElement( element );\n\n var doc = element && element.ownerDocument,\n docElement,\n win,\n boundingRect = { top: 0, left: 0 };\n\n if ( !doc ) {\n return new $.Point();\n }\n\n docElement = doc.documentElement;\n\n if ( typeof element.getBoundingClientRect !== typeof undefined ) {\n boundingRect = element.getBoundingClientRect();\n }\n\n win = ( doc == doc.window ) ?\n doc :\n ( doc.nodeType === 9 ) ?\n doc.defaultView || doc.parentWindow :\n false;\n\n return new $.Point(\n boundingRect.left + ( win.pageXOffset || docElement.scrollLeft ) - ( docElement.clientLeft || 0 ),\n boundingRect.top + ( win.pageYOffset || docElement.scrollTop ) - ( docElement.clientTop || 0 )\n );\n },\n\n\n /**\n * Determines the height and width of the given element.\n * @function\n * @param {Element|String} element\n * @returns {OpenSeadragon.Point}\n */\n getElementSize: function( element ) {\n element = $.getElement( element );\n\n return new $.Point(\n element.clientWidth,\n element.clientHeight\n );\n },\n\n\n /**\n * Returns the CSSStyle object for the given element.\n * @function\n * @param {Element|String} element\n * @returns {CSSStyle}\n */\n getElementStyle:\n document.documentElement.currentStyle ?\n function( element ) {\n element = $.getElement( element );\n return element.currentStyle;\n } :\n function( element ) {\n element = $.getElement( element );\n return window.getComputedStyle( element, \"\" );\n },\n\n /**\n * Returns the property with the correct vendor prefix appended.\n * @param {String} property the property name\n * @returns {String} the property with the correct prefix or null if not\n * supported.\n */\n getCssPropertyWithVendorPrefix: function(property) {\n var memo = {};\n\n $.getCssPropertyWithVendorPrefix = function(property) {\n if (memo[property] !== undefined) {\n return memo[property];\n }\n var style = document.createElement('div').style;\n var result = null;\n if (style[property] !== undefined) {\n result = property;\n } else {\n var prefixes = ['Webkit', 'Moz', 'MS', 'O',\n 'webkit', 'moz', 'ms', 'o'];\n var suffix = $.capitalizeFirstLetter(property);\n for (var i = 0; i < prefixes.length; i++) {\n var prop = prefixes[i] + suffix;\n if (style[prop] !== undefined) {\n result = prop;\n break;\n }\n }\n }\n memo[property] = result;\n return result;\n };\n return $.getCssPropertyWithVendorPrefix(property);\n },\n\n /**\n * Capitalizes the first letter of a string\n * @param {String} string\n * @returns {String} The string with the first letter capitalized\n */\n capitalizeFirstLetter: function(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n },\n\n /**\n * Compute the modulo of a number but makes sure to always return\n * a positive value.\n * @param {Number} number the number to computes the modulo of\n * @param {Number} modulo the modulo\n * @returns {Number} the result of the modulo of number\n */\n positiveModulo: function(number, modulo) {\n var result = number % modulo;\n if (result < 0) {\n result += modulo;\n }\n return result;\n },\n\n /**\n * Determines if a point is within the bounding rectangle of the given element (hit-test).\n * @function\n * @param {Element|String} element\n * @param {OpenSeadragon.Point} point\n * @returns {Boolean}\n */\n pointInElement: function( element, point ) {\n element = $.getElement( element );\n var offset = $.getElementOffset( element ),\n size = $.getElementSize( element );\n return point.x >= offset.x && point.x < offset.x + size.x && point.y < offset.y + size.y && point.y >= offset.y;\n },\n\n\n /**\n * Gets the latest event, really only useful internally since its\n * specific to IE behavior.\n * @function\n * @param {Event} [event]\n * @returns {Event}\n * @deprecated For internal use only\n * @private\n */\n getEvent: function( event ) {\n if( event ){\n $.getEvent = function( event ) {\n return event;\n };\n } else {\n $.getEvent = function() {\n return window.event;\n };\n }\n return $.getEvent( event );\n },\n\n\n /**\n * Gets the position of the mouse on the screen for a given event.\n * @function\n * @param {Event} [event]\n * @returns {OpenSeadragon.Point}\n */\n getMousePosition: function( event ) {\n\n if ( typeof ( event.pageX ) == \"number\" ) {\n $.getMousePosition = function( event ){\n var result = new $.Point();\n\n event = $.getEvent( event );\n result.x = event.pageX;\n result.y = event.pageY;\n\n return result;\n };\n } else if ( typeof ( event.clientX ) == \"number\" ) {\n $.getMousePosition = function( event ){\n var result = new $.Point();\n\n event = $.getEvent( event );\n result.x =\n event.clientX +\n document.body.scrollLeft +\n document.documentElement.scrollLeft;\n result.y =\n event.clientY +\n document.body.scrollTop +\n document.documentElement.scrollTop;\n\n return result;\n };\n } else {\n throw new Error(\n \"Unknown event mouse position, no known technique.\"\n );\n }\n\n return $.getMousePosition( event );\n },\n\n\n /**\n * Determines the page's current scroll position.\n * @function\n * @returns {OpenSeadragon.Point}\n */\n getPageScroll: function() {\n var docElement = document.documentElement || {},\n body = document.body || {};\n\n if ( typeof ( window.pageXOffset ) == \"number\" ) {\n $.getPageScroll = function(){\n return new $.Point(\n window.pageXOffset,\n window.pageYOffset\n );\n };\n } else if ( body.scrollLeft || body.scrollTop ) {\n $.getPageScroll = function(){\n return new $.Point(\n document.body.scrollLeft,\n document.body.scrollTop\n );\n };\n } else if ( docElement.scrollLeft || docElement.scrollTop ) {\n $.getPageScroll = function(){\n return new $.Point(\n document.documentElement.scrollLeft,\n document.documentElement.scrollTop\n );\n };\n } else {\n // We can't reassign the function yet, as there was no scroll.\n return new $.Point(0, 0);\n }\n\n return $.getPageScroll();\n },\n\n /**\n * Set the page scroll position.\n * @function\n * @returns {OpenSeadragon.Point}\n */\n setPageScroll: function( scroll ) {\n if ( typeof ( window.scrollTo ) !== \"undefined\" ) {\n $.setPageScroll = function( scroll ) {\n window.scrollTo( scroll.x, scroll.y );\n };\n } else {\n var originalScroll = $.getPageScroll();\n if ( originalScroll.x === scroll.x &&\n originalScroll.y === scroll.y ) {\n // We are already correctly positioned and there\n // is no way to detect the correct method.\n return;\n }\n\n document.body.scrollLeft = scroll.x;\n document.body.scrollTop = scroll.y;\n var currentScroll = $.getPageScroll();\n if ( currentScroll.x !== originalScroll.x &&\n currentScroll.y !== originalScroll.y ) {\n $.setPageScroll = function( scroll ) {\n document.body.scrollLeft = scroll.x;\n document.body.scrollTop = scroll.y;\n };\n return;\n }\n\n document.documentElement.scrollLeft = scroll.x;\n document.documentElement.scrollTop = scroll.y;\n currentScroll = $.getPageScroll();\n if ( currentScroll.x !== originalScroll.x &&\n currentScroll.y !== originalScroll.y ) {\n $.setPageScroll = function( scroll ) {\n document.documentElement.scrollLeft = scroll.x;\n document.documentElement.scrollTop = scroll.y;\n };\n return;\n }\n\n // We can't find anything working, so we do nothing.\n $.setPageScroll = function( scroll ) {\n };\n }\n\n return $.setPageScroll( scroll );\n },\n\n /**\n * Determines the size of the browsers window.\n * @function\n * @returns {OpenSeadragon.Point}\n */\n getWindowSize: function() {\n var docElement = document.documentElement || {},\n body = document.body || {};\n\n if ( typeof ( window.innerWidth ) == 'number' ) {\n $.getWindowSize = function(){\n return new $.Point(\n window.innerWidth,\n window.innerHeight\n );\n };\n } else if ( docElement.clientWidth || docElement.clientHeight ) {\n $.getWindowSize = function(){\n return new $.Point(\n document.documentElement.clientWidth,\n document.documentElement.clientHeight\n );\n };\n } else if ( body.clientWidth || body.clientHeight ) {\n $.getWindowSize = function(){\n return new $.Point(\n document.body.clientWidth,\n document.body.clientHeight\n );\n };\n } else {\n throw new Error(\"Unknown window size, no known technique.\");\n }\n\n return $.getWindowSize();\n },\n\n\n /**\n * Wraps the given element in a nest of divs so that the element can\n * be easily centered using CSS tables\n * @function\n * @param {Element|String} element\n * @returns {Element} outermost wrapper element\n */\n makeCenteredNode: function( element ) {\n // Convert a possible ID to an actual HTMLElement\n element = $.getElement( element );\n\n /*\n CSS tables require you to have a display:table/row/cell hierarchy so we need to create\n three nested wrapper divs:\n */\n\n var wrappers = [\n $.makeNeutralElement( 'div' ),\n $.makeNeutralElement( 'div' ),\n $.makeNeutralElement( 'div' )\n ];\n\n // It feels like we should be able to pass style dicts to makeNeutralElement:\n $.extend(wrappers[0].style, {\n display: \"table\",\n height: \"100%\",\n width: \"100%\"\n });\n\n $.extend(wrappers[1].style, {\n display: \"table-row\"\n });\n\n $.extend(wrappers[2].style, {\n display: \"table-cell\",\n verticalAlign: \"middle\",\n textAlign: \"center\"\n });\n\n wrappers[0].appendChild(wrappers[1]);\n wrappers[1].appendChild(wrappers[2]);\n wrappers[2].appendChild(element);\n\n return wrappers[0];\n },\n\n\n /**\n * Creates an easily positionable element of the given type that therefor\n * serves as an excellent container element.\n * @function\n * @param {String} tagName\n * @returns {Element}\n */\n makeNeutralElement: function( tagName ) {\n var element = document.createElement( tagName ),\n style = element.style;\n\n style.background = \"transparent none\";\n style.border = \"none\";\n style.margin = \"0px\";\n style.padding = \"0px\";\n style.position = \"static\";\n\n return element;\n },\n\n\n /**\n * Returns the current milliseconds, using Date.now() if available\n * @function\n */\n now: function( ) {\n if (Date.now) {\n $.now = Date.now;\n } else {\n $.now = function() {\n return new Date().getTime();\n };\n }\n\n return $.now();\n },\n\n\n /**\n * Ensures an image is loaded correctly to support alpha transparency.\n * Generally only IE has issues doing this correctly for formats like\n * png.\n * @function\n * @param {String} src\n * @returns {Element}\n */\n makeTransparentImage: function( src ) {\n\n $.makeTransparentImage = function( src ){\n var img = $.makeNeutralElement( \"img\" );\n\n img.src = src;\n\n return img;\n };\n\n if ( $.Browser.vendor == $.BROWSERS.IE && $.Browser.version < 7 ) {\n\n $.makeTransparentImage = function( src ){\n var img = $.makeNeutralElement( \"img\" ),\n element = null;\n\n element = $.makeNeutralElement(\"span\");\n element.style.display = \"inline-block\";\n\n img.onload = function() {\n element.style.width = element.style.width || img.width + \"px\";\n element.style.height = element.style.height || img.height + \"px\";\n\n img.onload = null;\n img = null; // to prevent memory leaks in IE\n };\n\n img.src = src;\n element.style.filter =\n \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" +\n src +\n \"', sizingMethod='scale')\";\n\n return element;\n };\n\n }\n\n return $.makeTransparentImage( src );\n },\n\n\n /**\n * Sets the opacity of the specified element.\n * @function\n * @param {Element|String} element\n * @param {Number} opacity\n * @param {Boolean} [usesAlpha]\n */\n setElementOpacity: function( element, opacity, usesAlpha ) {\n\n var ieOpacity,\n ieFilter;\n\n element = $.getElement( element );\n\n if ( usesAlpha && !$.Browser.alpha ) {\n opacity = Math.round( opacity );\n }\n\n if ( $.Browser.opacity ) {\n element.style.opacity = opacity < 1 ? opacity : \"\";\n } else {\n if ( opacity < 1 ) {\n ieOpacity = Math.round( 100 * opacity );\n ieFilter = \"alpha(opacity=\" + ieOpacity + \")\";\n element.style.filter = ieFilter;\n } else {\n element.style.filter = \"\";\n }\n }\n },\n\n\n /**\n * Sets the specified element's touch-action style attribute to 'none'.\n * @function\n * @param {Element|String} element\n */\n setElementTouchActionNone: function( element ) {\n element = $.getElement( element );\n if ( typeof element.style.touchAction !== 'undefined' ) {\n element.style.touchAction = 'none';\n } else if ( typeof element.style.msTouchAction !== 'undefined' ) {\n element.style.msTouchAction = 'none';\n }\n },\n\n\n /**\n * Add the specified CSS class to the element if not present.\n * @function\n * @param {Element|String} element\n * @param {String} className\n */\n addClass: function( element, className ) {\n element = $.getElement( element );\n\n if (!element.className) {\n element.className = className;\n } else if ( ( ' ' + element.className + ' ' ).\n indexOf( ' ' + className + ' ' ) === -1 ) {\n element.className += ' ' + className;\n }\n },\n\n /**\n * Find the first index at which an element is found in an array or -1\n * if not present.\n *\n * Code taken and adapted from\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Compatibility\n *\n * @function\n * @param {Array} array The array from which to find the element\n * @param {Object} searchElement The element to find\n * @param {Number} [fromIndex=0] Index to start research.\n * @returns {Number} The index of the element in the array.\n */\n indexOf: function( array, searchElement, fromIndex ) {\n if ( Array.prototype.indexOf ) {\n this.indexOf = function( array, searchElement, fromIndex ) {\n return array.indexOf( searchElement, fromIndex );\n };\n } else {\n this.indexOf = function( array, searchElement, fromIndex ) {\n var i,\n pivot = ( fromIndex ) ? fromIndex : 0,\n length;\n if ( !array ) {\n throw new TypeError( );\n }\n\n length = array.length;\n if ( length === 0 || pivot >= length ) {\n return -1;\n }\n\n if ( pivot < 0 ) {\n pivot = length - Math.abs( pivot );\n }\n\n for ( i = pivot; i < length; i++ ) {\n if ( array[i] === searchElement ) {\n return i;\n }\n }\n return -1;\n };\n }\n return this.indexOf( array, searchElement, fromIndex );\n },\n\n /**\n * Remove the specified CSS class from the element.\n * @function\n * @param {Element|String} element\n * @param {String} className\n */\n removeClass: function( element, className ) {\n var oldClasses,\n newClasses = [],\n i;\n\n element = $.getElement( element );\n oldClasses = element.className.split( /\\s+/ );\n for ( i = 0; i < oldClasses.length; i++ ) {\n if ( oldClasses[ i ] && oldClasses[ i ] !== className ) {\n newClasses.push( oldClasses[ i ] );\n }\n }\n element.className = newClasses.join(' ');\n },\n\n\n /**\n * Adds an event listener for the given element, eventName and handler.\n * @function\n * @param {Element|String} element\n * @param {String} eventName\n * @param {Function} handler\n * @param {Boolean} [useCapture]\n */\n addEvent: (function () {\n if ( window.addEventListener ) {\n return function ( element, eventName, handler, useCapture ) {\n element = $.getElement( element );\n element.addEventListener( eventName, handler, useCapture );\n };\n } else if ( window.attachEvent ) {\n return function ( element, eventName, handler, useCapture ) {\n element = $.getElement( element );\n element.attachEvent( 'on' + eventName, handler );\n };\n } else {\n throw new Error( \"No known event model.\" );\n }\n }()),\n\n\n /**\n * Remove a given event listener for the given element, event type and\n * handler.\n * @function\n * @param {Element|String} element\n * @param {String} eventName\n * @param {Function} handler\n * @param {Boolean} [useCapture]\n */\n removeEvent: (function () {\n if ( window.removeEventListener ) {\n return function ( element, eventName, handler, useCapture ) {\n element = $.getElement( element );\n element.removeEventListener( eventName, handler, useCapture );\n };\n } else if ( window.detachEvent ) {\n return function( element, eventName, handler, useCapture ) {\n element = $.getElement( element );\n element.detachEvent( 'on' + eventName, handler );\n };\n } else {\n throw new Error( \"No known event model.\" );\n }\n }()),\n\n\n /**\n * Cancels the default browser behavior had the event propagated all\n * the way up the DOM to the window object.\n * @function\n * @param {Event} [event]\n */\n cancelEvent: function( event ) {\n event = $.getEvent( event );\n\n if ( event.preventDefault ) {\n $.cancelEvent = function( event ){\n // W3C for preventing default\n event.preventDefault();\n };\n } else {\n $.cancelEvent = function( event ){\n event = $.getEvent( event );\n // legacy for preventing default\n event.cancel = true;\n // IE for preventing default\n event.returnValue = false;\n };\n }\n $.cancelEvent( event );\n },\n\n\n /**\n * Stops the propagation of the event up the DOM.\n * @function\n * @param {Event} [event]\n */\n stopEvent: function( event ) {\n event = $.getEvent( event );\n\n if ( event.stopPropagation ) {\n // W3C for stopping propagation\n $.stopEvent = function( event ){\n event.stopPropagation();\n };\n } else {\n // IE for stopping propagation\n $.stopEvent = function( event ){\n event = $.getEvent( event );\n event.cancelBubble = true;\n };\n\n }\n\n $.stopEvent( event );\n },\n\n\n /**\n * Similar to OpenSeadragon.delegate, but it does not immediately call\n * the method on the object, returning a function which can be called\n * repeatedly to delegate the method. It also allows additional arguments\n * to be passed during construction which will be added during each\n * invocation, and each invocation can add additional arguments as well.\n *\n * @function\n * @param {Object} object\n * @param {Function} method\n * @param [args] any additional arguments are passed as arguments to the\n * created callback\n * @returns {Function}\n */\n createCallback: function( object, method ) {\n //TODO: This pattern is painful to use and debug. It's much cleaner\n // to use pinning plus anonymous functions. Get rid of this\n // pattern!\n var initialArgs = [],\n i;\n for ( i = 2; i < arguments.length; i++ ) {\n initialArgs.push( arguments[ i ] );\n }\n\n return function() {\n var args = initialArgs.concat( [] ),\n i;\n for ( i = 0; i < arguments.length; i++ ) {\n args.push( arguments[ i ] );\n }\n\n return method.apply( object, args );\n };\n },\n\n\n /**\n * Retrieves the value of a url parameter from the window.location string.\n * @function\n * @param {String} key\n * @returns {String} The value of the url parameter or null if no param matches.\n */\n getUrlParameter: function( key ) {\n // eslint-disable-next-line no-use-before-define\n var value = URLPARAMS[ key ];\n return value ? value : null;\n },\n\n /**\n * Retrieves the protocol used by the url. The url can either be absolute\n * or relative.\n * @function\n * @private\n * @param {String} url The url to retrieve the protocol from.\n * @return {String} The protocol (http:, https:, file:, ftp: ...)\n */\n getUrlProtocol: function( url ) {\n var match = url.match(/^([a-z]+:)\\/\\//i);\n if ( match === null ) {\n // Relative URL, retrive the protocol from window.location\n return window.location.protocol;\n }\n return match[1].toLowerCase();\n },\n\n /**\n * Create an XHR object\n * @private\n * @param {type} [local] If set to true, the XHR will be file: protocol\n * compatible if possible (but may raise a warning in the browser).\n * @returns {XMLHttpRequest}\n */\n createAjaxRequest: function( local ) {\n // IE11 does not support window.ActiveXObject so we just try to\n // create one to see if it is supported.\n // See: http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx\n var supportActiveX;\n try {\n /* global ActiveXObject:true */\n supportActiveX = !!new ActiveXObject( \"Microsoft.XMLHTTP\" );\n } catch( e ) {\n supportActiveX = false;\n }\n\n if ( supportActiveX ) {\n if ( window.XMLHttpRequest ) {\n $.createAjaxRequest = function( local ) {\n if ( local ) {\n return new ActiveXObject( \"Microsoft.XMLHTTP\" );\n }\n return new XMLHttpRequest();\n };\n } else {\n $.createAjaxRequest = function() {\n return new ActiveXObject( \"Microsoft.XMLHTTP\" );\n };\n }\n } else if ( window.XMLHttpRequest ) {\n $.createAjaxRequest = function() {\n return new XMLHttpRequest();\n };\n } else {\n throw new Error( \"Browser doesn't support XMLHttpRequest.\" );\n }\n return $.createAjaxRequest( local );\n },\n\n /**\n * Makes an AJAX request.\n * @param {Object} options\n * @param {String} options.url - the url to request\n * @param {Function} options.success - a function to call on a successful response\n * @param {Function} options.error - a function to call on when an error occurs\n * @param {Object} options.headers - headers to add to the AJAX request\n * @param {String} options.responseType - the response type of the the AJAX request\n * @param {Boolean} [options.withCredentials=false] - whether to set the XHR's withCredentials\n * @throws {Error}\n * @returns {XMLHttpRequest}\n */\n makeAjaxRequest: function( url, onSuccess, onError ) {\n var withCredentials;\n var headers;\n var responseType;\n\n // Note that our preferred API is that you pass in a single object; the named\n // arguments are for legacy support.\n if( $.isPlainObject( url ) ){\n onSuccess = url.success;\n onError = url.error;\n withCredentials = url.withCredentials;\n headers = url.headers;\n responseType = url.responseType || null;\n url = url.url;\n }\n\n var protocol = $.getUrlProtocol( url );\n var request = $.createAjaxRequest( protocol === \"file:\" );\n\n if ( !$.isFunction( onSuccess ) ) {\n throw new Error( \"makeAjaxRequest requires a success callback\" );\n }\n\n request.onreadystatechange = function() {\n // 4 = DONE (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties)\n if ( request.readyState == 4 ) {\n request.onreadystatechange = function(){};\n\n // With protocols other than http/https, a successful request status is in\n // the 200's on Firefox and 0 on other browsers\n if ( (request.status >= 200 && request.status < 300) ||\n ( request.status === 0 &&\n protocol !== \"http:\" &&\n protocol !== \"https:\" )) {\n onSuccess( request );\n } else {\n $.console.log( \"AJAX request returned %d: %s\", request.status, url );\n\n if ( $.isFunction( onError ) ) {\n onError( request );\n }\n }\n }\n };\n\n try {\n request.open( \"GET\", url, true );\n\n if (responseType) {\n request.responseType = responseType;\n }\n\n if (headers) {\n for (var headerName in headers) {\n if (headers.hasOwnProperty(headerName) && headers[headerName]) {\n request.setRequestHeader(headerName, headers[headerName]);\n }\n }\n }\n\n if (withCredentials) {\n request.withCredentials = true;\n }\n\n request.send(null);\n } catch (e) {\n var msg = e.message;\n\n /*\n IE < 10 does not support CORS and an XHR request to a different origin will fail as soon\n as send() is called. This is particularly easy to miss during development and appear in\n production if you use a CDN or domain sharding and the security policy is likely to break\n exception handlers since any attempt to access a property of the request object will\n raise an access denied TypeError inside the catch block.\n\n To be friendlier, we'll check for this specific error and add a documentation pointer\n to point developers in the right direction. We test the exception number because IE's\n error messages are localized.\n */\n var oldIE = $.Browser.vendor == $.BROWSERS.IE && $.Browser.version < 10;\n if ( oldIE && typeof ( e.number ) != \"undefined\" && e.number == -2147024891 ) {\n msg += \"\\nSee http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#xdomain\";\n }\n\n $.console.log( \"%s while making AJAX request: %s\", e.name, msg );\n\n request.onreadystatechange = function(){};\n\n if (window.XDomainRequest) { // IE9 or IE8 might as well try to use XDomainRequest\n var xdr = new XDomainRequest();\n if (xdr) {\n xdr.onload = function (e) {\n if ( $.isFunction( onSuccess ) ) {\n onSuccess({ // Faking an xhr object\n responseText: xdr.responseText,\n status: 200, // XDomainRequest doesn't support status codes, so we just fake one! :/\n statusText: 'OK'\n });\n }\n };\n xdr.onerror = function (e) {\n if ($.isFunction(onError)) {\n onError({ // Faking an xhr object\n responseText: xdr.responseText,\n status: 444, // 444 No Response\n statusText: 'An error happened. Due to an XDomainRequest deficiency we can not extract any information about this error. Upgrade your browser.'\n });\n }\n };\n try {\n xdr.open('GET', url);\n xdr.send();\n } catch (e2) {\n if ( $.isFunction( onError ) ) {\n onError( request, e );\n }\n }\n }\n } else {\n if ( $.isFunction( onError ) ) {\n onError( request, e );\n }\n }\n }\n\n return request;\n },\n\n /**\n * Taken from jQuery 1.6.1\n * @function\n * @param {Object} options\n * @param {String} options.url\n * @param {Function} options.callback\n * @param {String} [options.param='callback'] The name of the url parameter\n * to request the jsonp provider with.\n * @param {String} [options.callbackName=] The name of the callback to\n * request the jsonp provider with.\n */\n jsonp: function( options ){\n var script,\n url = options.url,\n head = document.head ||\n document.getElementsByTagName( \"head\" )[ 0 ] ||\n document.documentElement,\n jsonpCallback = options.callbackName || 'openseadragon' + $.now(),\n previous = window[ jsonpCallback ],\n replace = \"$1\" + jsonpCallback + \"$2\",\n callbackParam = options.param || 'callback',\n callback = options.callback;\n\n url = url.replace( /(\\=)\\?(&|$)|\\?\\?/i, replace );\n // Add callback manually\n url += (/\\?/.test( url ) ? \"&\" : \"?\") + callbackParam + \"=\" + jsonpCallback;\n\n // Install callback\n window[ jsonpCallback ] = function( response ) {\n if ( !previous ){\n try{\n delete window[ jsonpCallback ];\n }catch(e){\n //swallow\n }\n } else {\n window[ jsonpCallback ] = previous;\n }\n if( callback && $.isFunction( callback ) ){\n callback( response );\n }\n };\n\n script = document.createElement( \"script\" );\n\n //TODO: having an issue with async info requests\n if( undefined !== options.async || false !== options.async ){\n script.async = \"async\";\n }\n\n if ( options.scriptCharset ) {\n script.charset = options.scriptCharset;\n }\n\n script.src = url;\n\n // Attach handlers for all browsers\n script.onload = script.onreadystatechange = function( _, isAbort ) {\n\n if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {\n\n // Handle memory leak in IE\n script.onload = script.onreadystatechange = null;\n\n // Remove the script\n if ( head && script.parentNode ) {\n head.removeChild( script );\n }\n\n // Dereference the script\n script = undefined;\n }\n };\n // Use insertBefore instead of appendChild to circumvent an IE6 bug.\n // This arises when a base node is used (#2709 and #4378).\n head.insertBefore( script, head.firstChild );\n\n },\n\n\n /**\n * Fully deprecated. Will throw an error.\n * @function\n * @deprecated use {@link OpenSeadragon.Viewer#open}\n */\n createFromDZI: function() {\n throw \"OpenSeadragon.createFromDZI is deprecated, use Viewer.open.\";\n },\n\n /**\n * Parses an XML string into a DOM Document.\n * @function\n * @param {String} string\n * @returns {Document}\n */\n parseXml: function( string ) {\n if ( window.DOMParser ) {\n\n $.parseXml = function( string ) {\n var xmlDoc = null,\n parser;\n\n parser = new DOMParser();\n xmlDoc = parser.parseFromString( string, \"text/xml\" );\n return xmlDoc;\n };\n\n } else if ( window.ActiveXObject ) {\n\n $.parseXml = function( string ) {\n var xmlDoc = null;\n\n xmlDoc = new ActiveXObject( \"Microsoft.XMLDOM\" );\n xmlDoc.async = false;\n xmlDoc.loadXML( string );\n return xmlDoc;\n };\n\n } else {\n throw new Error( \"Browser doesn't support XML DOM.\" );\n }\n\n return $.parseXml( string );\n },\n\n /**\n * Parses a JSON string into a Javascript object.\n * @function\n * @param {String} string\n * @returns {Object}\n */\n parseJSON: function(string) {\n if (window.JSON && window.JSON.parse) {\n $.parseJSON = window.JSON.parse;\n } else {\n // Should only be used by IE8 in non standards mode\n $.parseJSON = function(string) {\n /*jshint evil:true*/\n //eslint-disable-next-line no-eval\n return eval('(' + string + ')');\n };\n }\n return $.parseJSON(string);\n },\n\n /**\n * Reports whether the image format is supported for tiling in this\n * version.\n * @function\n * @param {String} [extension]\n * @returns {Boolean}\n */\n imageFormatSupported: function( extension ) {\n extension = extension ? extension : \"\";\n // eslint-disable-next-line no-use-before-define\n return !!FILEFORMATS[ extension.toLowerCase() ];\n }\n\n });\n\n\n /**\n * The current browser vendor, version, and related information regarding detected features.\n * @member {Object} Browser\n * @memberof OpenSeadragon\n * @static\n * @type {Object}\n * @property {OpenSeadragon.BROWSERS} vendor - One of the {@link OpenSeadragon.BROWSERS} enumeration values.\n * @property {Number} version\n * @property {Boolean} alpha - Does the browser support image alpha transparency.\n */\n $.Browser = {\n vendor: $.BROWSERS.UNKNOWN,\n version: 0,\n alpha: true\n };\n\n\n var FILEFORMATS = {\n \"bmp\": false,\n \"jpeg\": true,\n \"jpg\": true,\n \"png\": true,\n \"tif\": false,\n \"wdp\": false\n },\n URLPARAMS = {};\n\n (function() {\n //A small auto-executing routine to determine the browser vendor,\n //version and supporting feature sets.\n var ver = navigator.appVersion,\n ua = navigator.userAgent,\n regex;\n\n //console.error( 'appName: ' + navigator.appName );\n //console.error( 'appVersion: ' + navigator.appVersion );\n //console.error( 'userAgent: ' + navigator.userAgent );\n\n switch( navigator.appName ){\n case \"Microsoft Internet Explorer\":\n if( !!window.attachEvent &&\n !!window.ActiveXObject ) {\n\n $.Browser.vendor = $.BROWSERS.IE;\n $.Browser.version = parseFloat(\n ua.substring(\n ua.indexOf( \"MSIE\" ) + 5,\n ua.indexOf( \";\", ua.indexOf( \"MSIE\" ) ) )\n );\n }\n break;\n case \"Netscape\":\n if (window.addEventListener) {\n if ( ua.indexOf( \"Firefox\" ) >= 0 ) {\n $.Browser.vendor = $.BROWSERS.FIREFOX;\n $.Browser.version = parseFloat(\n ua.substring( ua.indexOf( \"Firefox\" ) + 8 )\n );\n } else if ( ua.indexOf( \"Safari\" ) >= 0 ) {\n $.Browser.vendor = ua.indexOf( \"Chrome\" ) >= 0 ?\n $.BROWSERS.CHROME :\n $.BROWSERS.SAFARI;\n $.Browser.version = parseFloat(\n ua.substring(\n ua.substring( 0, ua.indexOf( \"Safari\" ) ).lastIndexOf( \"/\" ) + 1,\n ua.indexOf( \"Safari\" )\n )\n );\n } else {\n regex = new RegExp( \"Trident/.*rv:([0-9]{1,}[.0-9]{0,})\");\n if ( regex.exec( ua ) !== null ) {\n $.Browser.vendor = $.BROWSERS.IE;\n $.Browser.version = parseFloat( RegExp.$1 );\n }\n }\n }\n break;\n case \"Opera\":\n $.Browser.vendor = $.BROWSERS.OPERA;\n $.Browser.version = parseFloat( ver );\n break;\n }\n\n // ignore '?' portion of query string\n var query = window.location.search.substring( 1 ),\n parts = query.split('&'),\n part,\n sep,\n i;\n\n for ( i = 0; i < parts.length; i++ ) {\n part = parts[ i ];\n sep = part.indexOf( '=' );\n\n if ( sep > 0 ) {\n URLPARAMS[ part.substring( 0, sep ) ] =\n decodeURIComponent( part.substring( sep + 1 ) );\n }\n }\n\n //determine if this browser supports image alpha transparency\n $.Browser.alpha = !(\n (\n $.Browser.vendor == $.BROWSERS.IE &&\n $.Browser.version < 9\n ) || (\n $.Browser.vendor == $.BROWSERS.CHROME &&\n $.Browser.version < 2\n )\n );\n\n //determine if this browser supports element.style.opacity\n $.Browser.opacity = !(\n $.Browser.vendor == $.BROWSERS.IE &&\n $.Browser.version < 9\n );\n\n })();\n\n\n //TODO: $.console is often used inside a try/catch block which generally\n // prevents allowings errors to occur with detection until a debugger\n // is attached. Although I've been guilty of the same anti-pattern\n // I eventually was convinced that errors should naturally propagate in\n // all but the most special cases.\n /**\n * A convenient alias for console when available, and a simple null\n * function when console is unavailable.\n * @static\n * @private\n */\n var nullfunction = function( msg ){\n //document.location.hash = msg;\n };\n\n $.console = window.console || {\n log: nullfunction,\n debug: nullfunction,\n info: nullfunction,\n warn: nullfunction,\n error: nullfunction,\n assert: nullfunction\n };\n\n\n // Adding support for HTML5's requestAnimationFrame as suggested by acdha.\n // Implementation taken from matt synder's post here:\n // http://mattsnider.com/cross-browser-and-legacy-supported-requestframeanimation/\n (function( w ) {\n\n // most browsers have an implementation\n var requestAnimationFrame = w.requestAnimationFrame ||\n w.mozRequestAnimationFrame ||\n w.webkitRequestAnimationFrame ||\n w.msRequestAnimationFrame;\n\n var cancelAnimationFrame = w.cancelAnimationFrame ||\n w.mozCancelAnimationFrame ||\n w.webkitCancelAnimationFrame ||\n w.msCancelAnimationFrame;\n\n // polyfill, when necessary\n if ( requestAnimationFrame && cancelAnimationFrame ) {\n // We can't assign these window methods directly to $ because they\n // expect their \"this\" to be \"window\", so we call them in wrappers.\n $.requestAnimationFrame = function(){\n return requestAnimationFrame.apply( w, arguments );\n };\n $.cancelAnimationFrame = function(){\n return cancelAnimationFrame.apply( w, arguments );\n };\n } else {\n var aAnimQueue = [],\n processing = [],\n iRequestId = 0,\n iIntervalId;\n\n // create a mock requestAnimationFrame function\n $.requestAnimationFrame = function( callback ) {\n aAnimQueue.push( [ ++iRequestId, callback ] );\n\n if ( !iIntervalId ) {\n iIntervalId = setInterval( function() {\n if ( aAnimQueue.length ) {\n var time = $.now();\n // Process all of the currently outstanding frame\n // requests, but none that get added during the\n // processing.\n // Swap the arrays so we don't have to create a new\n // array every frame.\n var temp = processing;\n processing = aAnimQueue;\n aAnimQueue = temp;\n while ( processing.length ) {\n processing.shift()[ 1 ]( time );\n }\n } else {\n // don't continue the interval, if unnecessary\n clearInterval( iIntervalId );\n iIntervalId = undefined;\n }\n }, 1000 / 50); // estimating support for 50 frames per second\n }\n\n return iRequestId;\n };\n\n // create a mock cancelAnimationFrame function\n $.cancelAnimationFrame = function( requestId ) {\n // find the request ID and remove it\n var i, j;\n for ( i = 0, j = aAnimQueue.length; i < j; i += 1 ) {\n if ( aAnimQueue[ i ][ 0 ] === requestId ) {\n aAnimQueue.splice( i, 1 );\n return;\n }\n }\n\n // If it's not in the queue, it may be in the set we're currently\n // processing (if cancelAnimationFrame is called from within a\n // requestAnimationFrame callback).\n for ( i = 0, j = processing.length; i < j; i += 1 ) {\n if ( processing[ i ][ 0 ] === requestId ) {\n processing.splice( i, 1 );\n return;\n }\n }\n };\n }\n })( window );\n\n /**\n * @private\n * @inner\n * @function\n * @param {Element} element\n * @param {Boolean} [isFixed]\n * @returns {Element}\n */\n function getOffsetParent( element, isFixed ) {\n if ( isFixed && element != document.body ) {\n return document.body;\n } else {\n return element.offsetParent;\n }\n }\n\n}(OpenSeadragon));\n\n\n// Universal Module Definition, supports CommonJS, AMD and simple script tag\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // expose as amd module\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n // expose as commonjs module\n module.exports = factory();\n } else {\n // expose as window.OpenSeadragon\n root.OpenSeadragon = factory();\n }\n}(this, function () {\n return OpenSeadragon;\n}));\n\n/*\n * OpenSeadragon - full-screen support functions\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ) {\n /**\n * Determine native full screen support we can get from the browser.\n * @member fullScreenApi\n * @memberof OpenSeadragon\n * @type {object}\n * @property {Boolean} supportsFullScreen Return true if full screen API is supported.\n * @property {Function} isFullScreen Return true if currently in full screen mode.\n * @property {Function} getFullScreenElement Return the element currently in full screen mode.\n * @property {Function} requestFullScreen Make a request to go in full screen mode.\n * @property {Function} exitFullScreen Make a request to exit full screen mode.\n * @property {Function} cancelFullScreen Deprecated, use exitFullScreen instead.\n * @property {String} fullScreenEventName Event fired when the full screen mode change.\n * @property {String} fullScreenErrorEventName Event fired when a request to go\n * in full screen mode failed.\n */\n var fullScreenApi = {\n supportsFullScreen: false,\n isFullScreen: function() { return false; },\n getFullScreenElement: function() { return null; },\n requestFullScreen: function() {},\n exitFullScreen: function() {},\n cancelFullScreen: function() {},\n fullScreenEventName: '',\n fullScreenErrorEventName: ''\n };\n\n // check for native support\n if ( document.exitFullscreen ) {\n // W3C standard\n fullScreenApi.supportsFullScreen = true;\n fullScreenApi.getFullScreenElement = function() {\n return document.fullscreenElement;\n };\n fullScreenApi.requestFullScreen = function( element ) {\n return element.requestFullscreen();\n };\n fullScreenApi.exitFullScreen = function() {\n document.exitFullscreen();\n };\n fullScreenApi.fullScreenEventName = \"fullscreenchange\";\n fullScreenApi.fullScreenErrorEventName = \"fullscreenerror\";\n } else if ( document.msExitFullscreen ) {\n // IE 11\n fullScreenApi.supportsFullScreen = true;\n fullScreenApi.getFullScreenElement = function() {\n return document.msFullscreenElement;\n };\n fullScreenApi.requestFullScreen = function( element ) {\n return element.msRequestFullscreen();\n };\n fullScreenApi.exitFullScreen = function() {\n document.msExitFullscreen();\n };\n fullScreenApi.fullScreenEventName = \"MSFullscreenChange\";\n fullScreenApi.fullScreenErrorEventName = \"MSFullscreenError\";\n } else if ( document.webkitExitFullscreen ) {\n // Recent webkit\n fullScreenApi.supportsFullScreen = true;\n fullScreenApi.getFullScreenElement = function() {\n return document.webkitFullscreenElement;\n };\n fullScreenApi.requestFullScreen = function( element ) {\n return element.webkitRequestFullscreen();\n };\n fullScreenApi.exitFullScreen = function() {\n document.webkitExitFullscreen();\n };\n fullScreenApi.fullScreenEventName = \"webkitfullscreenchange\";\n fullScreenApi.fullScreenErrorEventName = \"webkitfullscreenerror\";\n } else if ( document.webkitCancelFullScreen ) {\n // Old webkit\n fullScreenApi.supportsFullScreen = true;\n fullScreenApi.getFullScreenElement = function() {\n return document.webkitCurrentFullScreenElement;\n };\n fullScreenApi.requestFullScreen = function( element ) {\n return element.webkitRequestFullScreen();\n };\n fullScreenApi.exitFullScreen = function() {\n document.webkitCancelFullScreen();\n };\n fullScreenApi.fullScreenEventName = \"webkitfullscreenchange\";\n fullScreenApi.fullScreenErrorEventName = \"webkitfullscreenerror\";\n } else if ( document.mozCancelFullScreen ) {\n // Firefox\n fullScreenApi.supportsFullScreen = true;\n fullScreenApi.getFullScreenElement = function() {\n return document.mozFullScreenElement;\n };\n fullScreenApi.requestFullScreen = function( element ) {\n return element.mozRequestFullScreen();\n };\n fullScreenApi.exitFullScreen = function() {\n document.mozCancelFullScreen();\n };\n fullScreenApi.fullScreenEventName = \"mozfullscreenchange\";\n fullScreenApi.fullScreenErrorEventName = \"mozfullscreenerror\";\n }\n fullScreenApi.isFullScreen = function() {\n return fullScreenApi.getFullScreenElement() !== null;\n };\n fullScreenApi.cancelFullScreen = function() {\n $.console.error(\"cancelFullScreen is deprecated. Use exitFullScreen instead.\");\n fullScreenApi.exitFullScreen();\n };\n\n // export api\n $.extend( $, fullScreenApi );\n\n})( OpenSeadragon );\n\n/*\n * OpenSeadragon - EventSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($){\n\n/**\n * Event handler method signature used by all OpenSeadragon events.\n *\n * @callback EventHandler\n * @memberof OpenSeadragon\n * @param {Object} event - See individual events for event-specific properties.\n */\n\n\n/**\n * @class EventSource\n * @classdesc For use by classes which want to support custom, non-browser events.\n *\n * @memberof OpenSeadragon\n */\n$.EventSource = function() {\n this.events = {};\n};\n\n/** @lends OpenSeadragon.EventSource.prototype */\n$.EventSource.prototype = {\n\n /**\n * Add an event handler to be triggered only once (or a given number of times)\n * for a given event.\n * @function\n * @param {String} eventName - Name of event to register.\n * @param {OpenSeadragon.EventHandler} handler - Function to call when event\n * is triggered.\n * @param {Object} [userData=null] - Arbitrary object to be passed unchanged\n * to the handler.\n * @param {Number} [times=1] - The number of times to handle the event\n * before removing it.\n */\n addOnceHandler: function(eventName, handler, userData, times) {\n var self = this;\n times = times || 1;\n var count = 0;\n var onceHandler = function(event) {\n count++;\n if (count === times) {\n self.removeHandler(eventName, onceHandler);\n }\n handler(event);\n };\n this.addHandler(eventName, onceHandler, userData);\n },\n\n /**\n * Add an event handler for a given event.\n * @function\n * @param {String} eventName - Name of event to register.\n * @param {OpenSeadragon.EventHandler} handler - Function to call when event is triggered.\n * @param {Object} [userData=null] - Arbitrary object to be passed unchanged to the handler.\n */\n addHandler: function ( eventName, handler, userData ) {\n var events = this.events[ eventName ];\n if ( !events ) {\n this.events[ eventName ] = events = [];\n }\n if ( handler && $.isFunction( handler ) ) {\n events[ events.length ] = { handler: handler, userData: userData || null };\n }\n },\n\n /**\n * Remove a specific event handler for a given event.\n * @function\n * @param {String} eventName - Name of event for which the handler is to be removed.\n * @param {OpenSeadragon.EventHandler} handler - Function to be removed.\n */\n removeHandler: function ( eventName, handler ) {\n var events = this.events[ eventName ],\n handlers = [],\n i;\n if ( !events ) {\n return;\n }\n if ( $.isArray( events ) ) {\n for ( i = 0; i < events.length; i++ ) {\n if ( events[i].handler !== handler ) {\n handlers.push( events[ i ] );\n }\n }\n this.events[ eventName ] = handlers;\n }\n },\n\n\n /**\n * Remove all event handlers for a given event type. If no type is given all\n * event handlers for every event type are removed.\n * @function\n * @param {String} eventName - Name of event for which all handlers are to be removed.\n */\n removeAllHandlers: function( eventName ) {\n if ( eventName ){\n this.events[ eventName ] = [];\n } else{\n for ( var eventType in this.events ) {\n this.events[ eventType ] = [];\n }\n }\n },\n\n /**\n * Get a function which iterates the list of all handlers registered for a given event, calling the handler for each.\n * @function\n * @param {String} eventName - Name of event to get handlers for.\n */\n getHandler: function ( eventName ) {\n var events = this.events[ eventName ];\n if ( !events || !events.length ) {\n return null;\n }\n events = events.length === 1 ?\n [ events[ 0 ] ] :\n Array.apply( null, events );\n return function ( source, args ) {\n var i,\n length = events.length;\n for ( i = 0; i < length; i++ ) {\n if ( events[ i ] ) {\n args.eventSource = source;\n args.userData = events[ i ].userData;\n events[ i ].handler( args );\n }\n }\n };\n },\n\n /**\n * Trigger an event, optionally passing additional information.\n * @function\n * @param {String} eventName - Name of event to register.\n * @param {Object} eventArgs - Event-specific data.\n */\n raiseEvent: function( eventName, eventArgs ) {\n //uncomment if you want to get a log of all events\n //$.console.log( eventName );\n var handler = this.getHandler( eventName );\n\n if ( handler ) {\n if ( !eventArgs ) {\n eventArgs = {};\n }\n\n handler( this, eventArgs );\n }\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - MouseTracker\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function ( $ ) {\n\n // All MouseTracker instances\n var MOUSETRACKERS = [];\n\n // dictionary from hash to private properties\n var THIS = {};\n\n\n /**\n * @class MouseTracker\n * @classdesc Provides simplified handling of common pointer device (mouse, touch, pen, etc.) gestures\n * and keyboard events on a specified element.\n * @memberof OpenSeadragon\n * @param {Object} options\n * Allows configurable properties to be entirely specified by passing\n * an options object to the constructor. The constructor also supports\n * the original positional arguments 'element', 'clickTimeThreshold',\n * and 'clickDistThreshold' in that order.\n * @param {Element|String} options.element\n * A reference to an element or an element id for which the pointer/key\n * events will be monitored.\n * @param {Boolean} [options.startDisabled=false]\n * If true, event tracking on the element will not start until\n * {@link OpenSeadragon.MouseTracker.setTracking|setTracking} is called.\n * @param {Number} options.clickTimeThreshold\n * The number of milliseconds within which a pointer down-up event combination\n * will be treated as a click gesture.\n * @param {Number} options.clickDistThreshold\n * The maximum distance allowed between a pointer down event and a pointer up event\n * to be treated as a click gesture.\n * @param {Number} options.dblClickTimeThreshold\n * The number of milliseconds within which two pointer down-up event combinations\n * will be treated as a double-click gesture.\n * @param {Number} options.dblClickDistThreshold\n * The maximum distance allowed between two pointer click events\n * to be treated as a click gesture.\n * @param {Number} [options.stopDelay=50]\n * The number of milliseconds without pointer move before the stop\n * event is fired.\n * @param {OpenSeadragon.EventHandler} [options.enterHandler=null]\n * An optional handler for pointer enter.\n * @param {OpenSeadragon.EventHandler} [options.exitHandler=null]\n * An optional handler for pointer exit.\n * @param {OpenSeadragon.EventHandler} [options.pressHandler=null]\n * An optional handler for pointer press.\n * @param {OpenSeadragon.EventHandler} [options.nonPrimaryPressHandler=null]\n * An optional handler for pointer non-primary button press.\n * @param {OpenSeadragon.EventHandler} [options.releaseHandler=null]\n * An optional handler for pointer release.\n * @param {OpenSeadragon.EventHandler} [options.nonPrimaryReleaseHandler=null]\n * An optional handler for pointer non-primary button release.\n * @param {OpenSeadragon.EventHandler} [options.moveHandler=null]\n * An optional handler for pointer move.\n * @param {OpenSeadragon.EventHandler} [options.scrollHandler=null]\n * An optional handler for mouse wheel scroll.\n * @param {OpenSeadragon.EventHandler} [options.clickHandler=null]\n * An optional handler for pointer click.\n * @param {OpenSeadragon.EventHandler} [options.dblClickHandler=null]\n * An optional handler for pointer double-click.\n * @param {OpenSeadragon.EventHandler} [options.dragHandler=null]\n * An optional handler for the drag gesture.\n * @param {OpenSeadragon.EventHandler} [options.dragEndHandler=null]\n * An optional handler for after a drag gesture.\n * @param {OpenSeadragon.EventHandler} [options.pinchHandler=null]\n * An optional handler for the pinch gesture.\n * @param {OpenSeadragon.EventHandler} [options.keyDownHandler=null]\n * An optional handler for keydown.\n * @param {OpenSeadragon.EventHandler} [options.keyUpHandler=null]\n * An optional handler for keyup.\n * @param {OpenSeadragon.EventHandler} [options.keyHandler=null]\n * An optional handler for keypress.\n * @param {OpenSeadragon.EventHandler} [options.focusHandler=null]\n * An optional handler for focus.\n * @param {OpenSeadragon.EventHandler} [options.blurHandler=null]\n * An optional handler for blur.\n * @param {Object} [options.userData=null]\n * Arbitrary object to be passed unchanged to any attached handler methods.\n */\n $.MouseTracker = function ( options ) {\n\n MOUSETRACKERS.push( this );\n\n var args = arguments;\n\n if ( !$.isPlainObject( options ) ) {\n options = {\n element: args[ 0 ],\n clickTimeThreshold: args[ 1 ],\n clickDistThreshold: args[ 2 ]\n };\n }\n\n this.hash = Math.random(); // An unique hash for this tracker.\n /**\n * The element for which pointer events are being monitored.\n * @member {Element} element\n * @memberof OpenSeadragon.MouseTracker#\n */\n this.element = $.getElement( options.element );\n /**\n * The number of milliseconds within which a pointer down-up event combination\n * will be treated as a click gesture.\n * @member {Number} clickTimeThreshold\n * @memberof OpenSeadragon.MouseTracker#\n */\n this.clickTimeThreshold = options.clickTimeThreshold || $.DEFAULT_SETTINGS.clickTimeThreshold;\n /**\n * The maximum distance allowed between a pointer down event and a pointer up event\n * to be treated as a click gesture.\n * @member {Number} clickDistThreshold\n * @memberof OpenSeadragon.MouseTracker#\n */\n this.clickDistThreshold = options.clickDistThreshold || $.DEFAULT_SETTINGS.clickDistThreshold;\n /**\n * The number of milliseconds within which two pointer down-up event combinations\n * will be treated as a double-click gesture.\n * @member {Number} dblClickTimeThreshold\n * @memberof OpenSeadragon.MouseTracker#\n */\n this.dblClickTimeThreshold = options.dblClickTimeThreshold || $.DEFAULT_SETTINGS.dblClickTimeThreshold;\n /**\n * The maximum distance allowed between two pointer click events\n * to be treated as a click gesture.\n * @member {Number} clickDistThreshold\n * @memberof OpenSeadragon.MouseTracker#\n */\n this.dblClickDistThreshold = options.dblClickDistThreshold || $.DEFAULT_SETTINGS.dblClickDistThreshold;\n /*eslint-disable no-multi-spaces*/\n this.userData = options.userData || null;\n this.stopDelay = options.stopDelay || 50;\n\n this.enterHandler = options.enterHandler || null;\n this.exitHandler = options.exitHandler || null;\n this.pressHandler = options.pressHandler || null;\n this.nonPrimaryPressHandler = options.nonPrimaryPressHandler || null;\n this.releaseHandler = options.releaseHandler || null;\n this.nonPrimaryReleaseHandler = options.nonPrimaryReleaseHandler || null;\n this.moveHandler = options.moveHandler || null;\n this.scrollHandler = options.scrollHandler || null;\n this.clickHandler = options.clickHandler || null;\n this.dblClickHandler = options.dblClickHandler || null;\n this.dragHandler = options.dragHandler || null;\n this.dragEndHandler = options.dragEndHandler || null;\n this.pinchHandler = options.pinchHandler || null;\n this.stopHandler = options.stopHandler || null;\n this.keyDownHandler = options.keyDownHandler || null;\n this.keyUpHandler = options.keyUpHandler || null;\n this.keyHandler = options.keyHandler || null;\n this.focusHandler = options.focusHandler || null;\n this.blurHandler = options.blurHandler || null;\n /*eslint-enable no-multi-spaces*/\n\n //Store private properties in a scope sealed hash map\n var _this = this;\n\n /**\n * @private\n * @property {Boolean} tracking\n * Are we currently tracking pointer events for this element.\n */\n THIS[ this.hash ] = {\n click: function ( event ) { onClick( _this, event ); },\n dblclick: function ( event ) { onDblClick( _this, event ); },\n keydown: function ( event ) { onKeyDown( _this, event ); },\n keyup: function ( event ) { onKeyUp( _this, event ); },\n keypress: function ( event ) { onKeyPress( _this, event ); },\n focus: function ( event ) { onFocus( _this, event ); },\n blur: function ( event ) { onBlur( _this, event ); },\n\n wheel: function ( event ) { onWheel( _this, event ); },\n mousewheel: function ( event ) { onMouseWheel( _this, event ); },\n DOMMouseScroll: function ( event ) { onMouseWheel( _this, event ); },\n MozMousePixelScroll: function ( event ) { onMouseWheel( _this, event ); },\n\n mouseenter: function ( event ) { onMouseEnter( _this, event ); }, // Used on IE8 only\n mouseleave: function ( event ) { onMouseLeave( _this, event ); }, // Used on IE8 only\n mouseover: function ( event ) { onMouseOver( _this, event ); },\n mouseout: function ( event ) { onMouseOut( _this, event ); },\n mousedown: function ( event ) { onMouseDown( _this, event ); },\n mouseup: function ( event ) { onMouseUp( _this, event ); },\n mouseupcaptured: function ( event ) { onMouseUpCaptured( _this, event ); },\n mousemove: function ( event ) { onMouseMove( _this, event ); },\n mousemovecaptured: function ( event ) { onMouseMoveCaptured( _this, event ); },\n\n touchstart: function ( event ) { onTouchStart( _this, event ); },\n touchend: function ( event ) { onTouchEnd( _this, event ); },\n touchendcaptured: function ( event ) { onTouchEndCaptured( _this, event ); },\n touchmove: function ( event ) { onTouchMove( _this, event ); },\n touchmovecaptured: function ( event ) { onTouchMoveCaptured( _this, event ); },\n touchcancel: function ( event ) { onTouchCancel( _this, event ); },\n\n gesturestart: function ( event ) { onGestureStart( _this, event ); },\n gesturechange: function ( event ) { onGestureChange( _this, event ); },\n\n pointerover: function ( event ) { onPointerOver( _this, event ); },\n MSPointerOver: function ( event ) { onPointerOver( _this, event ); },\n pointerout: function ( event ) { onPointerOut( _this, event ); },\n MSPointerOut: function ( event ) { onPointerOut( _this, event ); },\n pointerdown: function ( event ) { onPointerDown( _this, event ); },\n MSPointerDown: function ( event ) { onPointerDown( _this, event ); },\n pointerup: function ( event ) { onPointerUp( _this, event ); },\n MSPointerUp: function ( event ) { onPointerUp( _this, event ); },\n pointermove: function ( event ) { onPointerMove( _this, event ); },\n MSPointerMove: function ( event ) { onPointerMove( _this, event ); },\n pointercancel: function ( event ) { onPointerCancel( _this, event ); },\n MSPointerCancel: function ( event ) { onPointerCancel( _this, event ); },\n pointerupcaptured: function ( event ) { onPointerUpCaptured( _this, event ); },\n pointermovecaptured: function ( event ) { onPointerMoveCaptured( _this, event ); },\n\n tracking: false,\n\n // Active pointers lists. Array of GesturePointList objects, one for each pointer device type.\n // GesturePointList objects are added each time a pointer is tracked by a new pointer device type (see getActivePointersListByType()).\n // Active pointers are any pointer being tracked for this element which are in the hit-test area\n // of the element (for hover-capable devices) and/or have contact or a button press initiated in the element.\n activePointersLists: [],\n\n // Tracking for double-click gesture\n lastClickPos: null,\n dblClickTimeOut: null,\n\n // Tracking for pinch gesture\n pinchGPoints: [],\n lastPinchDist: 0,\n currentPinchDist: 0,\n lastPinchCenter: null,\n currentPinchCenter: null\n };\n\n if ( !options.startDisabled ) {\n this.setTracking( true );\n }\n };\n\n /** @lends OpenSeadragon.MouseTracker.prototype */\n $.MouseTracker.prototype = {\n\n /**\n * Clean up any events or objects created by the tracker.\n * @function\n */\n destroy: function () {\n var i;\n\n stopTracking( this );\n this.element = null;\n\n for ( i = 0; i < MOUSETRACKERS.length; i++ ) {\n if ( MOUSETRACKERS[ i ] === this ) {\n MOUSETRACKERS.splice( i, 1 );\n break;\n }\n }\n\n THIS[ this.hash ] = null;\n delete THIS[ this.hash ];\n },\n\n /**\n * Are we currently tracking events on this element.\n * @deprecated Just use this.tracking\n * @function\n * @returns {Boolean} Are we currently tracking events on this element.\n */\n isTracking: function () {\n return THIS[ this.hash ].tracking;\n },\n\n /**\n * Enable or disable whether or not we are tracking events on this element.\n * @function\n * @param {Boolean} track True to start tracking, false to stop tracking.\n * @returns {OpenSeadragon.MouseTracker} Chainable.\n */\n setTracking: function ( track ) {\n if ( track ) {\n startTracking( this );\n } else {\n stopTracking( this );\n }\n //chain\n return this;\n },\n\n /**\n * Returns the {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} for all but the given pointer device type.\n * @function\n * @param {String} type - The pointer device type: \"mouse\", \"touch\", \"pen\", etc.\n * @returns {Array.<OpenSeadragon.MouseTracker.GesturePointList>}\n */\n getActivePointersListsExceptType: function ( type ) {\n var delegate = THIS[ this.hash ];\n var listArray = [];\n\n for (var i = 0; i < delegate.activePointersLists.length; ++i) {\n if (delegate.activePointersLists[i].type !== type) {\n listArray.push(delegate.activePointersLists[i]);\n }\n }\n\n return listArray;\n },\n\n /**\n * Returns the {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} for the given pointer device type,\n * creating and caching a new {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} if one doesn't already exist for the type.\n * @function\n * @param {String} type - The pointer device type: \"mouse\", \"touch\", \"pen\", etc.\n * @returns {OpenSeadragon.MouseTracker.GesturePointList}\n */\n getActivePointersListByType: function ( type ) {\n var delegate = THIS[ this.hash ],\n i,\n len = delegate.activePointersLists.length,\n list;\n\n for ( i = 0; i < len; i++ ) {\n if ( delegate.activePointersLists[ i ].type === type ) {\n return delegate.activePointersLists[ i ];\n }\n }\n\n list = new $.MouseTracker.GesturePointList( type );\n delegate.activePointersLists.push( list );\n return list;\n },\n\n /**\n * Returns the total number of pointers currently active on the tracked element.\n * @function\n * @returns {Number}\n */\n getActivePointerCount: function () {\n var delegate = THIS[ this.hash ],\n i,\n len = delegate.activePointersLists.length,\n count = 0;\n\n for ( i = 0; i < len; i++ ) {\n count += delegate.activePointersLists[ i ].getLength();\n }\n\n return count;\n },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Number} event.pointers\n * Number of pointers (all types) active in the tracked element.\n * @param {Boolean} event.insideElementPressed\n * True if the left mouse button is currently being pressed and was\n * initiated inside the tracked element, otherwise false.\n * @param {Boolean} event.buttonDownAny\n * Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n enterHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Number} event.pointers\n * Number of pointers (all types) active in the tracked element.\n * @param {Boolean} event.insideElementPressed\n * True if the left mouse button is currently being pressed and was\n * initiated inside the tracked element, otherwise false.\n * @param {Boolean} event.buttonDownAny\n * Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n exitHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n pressHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.button\n * Button which caused the event.\n * -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n nonPrimaryPressHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.insideElementPressed\n * True if the left mouse button is currently being pressed and was\n * initiated inside the tracked element, otherwise false.\n * @param {Boolean} event.insideElementReleased\n * True if the cursor inside the tracked element when the button was released.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n releaseHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.button\n * Button which caused the event.\n * -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n nonPrimaryReleaseHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n moveHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.scroll\n * The scroll delta for the event.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead. Touch devices no longer generate scroll event.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n scrollHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Boolean} event.quick\n * True only if the clickDistThreshold and clickTimeThreshold are both passed. Useful for ignoring drag events.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n clickHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n dblClickHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {OpenSeadragon.Point} event.delta\n * The x,y components of the difference between the current position and the last drag event position. Useful for ignoring or weighting the events.\n * @param {Number} event.speed\n * Current computed speed, in pixels per second.\n * @param {Number} event.direction\n * Current computed direction, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n dragHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.speed\n * Speed at the end of a drag gesture, in pixels per second.\n * @param {Number} event.direction\n * Direction at the end of a drag gesture, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n dragEndHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} event.gesturePoints\n * Gesture points associated with the gesture. Velocity data can be found here.\n * @param {OpenSeadragon.Point} event.lastCenter\n * The previous center point of the two pinch contact points relative to the tracked element.\n * @param {OpenSeadragon.Point} event.center\n * The center point of the two pinch contact points relative to the tracked element.\n * @param {Number} event.lastDistance\n * The previous distance between the two pinch contact points in CSS pixels.\n * @param {Number} event.distance\n * The distance between the two pinch contact points in CSS pixels.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n pinchHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {String} event.pointerType\n * \"mouse\", \"touch\", \"pen\", etc.\n * @param {OpenSeadragon.Point} event.position\n * The position of the event relative to the tracked element.\n * @param {Number} event.buttons\n * Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @param {Boolean} event.isTouchEvent\n * True if the original event is a touch event, otherwise false. <span style=\"color:red;\">Deprecated. Use pointerType and/or originalEvent instead.</span>\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n stopHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {Number} event.keyCode\n * The key code that was pressed.\n * @param {Boolean} event.ctrl\n * True if the ctrl key was pressed during this event.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.alt\n * True if the alt key was pressed during this event.\n * @param {Boolean} event.meta\n * True if the meta key was pressed during this event.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n keyDownHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {Number} event.keyCode\n * The key code that was pressed.\n * @param {Boolean} event.ctrl\n * True if the ctrl key was pressed during this event.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.alt\n * True if the alt key was pressed during this event.\n * @param {Boolean} event.meta\n * True if the meta key was pressed during this event.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n keyUpHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {Number} event.keyCode\n * The key code that was pressed.\n * @param {Boolean} event.ctrl\n * True if the ctrl key was pressed during this event.\n * @param {Boolean} event.shift\n * True if the shift key was pressed during this event.\n * @param {Boolean} event.alt\n * True if the alt key was pressed during this event.\n * @param {Boolean} event.meta\n * True if the meta key was pressed during this event.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n keyHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n focusHandler: function () { },\n\n /**\n * Implement or assign implementation to these handlers during or after\n * calling the constructor.\n * @function\n * @param {Object} event\n * @param {OpenSeadragon.MouseTracker} event.eventSource\n * A reference to the tracker instance.\n * @param {Object} event.originalEvent\n * The original event object.\n * @param {Boolean} event.preventDefaultAction\n * Set to true to prevent the tracker subscriber from performing its default action (subscriber implementation dependent). Default: false.\n * @param {Object} event.userData\n * Arbitrary user-defined object.\n */\n blurHandler: function () { }\n };\n\n /**\n * Resets all active mousetrakers. (Added to patch issue #697 \"Mouse up outside map will cause \"canvas-drag\" event to stick\")\n *\n * @private\n * @member resetAllMouseTrackers\n * @memberof OpenSeadragon.MouseTracker\n */\n $.MouseTracker.resetAllMouseTrackers = function(){\n for(var i = 0; i < MOUSETRACKERS.length; i++){\n if (MOUSETRACKERS[i].isTracking()){\n MOUSETRACKERS[i].setTracking(false);\n MOUSETRACKERS[i].setTracking(true);\n }\n }\n };\n\n /**\n * Provides continuous computation of velocity (speed and direction) of active pointers.\n * This is a singleton, used by all MouseTracker instances, as it is unlikely there will ever be more than\n * two active gesture pointers at a time.\n *\n * @private\n * @member gesturePointVelocityTracker\n * @memberof OpenSeadragon.MouseTracker\n */\n $.MouseTracker.gesturePointVelocityTracker = (function () {\n var trackerPoints = [],\n intervalId = 0,\n lastTime = 0;\n\n // Generates a unique identifier for a tracked gesture point\n var _generateGuid = function ( tracker, gPoint ) {\n return tracker.hash.toString() + gPoint.type + gPoint.id.toString();\n };\n\n // Interval timer callback. Computes velocity for all tracked gesture points.\n var _doTracking = function () {\n var i,\n len = trackerPoints.length,\n trackPoint,\n gPoint,\n now = $.now(),\n elapsedTime,\n distance,\n speed;\n\n elapsedTime = now - lastTime;\n lastTime = now;\n\n for ( i = 0; i < len; i++ ) {\n trackPoint = trackerPoints[ i ];\n gPoint = trackPoint.gPoint;\n // Math.atan2 gives us just what we need for a velocity vector, as we can simply\n // use cos()/sin() to extract the x/y velocity components.\n gPoint.direction = Math.atan2( gPoint.currentPos.y - trackPoint.lastPos.y, gPoint.currentPos.x - trackPoint.lastPos.x );\n // speed = distance / elapsed time\n distance = trackPoint.lastPos.distanceTo( gPoint.currentPos );\n trackPoint.lastPos = gPoint.currentPos;\n speed = 1000 * distance / ( elapsedTime + 1 );\n // Simple biased average, favors the most recent speed computation. Smooths out erratic gestures a bit.\n gPoint.speed = 0.75 * speed + 0.25 * gPoint.speed;\n }\n };\n\n // Public. Add a gesture point to be tracked\n var addPoint = function ( tracker, gPoint ) {\n var guid = _generateGuid( tracker, gPoint );\n\n trackerPoints.push(\n {\n guid: guid,\n gPoint: gPoint,\n lastPos: gPoint.currentPos\n } );\n\n // Only fire up the interval timer when there's gesture pointers to track\n if ( trackerPoints.length === 1 ) {\n lastTime = $.now();\n intervalId = window.setInterval( _doTracking, 50 );\n }\n };\n\n // Public. Stop tracking a gesture point\n var removePoint = function ( tracker, gPoint ) {\n var guid = _generateGuid( tracker, gPoint ),\n i,\n len = trackerPoints.length;\n for ( i = 0; i < len; i++ ) {\n if ( trackerPoints[ i ].guid === guid ) {\n trackerPoints.splice( i, 1 );\n // Only run the interval timer if theres gesture pointers to track\n len--;\n if ( len === 0 ) {\n window.clearInterval( intervalId );\n }\n break;\n }\n }\n };\n\n return {\n addPoint: addPoint,\n removePoint: removePoint\n };\n } )();\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Pointer event model and feature detection\n///////////////////////////////////////////////////////////////////////////////\n\n $.MouseTracker.captureElement = document;\n\n /**\n * Detect available mouse wheel event name.\n */\n $.MouseTracker.wheelEventName = ( $.Browser.vendor == $.BROWSERS.IE && $.Browser.version > 8 ) ||\n ( 'onwheel' in document.createElement( 'div' ) ) ? 'wheel' : // Modern browsers support 'wheel'\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least 'mousewheel'\n 'DOMMouseScroll'; // Assume old Firefox\n\n /**\n * Detect legacy mouse capture support.\n */\n $.MouseTracker.supportsMouseCapture = (function () {\n var divElement = document.createElement( 'div' );\n return $.isFunction( divElement.setCapture ) && $.isFunction( divElement.releaseCapture );\n }());\n\n /**\n * Detect browser pointer device event model(s) and build appropriate list of events to subscribe to.\n */\n $.MouseTracker.subscribeEvents = [ \"click\", \"dblclick\", \"keydown\", \"keyup\", \"keypress\", \"focus\", \"blur\", $.MouseTracker.wheelEventName ];\n\n if( $.MouseTracker.wheelEventName == \"DOMMouseScroll\" ) {\n // Older Firefox\n $.MouseTracker.subscribeEvents.push( \"MozMousePixelScroll\" );\n }\n\n // Note: window.navigator.pointerEnable is deprecated on IE 11 and not part of W3C spec.\n if ( window.PointerEvent && ( window.navigator.pointerEnabled || $.Browser.vendor !== $.BROWSERS.IE ) ) {\n // IE11 and other W3C Pointer Event implementations (see http://www.w3.org/TR/pointerevents)\n $.MouseTracker.havePointerEvents = true;\n $.MouseTracker.subscribeEvents.push( \"pointerover\", \"pointerout\", \"pointerdown\", \"pointerup\", \"pointermove\", \"pointercancel\" );\n $.MouseTracker.unprefixedPointerEvents = true;\n if( navigator.maxTouchPoints ) {\n $.MouseTracker.maxTouchPoints = navigator.maxTouchPoints;\n } else {\n $.MouseTracker.maxTouchPoints = 0;\n }\n $.MouseTracker.haveMouseEnter = false;\n } else if ( window.MSPointerEvent && window.navigator.msPointerEnabled ) {\n // IE10\n $.MouseTracker.havePointerEvents = true;\n $.MouseTracker.subscribeEvents.push( \"MSPointerOver\", \"MSPointerOut\", \"MSPointerDown\", \"MSPointerUp\", \"MSPointerMove\", \"MSPointerCancel\" );\n $.MouseTracker.unprefixedPointerEvents = false;\n if( navigator.msMaxTouchPoints ) {\n $.MouseTracker.maxTouchPoints = navigator.msMaxTouchPoints;\n } else {\n $.MouseTracker.maxTouchPoints = 0;\n }\n $.MouseTracker.haveMouseEnter = false;\n } else {\n // Legacy W3C mouse events\n $.MouseTracker.havePointerEvents = false;\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n $.MouseTracker.subscribeEvents.push( \"mouseenter\", \"mouseleave\" );\n $.MouseTracker.haveMouseEnter = true;\n } else {\n $.MouseTracker.subscribeEvents.push( \"mouseover\", \"mouseout\" );\n $.MouseTracker.haveMouseEnter = false;\n }\n $.MouseTracker.subscribeEvents.push( \"mousedown\", \"mouseup\", \"mousemove\" );\n if ( 'ontouchstart' in window ) {\n // iOS, Android, and other W3c Touch Event implementations\n // (see http://www.w3.org/TR/touch-events/)\n // (see https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)\n // (see https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)\n $.MouseTracker.subscribeEvents.push( \"touchstart\", \"touchend\", \"touchmove\", \"touchcancel\" );\n }\n if ( 'ongesturestart' in window ) {\n // iOS (see https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)\n // Subscribe to these to prevent default gesture handling\n $.MouseTracker.subscribeEvents.push( \"gesturestart\", \"gesturechange\" );\n }\n $.MouseTracker.mousePointerId = \"legacy-mouse\";\n $.MouseTracker.maxTouchPoints = 10;\n }\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Classes and typedefs\n///////////////////////////////////////////////////////////////////////////////\n\n /**\n * Represents a point of contact on the screen made by a mouse cursor, pen, touch, or other pointer device.\n *\n * @typedef {Object} GesturePoint\n * @memberof OpenSeadragon.MouseTracker\n *\n * @property {Number} id\n * Identifier unique from all other active GesturePoints for a given pointer device.\n * @property {String} type\n * The pointer device type: \"mouse\", \"touch\", \"pen\", etc.\n * @property {Boolean} captured\n * True if events for the gesture point are captured to the tracked element.\n * @property {Boolean} isPrimary\n * True if the gesture point is a master pointer amongst the set of active pointers for each pointer type. True for mouse and primary (first) touch/pen pointers.\n * @property {Boolean} insideElementPressed\n * True if button pressed or contact point initiated inside the screen area of the tracked element.\n * @property {Boolean} insideElement\n * True if pointer or contact point is currently inside the bounds of the tracked element.\n * @property {Number} speed\n * Current computed speed, in pixels per second.\n * @property {Number} direction\n * Current computed direction, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @property {OpenSeadragon.Point} contactPos\n * The initial pointer contact position, relative to the page including any scrolling. Only valid if the pointer has contact (pressed, touch contact, pen contact).\n * @property {Number} contactTime\n * The initial pointer contact time, in milliseconds. Only valid if the pointer has contact (pressed, touch contact, pen contact).\n * @property {OpenSeadragon.Point} lastPos\n * The last pointer position, relative to the page including any scrolling.\n * @property {Number} lastTime\n * The last pointer contact time, in milliseconds.\n * @property {OpenSeadragon.Point} currentPos\n * The current pointer position, relative to the page including any scrolling.\n * @property {Number} currentTime\n * The current pointer contact time, in milliseconds.\n */\n\n\n /**\n * @class GesturePointList\n * @classdesc Provides an abstraction for a set of active {@link OpenSeadragon.MouseTracker.GesturePoint|GesturePoint} objects for a given pointer device type.\n * Active pointers are any pointer being tracked for this element which are in the hit-test area\n * of the element (for hover-capable devices) and/or have contact or a button press initiated in the element.\n * @memberof OpenSeadragon.MouseTracker\n * @param {String} type - The pointer device type: \"mouse\", \"touch\", \"pen\", etc.\n */\n $.MouseTracker.GesturePointList = function ( type ) {\n this._gPoints = [];\n /**\n * The pointer device type: \"mouse\", \"touch\", \"pen\", etc.\n * @member {String} type\n * @memberof OpenSeadragon.MouseTracker.GesturePointList#\n */\n this.type = type;\n /**\n * Current buttons pressed for the device.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @member {Number} buttons\n * @memberof OpenSeadragon.MouseTracker.GesturePointList#\n */\n this.buttons = 0;\n /**\n * Current number of contact points (touch points, mouse down, etc.) for the device.\n * @member {Number} contacts\n * @memberof OpenSeadragon.MouseTracker.GesturePointList#\n */\n this.contacts = 0;\n /**\n * Current number of clicks for the device. Used for multiple click gesture tracking.\n * @member {Number} clicks\n * @memberof OpenSeadragon.MouseTracker.GesturePointList#\n */\n this.clicks = 0;\n /**\n * Current number of captured pointers for the device.\n * @member {Number} captureCount\n * @memberof OpenSeadragon.MouseTracker.GesturePointList#\n */\n this.captureCount = 0;\n };\n\n /** @lends OpenSeadragon.MouseTracker.GesturePointList.prototype */\n $.MouseTracker.GesturePointList.prototype = {\n /**\n * @function\n * @returns {Number} Number of gesture points in the list.\n */\n getLength: function () {\n return this._gPoints.length;\n },\n /**\n * @function\n * @returns {Array.<OpenSeadragon.MouseTracker.GesturePoint>} The list of gesture points in the list as an array (read-only).\n */\n asArray: function () {\n return this._gPoints;\n },\n /**\n * @function\n * @param {OpenSeadragon.MouseTracker.GesturePoint} gesturePoint - A gesture point to add to the list.\n * @returns {Number} Number of gesture points in the list.\n */\n add: function ( gp ) {\n return this._gPoints.push( gp );\n },\n /**\n * @function\n * @param {Number} id - The id of the gesture point to remove from the list.\n * @returns {Number} Number of gesture points in the list.\n */\n removeById: function ( id ) {\n var i,\n len = this._gPoints.length;\n for ( i = 0; i < len; i++ ) {\n if ( this._gPoints[ i ].id === id ) {\n this._gPoints.splice( i, 1 );\n break;\n }\n }\n return this._gPoints.length;\n },\n /**\n * @function\n * @param {Number} index - The index of the gesture point to retrieve from the list.\n * @returns {OpenSeadragon.MouseTracker.GesturePoint|null} The gesture point at the given index, or null if not found.\n */\n getByIndex: function ( index ) {\n if ( index < this._gPoints.length) {\n return this._gPoints[ index ];\n }\n\n return null;\n },\n /**\n * @function\n * @param {Number} id - The id of the gesture point to retrieve from the list.\n * @returns {OpenSeadragon.MouseTracker.GesturePoint|null} The gesture point with the given id, or null if not found.\n */\n getById: function ( id ) {\n var i,\n len = this._gPoints.length;\n for ( i = 0; i < len; i++ ) {\n if ( this._gPoints[ i ].id === id ) {\n return this._gPoints[ i ];\n }\n }\n return null;\n },\n /**\n * @function\n * @returns {OpenSeadragon.MouseTracker.GesturePoint|null} The primary gesture point in the list, or null if not found.\n */\n getPrimary: function ( id ) {\n var i,\n len = this._gPoints.length;\n for ( i = 0; i < len; i++ ) {\n if ( this._gPoints[ i ].isPrimary ) {\n return this._gPoints[ i ];\n }\n }\n return null;\n },\n\n /**\n * Increment this pointer's contact count.\n * It will evaluate whether this pointer type is allowed to have multiple contacts.\n * @function\n */\n addContact: function() {\n ++this.contacts;\n\n if (this.contacts > 1 && (this.type === \"mouse\" || this.type === \"pen\")) {\n this.contacts = 1;\n }\n },\n\n /**\n * Decrement this pointer's contact count.\n * It will make sure the count does not go below 0.\n * @function\n */\n removeContact: function() {\n --this.contacts;\n\n if (this.contacts < 0) {\n this.contacts = 0;\n }\n }\n };\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Utility functions\n///////////////////////////////////////////////////////////////////////////////\n\n /**\n * Removes all tracked pointers.\n * @private\n * @inner\n */\n function clearTrackedPointers( tracker ) {\n var delegate = THIS[ tracker.hash ],\n i,\n pointerListCount = delegate.activePointersLists.length;\n\n for ( i = 0; i < pointerListCount; i++ ) {\n if ( delegate.activePointersLists[ i ].captureCount > 0 ) {\n $.removeEvent(\n $.MouseTracker.captureElement,\n 'mousemove',\n delegate.mousemovecaptured,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n 'mouseup',\n delegate.mouseupcaptured,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n $.MouseTracker.unprefixedPointerEvents ? 'pointermove' : 'MSPointerMove',\n delegate.pointermovecaptured,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n $.MouseTracker.unprefixedPointerEvents ? 'pointerup' : 'MSPointerUp',\n delegate.pointerupcaptured,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n 'touchmove',\n delegate.touchmovecaptured,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n 'touchend',\n delegate.touchendcaptured,\n true\n );\n\n delegate.activePointersLists[ i ].captureCount = 0;\n }\n }\n\n for ( i = 0; i < pointerListCount; i++ ) {\n delegate.activePointersLists.pop();\n }\n }\n\n /**\n * Starts tracking pointer events on the tracked element.\n * @private\n * @inner\n */\n function startTracking( tracker ) {\n var delegate = THIS[ tracker.hash ],\n event,\n i;\n\n if ( !delegate.tracking ) {\n for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {\n event = $.MouseTracker.subscribeEvents[ i ];\n $.addEvent(\n tracker.element,\n event,\n delegate[ event ],\n false\n );\n }\n\n clearTrackedPointers( tracker );\n\n delegate.tracking = true;\n }\n }\n\n /**\n * Stops tracking pointer events on the tracked element.\n * @private\n * @inner\n */\n function stopTracking( tracker ) {\n var delegate = THIS[ tracker.hash ],\n event,\n i;\n\n if ( delegate.tracking ) {\n for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {\n event = $.MouseTracker.subscribeEvents[ i ];\n $.removeEvent(\n tracker.element,\n event,\n delegate[ event ],\n false\n );\n }\n\n clearTrackedPointers( tracker );\n\n delegate.tracking = false;\n }\n }\n\n /**\n * @private\n * @inner\n */\n function getCaptureEventParams( tracker, pointerType ) {\n var delegate = THIS[ tracker.hash ];\n\n if ( pointerType === 'pointerevent' ) {\n return {\n upName: $.MouseTracker.unprefixedPointerEvents ? 'pointerup' : 'MSPointerUp',\n upHandler: delegate.pointerupcaptured,\n moveName: $.MouseTracker.unprefixedPointerEvents ? 'pointermove' : 'MSPointerMove',\n moveHandler: delegate.pointermovecaptured\n };\n } else if ( pointerType === 'mouse' ) {\n return {\n upName: 'mouseup',\n upHandler: delegate.mouseupcaptured,\n moveName: 'mousemove',\n moveHandler: delegate.mousemovecaptured\n };\n } else if ( pointerType === 'touch' ) {\n return {\n upName: 'touchend',\n upHandler: delegate.touchendcaptured,\n moveName: 'touchmove',\n moveHandler: delegate.touchmovecaptured\n };\n } else {\n throw new Error( \"MouseTracker.getCaptureEventParams: Unknown pointer type.\" );\n }\n }\n\n /**\n * Begin capturing pointer events to the tracked element.\n * @private\n * @inner\n */\n function capturePointer( tracker, pointerType, pointerCount ) {\n var pointsList = tracker.getActivePointersListByType( pointerType ),\n eventParams;\n\n pointsList.captureCount += (pointerCount || 1);\n\n if ( pointsList.captureCount === 1 ) {\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n tracker.element.setCapture( true );\n } else {\n eventParams = getCaptureEventParams( tracker, $.MouseTracker.havePointerEvents ? 'pointerevent' : pointerType );\n // We emulate mouse capture by hanging listeners on the document object.\n // (Note we listen on the capture phase so the captured handlers will get called first)\n // eslint-disable-next-line no-use-before-define\n if (isInIframe && canAccessEvents(window.top)) {\n $.addEvent(\n window.top,\n eventParams.upName,\n eventParams.upHandler,\n true\n );\n }\n $.addEvent(\n $.MouseTracker.captureElement,\n eventParams.upName,\n eventParams.upHandler,\n true\n );\n $.addEvent(\n $.MouseTracker.captureElement,\n eventParams.moveName,\n eventParams.moveHandler,\n true\n );\n }\n }\n }\n\n\n /**\n * Stop capturing pointer events to the tracked element.\n * @private\n * @inner\n */\n function releasePointer( tracker, pointerType, pointerCount ) {\n var pointsList = tracker.getActivePointersListByType( pointerType ),\n eventParams;\n\n pointsList.captureCount -= (pointerCount || 1);\n\n if ( pointsList.captureCount === 0 ) {\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n tracker.element.releaseCapture();\n } else {\n eventParams = getCaptureEventParams( tracker, $.MouseTracker.havePointerEvents ? 'pointerevent' : pointerType );\n // We emulate mouse capture by hanging listeners on the document object.\n // (Note we listen on the capture phase so the captured handlers will get called first)\n // eslint-disable-next-line no-use-before-define\n if (isInIframe && canAccessEvents(window.top)) {\n $.removeEvent(\n window.top,\n eventParams.upName,\n eventParams.upHandler,\n true\n );\n }\n $.removeEvent(\n $.MouseTracker.captureElement,\n eventParams.moveName,\n eventParams.moveHandler,\n true\n );\n $.removeEvent(\n $.MouseTracker.captureElement,\n eventParams.upName,\n eventParams.upHandler,\n true\n );\n }\n }\n }\n\n\n /**\n * Gets a W3C Pointer Events model compatible pointer type string from a DOM pointer event.\n * IE10 used a long integer value, but the W3C specification (and IE11+) use a string \"mouse\", \"touch\", \"pen\", etc.\n * @private\n * @inner\n */\n function getPointerType( event ) {\n var pointerTypeStr;\n if ( $.MouseTracker.unprefixedPointerEvents ) {\n pointerTypeStr = event.pointerType;\n } else {\n // IE10\n // MSPOINTER_TYPE_TOUCH: 0x00000002\n // MSPOINTER_TYPE_PEN: 0x00000003\n // MSPOINTER_TYPE_MOUSE: 0x00000004\n switch( event.pointerType )\n {\n case 0x00000002:\n pointerTypeStr = 'touch';\n break;\n case 0x00000003:\n pointerTypeStr = 'pen';\n break;\n case 0x00000004:\n pointerTypeStr = 'mouse';\n break;\n default:\n pointerTypeStr = '';\n }\n }\n return pointerTypeStr;\n }\n\n\n /**\n * @private\n * @inner\n */\n function getMouseAbsolute( event ) {\n return $.getMousePosition( event );\n }\n\n /**\n * @private\n * @inner\n */\n function getMouseRelative( event, element ) {\n return getPointRelativeToAbsolute( getMouseAbsolute( event ), element );\n }\n\n /**\n * @private\n * @inner\n */\n function getPointRelativeToAbsolute( point, element ) {\n var offset = $.getElementOffset( element );\n return point.minus( offset );\n }\n\n /**\n * @private\n * @inner\n */\n function getCenterPoint( point1, point2 ) {\n return new $.Point( ( point1.x + point2.x ) / 2, ( point1.y + point2.y ) / 2 );\n }\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Device-specific DOM event handlers\n///////////////////////////////////////////////////////////////////////////////\n\n /**\n * @private\n * @inner\n */\n function onClick( tracker, event ) {\n if ( tracker.clickHandler ) {\n $.cancelEvent( event );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onDblClick( tracker, event ) {\n if ( tracker.dblClickHandler ) {\n $.cancelEvent( event );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onKeyDown( tracker, event ) {\n //$.console.log( \"keydown %s %s %s %s %s\", event.keyCode, event.charCode, event.ctrlKey, event.shiftKey, event.altKey );\n var propagate;\n if ( tracker.keyDownHandler ) {\n event = $.getEvent( event );\n propagate = tracker.keyDownHandler(\n {\n eventSource: tracker,\n keyCode: event.keyCode ? event.keyCode : event.charCode,\n ctrl: event.ctrlKey,\n shift: event.shiftKey,\n alt: event.altKey,\n meta: event.metaKey,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( !propagate ) {\n $.cancelEvent( event );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onKeyUp( tracker, event ) {\n //$.console.log( \"keyup %s %s %s %s %s\", event.keyCode, event.charCode, event.ctrlKey, event.shiftKey, event.altKey );\n var propagate;\n if ( tracker.keyUpHandler ) {\n event = $.getEvent( event );\n propagate = tracker.keyUpHandler(\n {\n eventSource: tracker,\n keyCode: event.keyCode ? event.keyCode : event.charCode,\n ctrl: event.ctrlKey,\n shift: event.shiftKey,\n alt: event.altKey,\n meta: event.metaKey,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( !propagate ) {\n $.cancelEvent( event );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onKeyPress( tracker, event ) {\n //$.console.log( \"keypress %s %s %s %s %s\", event.keyCode, event.charCode, event.ctrlKey, event.shiftKey, event.altKey );\n var propagate;\n if ( tracker.keyHandler ) {\n event = $.getEvent( event );\n propagate = tracker.keyHandler(\n {\n eventSource: tracker,\n keyCode: event.keyCode ? event.keyCode : event.charCode,\n ctrl: event.ctrlKey,\n shift: event.shiftKey,\n alt: event.altKey,\n meta: event.metaKey,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( !propagate ) {\n $.cancelEvent( event );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onFocus( tracker, event ) {\n //console.log( \"focus %s\", event );\n var propagate;\n if ( tracker.focusHandler ) {\n event = $.getEvent( event );\n propagate = tracker.focusHandler(\n {\n eventSource: tracker,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onBlur( tracker, event ) {\n //console.log( \"blur %s\", event );\n var propagate;\n if ( tracker.blurHandler ) {\n event = $.getEvent( event );\n propagate = tracker.blurHandler(\n {\n eventSource: tracker,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n\n\n /**\n * Handler for 'wheel' events\n *\n * @private\n * @inner\n */\n function onWheel( tracker, event ) {\n handleWheelEvent( tracker, event, event );\n }\n\n\n /**\n * Handler for 'mousewheel', 'DOMMouseScroll', and 'MozMousePixelScroll' events\n *\n * @private\n * @inner\n */\n function onMouseWheel( tracker, event ) {\n event = $.getEvent( event );\n\n // Simulate a 'wheel' event\n var simulatedEvent = {\n target: event.target || event.srcElement,\n type: \"wheel\",\n shiftKey: event.shiftKey || false,\n clientX: event.clientX,\n clientY: event.clientY,\n pageX: event.pageX ? event.pageX : event.clientX,\n pageY: event.pageY ? event.pageY : event.clientY,\n deltaMode: event.type == \"MozMousePixelScroll\" ? 0 : 1, // 0=pixel, 1=line, 2=page\n deltaX: 0,\n deltaZ: 0\n };\n\n // Calculate deltaY\n if ( $.MouseTracker.wheelEventName == \"mousewheel\" ) {\n simulatedEvent.deltaY = -event.wheelDelta / $.DEFAULT_SETTINGS.pixelsPerWheelLine;\n } else {\n simulatedEvent.deltaY = event.detail;\n }\n\n handleWheelEvent( tracker, simulatedEvent, event );\n }\n\n\n /**\n * Handles 'wheel' events.\n * The event may be simulated by the legacy mouse wheel event handler (onMouseWheel()).\n *\n * @private\n * @inner\n */\n function handleWheelEvent( tracker, event, originalEvent ) {\n var nDelta = 0,\n propagate;\n\n // The nDelta variable is gated to provide smooth z-index scrolling\n // since the mouse wheel allows for substantial deltas meant for rapid\n // y-index scrolling.\n // event.deltaMode: 0=pixel, 1=line, 2=page\n // TODO: Deltas in pixel mode should be accumulated then a scroll value computed after $.DEFAULT_SETTINGS.pixelsPerWheelLine threshold reached\n nDelta = event.deltaY < 0 ? 1 : -1;\n\n if ( tracker.scrollHandler ) {\n propagate = tracker.scrollHandler(\n {\n eventSource: tracker,\n pointerType: 'mouse',\n position: getMouseRelative( event, tracker.element ),\n scroll: nDelta,\n shift: event.shiftKey,\n isTouchEvent: false,\n originalEvent: originalEvent,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( originalEvent );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function isParentChild( parent, child )\n {\n if ( parent === child ) {\n return false;\n }\n while ( child && child !== parent ) {\n child = child.parentNode;\n }\n return child === parent;\n }\n\n\n /**\n * Only used on IE 8\n *\n * @private\n * @inner\n */\n function onMouseEnter( tracker, event ) {\n event = $.getEvent( event );\n\n handleMouseEnter( tracker, event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onMouseOver( tracker, event ) {\n event = $.getEvent( event );\n\n if ( event.currentTarget === event.relatedTarget || isParentChild( event.currentTarget, event.relatedTarget ) ) {\n return;\n }\n\n handleMouseEnter( tracker, event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleMouseEnter( tracker, event ) {\n var gPoint = {\n id: $.MouseTracker.mousePointerId,\n type: 'mouse',\n isPrimary: true,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersEnter( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * Only used on IE 8\n *\n * @private\n * @inner\n */\n function onMouseLeave( tracker, event ) {\n event = $.getEvent( event );\n\n handleMouseExit( tracker, event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onMouseOut( tracker, event ) {\n event = $.getEvent( event );\n\n if ( event.currentTarget === event.relatedTarget || isParentChild( event.currentTarget, event.relatedTarget ) ) {\n return;\n }\n\n handleMouseExit( tracker, event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleMouseExit( tracker, event ) {\n var gPoint = {\n id: $.MouseTracker.mousePointerId,\n type: 'mouse',\n isPrimary: true,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersExit( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * Returns a W3C DOM level 3 standard button value given an event.button property:\n * -1 == none, 0 == primary/left, 1 == middle, 2 == secondary/right, 3 == X1/back, 4 == X2/forward, 5 == eraser (pen)\n * @private\n * @inner\n */\n function getStandardizedButton( button ) {\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n // On IE 8, 0 == none, 1 == left, 2 == right, 3 == left and right, 4 == middle, 5 == left and middle, 6 == right and middle, 7 == all three\n // TODO: Support chorded (multiple) button presses on IE 8?\n if ( button === 1 ) {\n return 0;\n } else if ( button === 2 ) {\n return 2;\n } else if ( button === 4 ) {\n return 1;\n } else {\n return -1;\n }\n } else {\n return button;\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onMouseDown( tracker, event ) {\n var gPoint;\n\n event = $.getEvent( event );\n\n gPoint = {\n id: $.MouseTracker.mousePointerId,\n type: 'mouse',\n isPrimary: true,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n if ( updatePointersDown( tracker, event, [ gPoint ], getStandardizedButton( event.button ) ) ) {\n $.stopEvent( event );\n capturePointer( tracker, 'mouse' );\n }\n\n if ( tracker.clickHandler || tracker.dblClickHandler || tracker.pressHandler || tracker.dragHandler || tracker.dragEndHandler ) {\n $.cancelEvent( event );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onMouseUp( tracker, event ) {\n handleMouseUp( tracker, event );\n }\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate mouse capture.\n * onMouseUp is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onMouseUpCaptured( tracker, event ) {\n handleMouseUp( tracker, event );\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleMouseUp( tracker, event ) {\n var gPoint;\n\n event = $.getEvent( event );\n\n gPoint = {\n id: $.MouseTracker.mousePointerId,\n type: 'mouse',\n isPrimary: true,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n if ( updatePointersUp( tracker, event, [ gPoint ], getStandardizedButton( event.button ) ) ) {\n releasePointer( tracker, 'mouse' );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onMouseMove( tracker, event ) {\n handleMouseMove( tracker, event );\n }\n\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate mouse capture.\n * onMouseMove is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onMouseMoveCaptured( tracker, event ) {\n handleMouseMove( tracker, event );\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleMouseMove( tracker, event ) {\n var gPoint;\n\n event = $.getEvent( event );\n\n gPoint = {\n id: $.MouseTracker.mousePointerId,\n type: 'mouse',\n isPrimary: true,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersMove( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * @private\n * @inner\n */\n function abortContacts( tracker, event, pointsList ) {\n var i,\n gPointCount = pointsList.getLength(),\n abortGPoints = [];\n\n // Check contact count for hoverable pointer types before aborting\n if (pointsList.type === 'touch' || pointsList.contacts > 0) {\n for ( i = 0; i < gPointCount; i++ ) {\n abortGPoints.push( pointsList.getByIndex( i ) );\n }\n\n if ( abortGPoints.length > 0 ) {\n // simulate touchend/mouseup\n updatePointersUp( tracker, event, abortGPoints, 0 ); // 0 means primary button press/release or touch contact\n // release pointer capture\n pointsList.captureCount = 1;\n releasePointer( tracker, pointsList.type );\n // simulate touchleave/mouseout\n updatePointersExit( tracker, event, abortGPoints );\n }\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onTouchStart( tracker, event ) {\n var time,\n i,\n j,\n touchCount = event.changedTouches.length,\n gPoints = [],\n parentGPoints,\n pointsList = tracker.getActivePointersListByType( 'touch' );\n\n time = $.now();\n\n if ( pointsList.getLength() > event.touches.length - touchCount ) {\n $.console.warn('Tracked touch contact count doesn\\'t match event.touches.length. Removing all tracked touch pointers.');\n abortContacts( tracker, event, pointsList );\n }\n\n for ( i = 0; i < touchCount; i++ ) {\n gPoints.push( {\n id: event.changedTouches[ i ].identifier,\n type: 'touch',\n // isPrimary not set - let the updatePointers functions determine it\n currentPos: getMouseAbsolute( event.changedTouches[ i ] ),\n currentTime: time\n } );\n }\n\n // simulate touchenter on our tracked element\n updatePointersEnter( tracker, event, gPoints );\n\n // simulate touchenter on our tracked element's tracked ancestor elements\n for ( i = 0; i < MOUSETRACKERS.length; i++ ) {\n if ( MOUSETRACKERS[ i ] !== tracker && MOUSETRACKERS[ i ].isTracking() && isParentChild( MOUSETRACKERS[ i ].element, tracker.element ) ) {\n parentGPoints = [];\n for ( j = 0; j < touchCount; j++ ) {\n parentGPoints.push( {\n id: event.changedTouches[ j ].identifier,\n type: 'touch',\n // isPrimary not set - let the updatePointers functions determine it\n currentPos: getMouseAbsolute( event.changedTouches[ j ] ),\n currentTime: time\n } );\n }\n updatePointersEnter( MOUSETRACKERS[ i ], event, parentGPoints );\n }\n }\n\n if ( updatePointersDown( tracker, event, gPoints, 0 ) ) { // 0 means primary button press/release or touch contact\n $.stopEvent( event );\n capturePointer( tracker, 'touch', touchCount );\n }\n\n $.cancelEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onTouchEnd( tracker, event ) {\n handleTouchEnd( tracker, event );\n }\n\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate pointer capture.\n * onTouchEnd is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onTouchEndCaptured( tracker, event ) {\n handleTouchEnd( tracker, event );\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleTouchEnd( tracker, event ) {\n var time,\n i,\n j,\n touchCount = event.changedTouches.length,\n gPoints = [],\n parentGPoints;\n\n time = $.now();\n\n for ( i = 0; i < touchCount; i++ ) {\n gPoints.push( {\n id: event.changedTouches[ i ].identifier,\n type: 'touch',\n // isPrimary not set - let the updatePointers functions determine it\n currentPos: getMouseAbsolute( event.changedTouches[ i ] ),\n currentTime: time\n } );\n }\n\n if ( updatePointersUp( tracker, event, gPoints, 0 ) ) {\n releasePointer( tracker, 'touch', touchCount );\n }\n\n // simulate touchleave on our tracked element\n updatePointersExit( tracker, event, gPoints );\n\n // simulate touchleave on our tracked element's tracked ancestor elements\n for ( i = 0; i < MOUSETRACKERS.length; i++ ) {\n if ( MOUSETRACKERS[ i ] !== tracker && MOUSETRACKERS[ i ].isTracking() && isParentChild( MOUSETRACKERS[ i ].element, tracker.element ) ) {\n parentGPoints = [];\n for ( j = 0; j < touchCount; j++ ) {\n parentGPoints.push( {\n id: event.changedTouches[ j ].identifier,\n type: 'touch',\n // isPrimary not set - let the updatePointers functions determine it\n currentPos: getMouseAbsolute( event.changedTouches[ j ] ),\n currentTime: time\n } );\n }\n updatePointersExit( MOUSETRACKERS[ i ], event, parentGPoints );\n }\n }\n\n $.cancelEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onTouchMove( tracker, event ) {\n handleTouchMove( tracker, event );\n }\n\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate pointer capture.\n * onTouchMove is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onTouchMoveCaptured( tracker, event ) {\n handleTouchMove( tracker, event );\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handleTouchMove( tracker, event ) {\n var i,\n touchCount = event.changedTouches.length,\n gPoints = [];\n\n for ( i = 0; i < touchCount; i++ ) {\n gPoints.push( {\n id: event.changedTouches[ i ].identifier,\n type: 'touch',\n // isPrimary not set - let the updatePointers functions determine it\n currentPos: getMouseAbsolute( event.changedTouches[ i ] ),\n currentTime: $.now()\n } );\n }\n\n updatePointersMove( tracker, event, gPoints );\n\n $.cancelEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onTouchCancel( tracker, event ) {\n var pointsList = tracker.getActivePointersListByType('touch');\n\n abortContacts( tracker, event, pointsList );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onGestureStart( tracker, event ) {\n event.stopPropagation();\n event.preventDefault();\n return false;\n }\n\n\n /**\n * @private\n * @inner\n */\n function onGestureChange( tracker, event ) {\n event.stopPropagation();\n event.preventDefault();\n return false;\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerOver( tracker, event ) {\n var gPoint;\n\n if ( event.currentTarget === event.relatedTarget || isParentChild( event.currentTarget, event.relatedTarget ) ) {\n return;\n }\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event ),\n isPrimary: event.isPrimary,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersEnter( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerOut( tracker, event ) {\n var gPoint;\n\n if ( event.currentTarget === event.relatedTarget || isParentChild( event.currentTarget, event.relatedTarget ) ) {\n return;\n }\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event ),\n isPrimary: event.isPrimary,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersExit( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerDown( tracker, event ) {\n var gPoint;\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event ),\n isPrimary: event.isPrimary,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n if ( updatePointersDown( tracker, event, [ gPoint ], event.button ) ) {\n $.stopEvent( event );\n capturePointer( tracker, gPoint.type );\n }\n\n if ( tracker.clickHandler || tracker.dblClickHandler || tracker.pressHandler || tracker.dragHandler || tracker.dragEndHandler || tracker.pinchHandler ) {\n $.cancelEvent( event );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerUp( tracker, event ) {\n handlePointerUp( tracker, event );\n }\n\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate mouse capture.\n * onPointerUp is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onPointerUpCaptured( tracker, event ) {\n var pointsList = tracker.getActivePointersListByType( getPointerType( event ) );\n if ( pointsList.getById( event.pointerId ) ) {\n handlePointerUp( tracker, event );\n }\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handlePointerUp( tracker, event ) {\n var gPoint;\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event ),\n isPrimary: event.isPrimary,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n if ( updatePointersUp( tracker, event, [ gPoint ], event.button ) ) {\n releasePointer( tracker, gPoint.type );\n }\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerMove( tracker, event ) {\n handlePointerMove( tracker, event );\n }\n\n\n /**\n * This handler is attached to the window object (on the capture phase) to emulate mouse capture.\n * onPointerMove is still attached to the tracked element, so stop propagation to avoid processing twice.\n *\n * @private\n * @inner\n */\n function onPointerMoveCaptured( tracker, event ) {\n var pointsList = tracker.getActivePointersListByType( getPointerType( event ) );\n if ( pointsList.getById( event.pointerId ) ) {\n handlePointerMove( tracker, event );\n }\n $.stopEvent( event );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handlePointerMove( tracker, event ) {\n // Pointer changed coordinates, button state, pressure, tilt, or contact geometry (e.g. width and height)\n var gPoint;\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event ),\n isPrimary: event.isPrimary,\n currentPos: getMouseAbsolute( event ),\n currentTime: $.now()\n };\n\n updatePointersMove( tracker, event, [ gPoint ] );\n }\n\n\n /**\n * @private\n * @inner\n */\n function onPointerCancel( tracker, event ) {\n var gPoint;\n\n gPoint = {\n id: event.pointerId,\n type: getPointerType( event )\n };\n\n updatePointersCancel( tracker, event, [ gPoint ] );\n }\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Device-agnostic DOM event handlers\n///////////////////////////////////////////////////////////////////////////////\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker.GesturePointList} pointsList\n * The GesturePointList to track the pointer in.\n * @param {OpenSeadragon.MouseTracker.GesturePoint} gPoint\n * Gesture point to track.\n * @returns {Number} Number of gesture points in pointsList.\n */\n function startTrackingPointer( pointsList, gPoint ) {\n\n // If isPrimary is not known for the pointer then set it according to our rules:\n // true if the first pointer in the gesture, otherwise false\n if ( !gPoint.hasOwnProperty( 'isPrimary' ) ) {\n if ( pointsList.getLength() === 0 ) {\n gPoint.isPrimary = true;\n } else {\n gPoint.isPrimary = false;\n }\n }\n gPoint.speed = 0;\n gPoint.direction = 0;\n gPoint.contactPos = gPoint.currentPos;\n gPoint.contactTime = gPoint.currentTime;\n gPoint.lastPos = gPoint.currentPos;\n gPoint.lastTime = gPoint.currentTime;\n\n return pointsList.add( gPoint );\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker.GesturePointList} pointsList\n * The GesturePointList to stop tracking the pointer on.\n * @param {OpenSeadragon.MouseTracker.GesturePoint} gPoint\n * Gesture point to stop tracking.\n * @returns {Number} Number of gesture points in pointsList.\n */\n function stopTrackingPointer( pointsList, gPoint ) {\n var listLength,\n primaryPoint;\n\n if ( pointsList.getById( gPoint.id ) ) {\n listLength = pointsList.removeById( gPoint.id );\n\n // If isPrimary is not known for the pointer and we just removed the primary pointer from the list then we need to set another pointer as primary\n if ( !gPoint.hasOwnProperty( 'isPrimary' ) ) {\n primaryPoint = pointsList.getPrimary();\n if ( !primaryPoint ) {\n primaryPoint = pointsList.getByIndex( 0 );\n if ( primaryPoint ) {\n primaryPoint.isPrimary = true;\n }\n }\n }\n } else {\n listLength = pointsList.getLength();\n }\n\n return listLength;\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n */\n function updatePointersEnter( tracker, event, gPoints ) {\n var pointsList = tracker.getActivePointersListByType( gPoints[ 0 ].type ),\n i,\n gPointCount = gPoints.length,\n curGPoint,\n updateGPoint,\n propagate;\n\n for ( i = 0; i < gPointCount; i++ ) {\n curGPoint = gPoints[ i ];\n updateGPoint = pointsList.getById( curGPoint.id );\n\n if ( updateGPoint ) {\n // Already tracking the pointer...update it\n updateGPoint.insideElement = true;\n updateGPoint.lastPos = updateGPoint.currentPos;\n updateGPoint.lastTime = updateGPoint.currentTime;\n updateGPoint.currentPos = curGPoint.currentPos;\n updateGPoint.currentTime = curGPoint.currentTime;\n\n curGPoint = updateGPoint;\n } else {\n // Initialize for tracking and add to the tracking list\n curGPoint.captured = false;\n curGPoint.insideElementPressed = false;\n curGPoint.insideElement = true;\n startTrackingPointer( pointsList, curGPoint );\n }\n\n // Enter\n if ( tracker.enterHandler ) {\n propagate = tracker.enterHandler(\n {\n eventSource: tracker,\n pointerType: curGPoint.type,\n position: getPointRelativeToAbsolute( curGPoint.currentPos, tracker.element ),\n buttons: pointsList.buttons,\n pointers: tracker.getActivePointerCount(),\n insideElementPressed: curGPoint.insideElementPressed,\n buttonDownAny: pointsList.buttons !== 0,\n isTouchEvent: curGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n */\n function updatePointersExit( tracker, event, gPoints ) {\n var pointsList = tracker.getActivePointersListByType(gPoints[0].type),\n i,\n gPointCount = gPoints.length,\n curGPoint,\n updateGPoint,\n propagate;\n\n for ( i = 0; i < gPointCount; i++ ) {\n curGPoint = gPoints[ i ];\n updateGPoint = pointsList.getById( curGPoint.id );\n\n if ( updateGPoint ) {\n // Already tracking the pointer. If captured then update it, else stop tracking it\n if ( updateGPoint.captured ) {\n updateGPoint.insideElement = false;\n updateGPoint.lastPos = updateGPoint.currentPos;\n updateGPoint.lastTime = updateGPoint.currentTime;\n updateGPoint.currentPos = curGPoint.currentPos;\n updateGPoint.currentTime = curGPoint.currentTime;\n } else {\n stopTrackingPointer( pointsList, updateGPoint );\n }\n\n curGPoint = updateGPoint;\n }\n\n // Exit\n if ( tracker.exitHandler ) {\n propagate = tracker.exitHandler(\n {\n eventSource: tracker,\n pointerType: curGPoint.type,\n position: getPointRelativeToAbsolute( curGPoint.currentPos, tracker.element ),\n buttons: pointsList.buttons,\n pointers: tracker.getActivePointerCount(),\n insideElementPressed: updateGPoint ? updateGPoint.insideElementPressed : false,\n buttonDownAny: pointsList.buttons !== 0,\n isTouchEvent: curGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n * @param {Number} buttonChanged\n * The button involved in the event: -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * Note on chorded button presses (a button pressed when another button is already pressed): In the W3C Pointer Events model,\n * only one pointerdown/pointerup event combo is fired. Chorded button state changes instead fire pointermove events.\n *\n * @returns {Boolean} True if pointers should be captured to the tracked element, otherwise false.\n */\n function updatePointersDown( tracker, event, gPoints, buttonChanged ) {\n var delegate = THIS[ tracker.hash ],\n propagate,\n pointsList = tracker.getActivePointersListByType( gPoints[ 0 ].type ),\n i,\n gPointCount = gPoints.length,\n curGPoint,\n updateGPoint;\n\n if ( typeof event.buttons !== 'undefined' ) {\n pointsList.buttons = event.buttons;\n } else {\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n if ( buttonChanged === 0 ) {\n // Primary\n pointsList.buttons += 1;\n } else if ( buttonChanged === 1 ) {\n // Aux\n pointsList.buttons += 4;\n } else if ( buttonChanged === 2 ) {\n // Secondary\n pointsList.buttons += 2;\n } else if ( buttonChanged === 3 ) {\n // X1 (Back)\n pointsList.buttons += 8;\n } else if ( buttonChanged === 4 ) {\n // X2 (Forward)\n pointsList.buttons += 16;\n } else if ( buttonChanged === 5 ) {\n // Pen Eraser\n pointsList.buttons += 32;\n }\n } else {\n if ( buttonChanged === 0 ) {\n // Primary\n pointsList.buttons |= 1;\n } else if ( buttonChanged === 1 ) {\n // Aux\n pointsList.buttons |= 4;\n } else if ( buttonChanged === 2 ) {\n // Secondary\n pointsList.buttons |= 2;\n } else if ( buttonChanged === 3 ) {\n // X1 (Back)\n pointsList.buttons |= 8;\n } else if ( buttonChanged === 4 ) {\n // X2 (Forward)\n pointsList.buttons |= 16;\n } else if ( buttonChanged === 5 ) {\n // Pen Eraser\n pointsList.buttons |= 32;\n }\n }\n }\n\n // Some pointers may steal control from another pointer without firing the appropriate release events\n // e.g. Touching a screen while click-dragging with certain mice.\n var otherPointsLists = tracker.getActivePointersListsExceptType(gPoints[ 0 ].type);\n for (i = 0; i < otherPointsLists.length; i++) {\n //If another pointer has contact, simulate the release\n abortContacts(tracker, event, otherPointsLists[i]); // No-op if no active pointer\n }\n\n // Only capture and track primary button, pen, and touch contacts\n if ( buttonChanged !== 0 ) {\n // Aux Press\n if ( tracker.nonPrimaryPressHandler ) {\n propagate = tracker.nonPrimaryPressHandler(\n {\n eventSource: tracker,\n pointerType: gPoints[ 0 ].type,\n position: getPointRelativeToAbsolute( gPoints[ 0 ].currentPos, tracker.element ),\n button: buttonChanged,\n buttons: pointsList.buttons,\n isTouchEvent: gPoints[ 0 ].type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n return false;\n }\n\n for ( i = 0; i < gPointCount; i++ ) {\n curGPoint = gPoints[ i ];\n updateGPoint = pointsList.getById( curGPoint.id );\n\n if ( updateGPoint ) {\n // Already tracking the pointer...update it\n updateGPoint.captured = true;\n updateGPoint.insideElementPressed = true;\n updateGPoint.insideElement = true;\n updateGPoint.contactPos = curGPoint.currentPos;\n updateGPoint.contactTime = curGPoint.currentTime;\n updateGPoint.lastPos = updateGPoint.currentPos;\n updateGPoint.lastTime = updateGPoint.currentTime;\n updateGPoint.currentPos = curGPoint.currentPos;\n updateGPoint.currentTime = curGPoint.currentTime;\n\n curGPoint = updateGPoint;\n } else {\n // Initialize for tracking and add to the tracking list (no pointerover or pointermove event occurred before this)\n curGPoint.captured = true;\n curGPoint.insideElementPressed = true;\n curGPoint.insideElement = true;\n startTrackingPointer( pointsList, curGPoint );\n }\n\n pointsList.addContact();\n //$.console.log('contacts++ ', pointsList.contacts);\n\n if ( tracker.dragHandler || tracker.dragEndHandler || tracker.pinchHandler ) {\n $.MouseTracker.gesturePointVelocityTracker.addPoint( tracker, curGPoint );\n }\n\n if ( pointsList.contacts === 1 ) {\n // Press\n if ( tracker.pressHandler ) {\n propagate = tracker.pressHandler(\n {\n eventSource: tracker,\n pointerType: curGPoint.type,\n position: getPointRelativeToAbsolute( curGPoint.contactPos, tracker.element ),\n buttons: pointsList.buttons,\n isTouchEvent: curGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n } else if ( pointsList.contacts === 2 ) {\n if ( tracker.pinchHandler && curGPoint.type === 'touch' ) {\n // Initialize for pinch\n delegate.pinchGPoints = pointsList.asArray();\n delegate.lastPinchDist = delegate.currentPinchDist = delegate.pinchGPoints[ 0 ].currentPos.distanceTo( delegate.pinchGPoints[ 1 ].currentPos );\n delegate.lastPinchCenter = delegate.currentPinchCenter = getCenterPoint( delegate.pinchGPoints[ 0 ].currentPos, delegate.pinchGPoints[ 1 ].currentPos );\n }\n }\n }\n\n return true;\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n * @param {Number} buttonChanged\n * The button involved in the event: -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * Note on chorded button presses (a button pressed when another button is already pressed): In the W3C Pointer Events model,\n * only one pointerdown/pointerup event combo is fired. Chorded button state changes instead fire pointermove events.\n *\n * @returns {Boolean} True if pointer capture should be released from the tracked element, otherwise false.\n */\n function updatePointersUp( tracker, event, gPoints, buttonChanged ) {\n var delegate = THIS[ tracker.hash ],\n pointsList = tracker.getActivePointersListByType( gPoints[ 0 ].type ),\n propagate,\n releasePoint,\n releaseTime,\n i,\n gPointCount = gPoints.length,\n curGPoint,\n updateGPoint,\n releaseCapture = false,\n wasCaptured = false,\n quick;\n\n if ( typeof event.buttons !== 'undefined' ) {\n pointsList.buttons = event.buttons;\n } else {\n if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {\n if ( buttonChanged === 0 ) {\n // Primary\n pointsList.buttons -= 1;\n } else if ( buttonChanged === 1 ) {\n // Aux\n pointsList.buttons -= 4;\n } else if ( buttonChanged === 2 ) {\n // Secondary\n pointsList.buttons -= 2;\n } else if ( buttonChanged === 3 ) {\n // X1 (Back)\n pointsList.buttons -= 8;\n } else if ( buttonChanged === 4 ) {\n // X2 (Forward)\n pointsList.buttons -= 16;\n } else if ( buttonChanged === 5 ) {\n // Pen Eraser\n pointsList.buttons -= 32;\n }\n } else {\n if ( buttonChanged === 0 ) {\n // Primary\n pointsList.buttons ^= ~1;\n } else if ( buttonChanged === 1 ) {\n // Aux\n pointsList.buttons ^= ~4;\n } else if ( buttonChanged === 2 ) {\n // Secondary\n pointsList.buttons ^= ~2;\n } else if ( buttonChanged === 3 ) {\n // X1 (Back)\n pointsList.buttons ^= ~8;\n } else if ( buttonChanged === 4 ) {\n // X2 (Forward)\n pointsList.buttons ^= ~16;\n } else if ( buttonChanged === 5 ) {\n // Pen Eraser\n pointsList.buttons ^= ~32;\n }\n }\n }\n\n // Only capture and track primary button, pen, and touch contacts\n if ( buttonChanged !== 0 ) {\n // Aux Release\n if ( tracker.nonPrimaryReleaseHandler ) {\n propagate = tracker.nonPrimaryReleaseHandler(\n {\n eventSource: tracker,\n pointerType: gPoints[ 0 ].type,\n position: getPointRelativeToAbsolute(gPoints[0].currentPos, tracker.element),\n button: buttonChanged,\n buttons: pointsList.buttons,\n isTouchEvent: gPoints[ 0 ].type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // A primary mouse button may have been released while the non-primary button was down\n var otherPointsList = tracker.getActivePointersListByType(\"mouse\");\n // Stop tracking the mouse; see https://github.com/openseadragon/openseadragon/pull/1223\n abortContacts(tracker, event, otherPointsList); // No-op if no active pointer\n\n return false;\n }\n\n for ( i = 0; i < gPointCount; i++ ) {\n curGPoint = gPoints[ i ];\n updateGPoint = pointsList.getById( curGPoint.id );\n\n if ( updateGPoint ) {\n // Update the pointer, stop tracking it if not still in this element\n if ( updateGPoint.captured ) {\n updateGPoint.captured = false;\n releaseCapture = true;\n wasCaptured = true;\n }\n updateGPoint.lastPos = updateGPoint.currentPos;\n updateGPoint.lastTime = updateGPoint.currentTime;\n updateGPoint.currentPos = curGPoint.currentPos;\n updateGPoint.currentTime = curGPoint.currentTime;\n if ( !updateGPoint.insideElement ) {\n stopTrackingPointer( pointsList, updateGPoint );\n }\n\n releasePoint = updateGPoint.currentPos;\n releaseTime = updateGPoint.currentTime;\n\n if ( wasCaptured ) {\n // Pointer was activated in our element but could have been removed in any element since events are captured to our element\n\n pointsList.removeContact();\n //$.console.log('contacts-- ', pointsList.contacts);\n\n if ( tracker.dragHandler || tracker.dragEndHandler || tracker.pinchHandler ) {\n $.MouseTracker.gesturePointVelocityTracker.removePoint( tracker, updateGPoint );\n }\n\n if ( pointsList.contacts === 0 ) {\n\n // Release (pressed in our element)\n if ( tracker.releaseHandler ) {\n propagate = tracker.releaseHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( releasePoint, tracker.element ),\n buttons: pointsList.buttons,\n insideElementPressed: updateGPoint.insideElementPressed,\n insideElementReleased: updateGPoint.insideElement,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // Drag End\n if ( tracker.dragEndHandler && !updateGPoint.currentPos.equals( updateGPoint.contactPos ) ) {\n propagate = tracker.dragEndHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( updateGPoint.currentPos, tracker.element ),\n speed: updateGPoint.speed,\n direction: updateGPoint.direction,\n shift: event.shiftKey,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // Click / Double-Click\n if ( ( tracker.clickHandler || tracker.dblClickHandler ) && updateGPoint.insideElement ) {\n quick = releaseTime - updateGPoint.contactTime <= tracker.clickTimeThreshold &&\n updateGPoint.contactPos.distanceTo( releasePoint ) <= tracker.clickDistThreshold;\n\n // Click\n if ( tracker.clickHandler ) {\n propagate = tracker.clickHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( updateGPoint.currentPos, tracker.element ),\n quick: quick,\n shift: event.shiftKey,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // Double-Click\n if ( tracker.dblClickHandler && quick ) {\n pointsList.clicks++;\n if ( pointsList.clicks === 1 ) {\n delegate.lastClickPos = releasePoint;\n /*jshint loopfunc:true*/\n delegate.dblClickTimeOut = setTimeout( function() {\n pointsList.clicks = 0;\n }, tracker.dblClickTimeThreshold );\n /*jshint loopfunc:false*/\n } else if ( pointsList.clicks === 2 ) {\n clearTimeout( delegate.dblClickTimeOut );\n pointsList.clicks = 0;\n if ( delegate.lastClickPos.distanceTo( releasePoint ) <= tracker.dblClickDistThreshold ) {\n propagate = tracker.dblClickHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( updateGPoint.currentPos, tracker.element ),\n shift: event.shiftKey,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n delegate.lastClickPos = null;\n }\n }\n }\n } else if ( pointsList.contacts === 2 ) {\n if ( tracker.pinchHandler && updateGPoint.type === 'touch' ) {\n // Reset for pinch\n delegate.pinchGPoints = pointsList.asArray();\n delegate.lastPinchDist = delegate.currentPinchDist = delegate.pinchGPoints[ 0 ].currentPos.distanceTo( delegate.pinchGPoints[ 1 ].currentPos );\n delegate.lastPinchCenter = delegate.currentPinchCenter = getCenterPoint( delegate.pinchGPoints[ 0 ].currentPos, delegate.pinchGPoints[ 1 ].currentPos );\n }\n }\n } else {\n // Pointer was activated in another element but removed in our element\n\n // Release (pressed in another element)\n if ( tracker.releaseHandler ) {\n propagate = tracker.releaseHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( releasePoint, tracker.element ),\n buttons: pointsList.buttons,\n insideElementPressed: updateGPoint.insideElementPressed,\n insideElementReleased: updateGPoint.insideElement,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n }\n }\n\n return releaseCapture;\n }\n\n\n /**\n * Call when pointer(s) change coordinates, button state, pressure, tilt, or contact geometry (e.g. width and height)\n *\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n */\n function updatePointersMove( tracker, event, gPoints ) {\n var delegate = THIS[ tracker.hash ],\n pointsList = tracker.getActivePointersListByType( gPoints[ 0 ].type ),\n i,\n gPointCount = gPoints.length,\n curGPoint,\n updateGPoint,\n gPointArray,\n delta,\n propagate;\n\n if ( typeof event.buttons !== 'undefined' ) {\n pointsList.buttons = event.buttons;\n }\n\n for ( i = 0; i < gPointCount; i++ ) {\n curGPoint = gPoints[ i ];\n updateGPoint = pointsList.getById( curGPoint.id );\n\n if ( updateGPoint ) {\n // Already tracking the pointer...update it\n if ( curGPoint.hasOwnProperty( 'isPrimary' ) ) {\n updateGPoint.isPrimary = curGPoint.isPrimary;\n }\n updateGPoint.lastPos = updateGPoint.currentPos;\n updateGPoint.lastTime = updateGPoint.currentTime;\n updateGPoint.currentPos = curGPoint.currentPos;\n updateGPoint.currentTime = curGPoint.currentTime;\n } else {\n // Initialize for tracking and add to the tracking list (no pointerover or pointerdown event occurred before this)\n curGPoint.captured = false;\n curGPoint.insideElementPressed = false;\n curGPoint.insideElement = true;\n startTrackingPointer( pointsList, curGPoint );\n }\n }\n\n // Stop (mouse only)\n if ( tracker.stopHandler && gPoints[ 0 ].type === 'mouse' ) {\n clearTimeout( tracker.stopTimeOut );\n tracker.stopTimeOut = setTimeout( function() {\n handlePointerStop( tracker, event, gPoints[ 0 ].type );\n }, tracker.stopDelay );\n }\n\n if ( pointsList.contacts === 0 ) {\n // Move (no contacts: hovering mouse or other hover-capable device)\n if ( tracker.moveHandler ) {\n propagate = tracker.moveHandler(\n {\n eventSource: tracker,\n pointerType: gPoints[ 0 ].type,\n position: getPointRelativeToAbsolute( gPoints[ 0 ].currentPos, tracker.element ),\n buttons: pointsList.buttons,\n isTouchEvent: gPoints[ 0 ].type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n } else if ( pointsList.contacts === 1 ) {\n // Move (1 contact)\n if ( tracker.moveHandler ) {\n updateGPoint = pointsList.asArray()[ 0 ];\n propagate = tracker.moveHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( updateGPoint.currentPos, tracker.element ),\n buttons: pointsList.buttons,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // Drag\n if ( tracker.dragHandler ) {\n updateGPoint = pointsList.asArray()[ 0 ];\n delta = updateGPoint.currentPos.minus( updateGPoint.lastPos );\n propagate = tracker.dragHandler(\n {\n eventSource: tracker,\n pointerType: updateGPoint.type,\n position: getPointRelativeToAbsolute( updateGPoint.currentPos, tracker.element ),\n buttons: pointsList.buttons,\n delta: delta,\n speed: updateGPoint.speed,\n direction: updateGPoint.direction,\n shift: event.shiftKey,\n isTouchEvent: updateGPoint.type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n } else if ( pointsList.contacts === 2 ) {\n // Move (2 contacts, use center)\n if ( tracker.moveHandler ) {\n gPointArray = pointsList.asArray();\n propagate = tracker.moveHandler(\n {\n eventSource: tracker,\n pointerType: gPointArray[ 0 ].type,\n position: getPointRelativeToAbsolute( getCenterPoint( gPointArray[ 0 ].currentPos, gPointArray[ 1 ].currentPos ), tracker.element ),\n buttons: pointsList.buttons,\n isTouchEvent: gPointArray[ 0 ].type === 'touch',\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n\n // Pinch\n if ( tracker.pinchHandler && gPoints[ 0 ].type === 'touch' ) {\n delta = delegate.pinchGPoints[ 0 ].currentPos.distanceTo( delegate.pinchGPoints[ 1 ].currentPos );\n if ( delta != delegate.currentPinchDist ) {\n delegate.lastPinchDist = delegate.currentPinchDist;\n delegate.currentPinchDist = delta;\n delegate.lastPinchCenter = delegate.currentPinchCenter;\n delegate.currentPinchCenter = getCenterPoint( delegate.pinchGPoints[ 0 ].currentPos, delegate.pinchGPoints[ 1 ].currentPos );\n propagate = tracker.pinchHandler(\n {\n eventSource: tracker,\n pointerType: 'touch',\n gesturePoints: delegate.pinchGPoints,\n lastCenter: getPointRelativeToAbsolute( delegate.lastPinchCenter, tracker.element ),\n center: getPointRelativeToAbsolute( delegate.currentPinchCenter, tracker.element ),\n lastDistance: delegate.lastPinchDist,\n distance: delegate.currentPinchDist,\n shift: event.shiftKey,\n originalEvent: event,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( event );\n }\n }\n }\n }\n }\n\n\n /**\n * @function\n * @private\n * @inner\n * @param {OpenSeadragon.MouseTracker} tracker\n * A reference to the MouseTracker instance.\n * @param {Object} event\n * A reference to the originating DOM event.\n * @param {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gPoints\n * Gesture points associated with the event.\n */\n function updatePointersCancel( tracker, event, gPoints ) {\n updatePointersUp( tracker, event, gPoints, 0 );\n updatePointersExit( tracker, event, gPoints );\n }\n\n\n /**\n * @private\n * @inner\n */\n function handlePointerStop( tracker, originalMoveEvent, pointerType ) {\n if ( tracker.stopHandler ) {\n tracker.stopHandler( {\n eventSource: tracker,\n pointerType: pointerType,\n position: getMouseRelative( originalMoveEvent, tracker.element ),\n buttons: tracker.getActivePointersListByType( pointerType ).buttons,\n isTouchEvent: pointerType === 'touch',\n originalEvent: originalMoveEvent,\n preventDefaultAction: false,\n userData: tracker.userData\n } );\n }\n }\n\n /**\n * True if inside an iframe, otherwise false.\n * @member {Boolean} isInIframe\n * @private\n * @inner\n */\n var isInIframe = (function() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n })();\n\n /**\n * @function\n * @private\n * @inner\n * @returns {Boolean} True if the target has access rights to events, otherwise false.\n */\n function canAccessEvents (target) {\n try {\n return target.addEventListener && target.removeEventListener;\n } catch (e) {\n return false;\n }\n }\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - Control\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * An enumeration of supported locations where controls can be anchored.\n * The anchoring is always relative to the container.\n * @member ControlAnchor\n * @memberof OpenSeadragon\n * @static\n * @type {Object}\n * @property {Number} NONE\n * @property {Number} TOP_LEFT\n * @property {Number} TOP_RIGHT\n * @property {Number} BOTTOM_LEFT\n * @property {Number} BOTTOM_RIGHT\n * @property {Number} ABSOLUTE\n */\n$.ControlAnchor = {\n NONE: 0,\n TOP_LEFT: 1,\n TOP_RIGHT: 2,\n BOTTOM_RIGHT: 3,\n BOTTOM_LEFT: 4,\n ABSOLUTE: 5\n};\n\n/**\n * @class Control\n * @classdesc A Control represents any interface element which is meant to allow the user\n * to interact with the zoomable interface. Any control can be anchored to any\n * element.\n *\n * @memberof OpenSeadragon\n * @param {Element} element - the control element to be anchored in the container.\n * @param {Object } options - All required and optional settings for configuring a control element.\n * @param {OpenSeadragon.ControlAnchor} [options.anchor=OpenSeadragon.ControlAnchor.NONE] - the position of the control\n * relative to the container.\n * @param {Boolean} [options.attachToViewer=true] - Whether the control should be added directly to the viewer, or\n * directly to the container\n * @param {Boolean} [options.autoFade=true] - Whether the control should have the autofade behavior\n * @param {Element} container - the element to control will be anchored too.\n */\n$.Control = function ( element, options, container ) {\n var parent = element.parentNode;\n if (typeof options === 'number')\n {\n $.console.error(\"Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; \" +\n \"please use an options object instead. \" +\n \"Support for this deprecated variant is scheduled for removal in December 2013\");\n options = {anchor: options};\n }\n options.attachToViewer = (typeof options.attachToViewer === 'undefined') ? true : options.attachToViewer;\n /**\n * True if the control should have autofade behavior.\n * @member {Boolean} autoFade\n * @memberof OpenSeadragon.Control#\n */\n this.autoFade = (typeof options.autoFade === 'undefined') ? true : options.autoFade;\n /**\n * The element providing the user interface with some type of control (e.g. a zoom-in button).\n * @member {Element} element\n * @memberof OpenSeadragon.Control#\n */\n this.element = element;\n /**\n * The position of the Control relative to its container.\n * @member {OpenSeadragon.ControlAnchor} anchor\n * @memberof OpenSeadragon.Control#\n */\n this.anchor = options.anchor;\n /**\n * The Control's containing element.\n * @member {Element} container\n * @memberof OpenSeadragon.Control#\n */\n this.container = container;\n /**\n * A neutral element surrounding the control element.\n * @member {Element} wrapper\n * @memberof OpenSeadragon.Control#\n */\n if ( this.anchor == $.ControlAnchor.ABSOLUTE ) {\n this.wrapper = $.makeNeutralElement( \"div\" );\n this.wrapper.style.position = \"absolute\";\n this.wrapper.style.top = typeof (options.top) == \"number\" ? (options.top + 'px') : options.top;\n this.wrapper.style.left = typeof (options.left) == \"number\" ? (options.left + 'px') : options.left;\n this.wrapper.style.height = typeof (options.height) == \"number\" ? (options.height + 'px') : options.height;\n this.wrapper.style.width = typeof (options.width) == \"number\" ? (options.width + 'px') : options.width;\n this.wrapper.style.margin = \"0px\";\n this.wrapper.style.padding = \"0px\";\n\n this.element.style.position = \"relative\";\n this.element.style.top = \"0px\";\n this.element.style.left = \"0px\";\n this.element.style.height = \"100%\";\n this.element.style.width = \"100%\";\n } else {\n this.wrapper = $.makeNeutralElement( \"div\" );\n this.wrapper.style.display = \"inline-block\";\n if ( this.anchor == $.ControlAnchor.NONE ) {\n // IE6 fix\n this.wrapper.style.width = this.wrapper.style.height = \"100%\";\n }\n }\n this.wrapper.appendChild( this.element );\n\n if (options.attachToViewer ) {\n if ( this.anchor == $.ControlAnchor.TOP_RIGHT ||\n this.anchor == $.ControlAnchor.BOTTOM_RIGHT ) {\n this.container.insertBefore(\n this.wrapper,\n this.container.firstChild\n );\n } else {\n this.container.appendChild( this.wrapper );\n }\n } else {\n parent.appendChild( this.wrapper );\n }\n};\n\n/** @lends OpenSeadragon.Control.prototype */\n$.Control.prototype = {\n\n /**\n * Removes the control from the container.\n * @function\n */\n destroy: function() {\n this.wrapper.removeChild( this.element );\n this.container.removeChild( this.wrapper );\n },\n\n /**\n * Determines if the control is currently visible.\n * @function\n * @return {Boolean} true if currently visible, false otherwise.\n */\n isVisible: function() {\n return this.wrapper.style.display != \"none\";\n },\n\n /**\n * Toggles the visibility of the control.\n * @function\n * @param {Boolean} visible - true to make visible, false to hide.\n */\n setVisible: function( visible ) {\n this.wrapper.style.display = visible ?\n ( this.anchor == $.ControlAnchor.ABSOLUTE ? 'block' : 'inline-block' ) :\n \"none\";\n },\n\n /**\n * Sets the opacity level for the control.\n * @function\n * @param {Number} opactiy - a value between 1 and 0 inclusively.\n */\n setOpacity: function( opacity ) {\n if ( this.element[ $.SIGNAL ] && $.Browser.vendor == $.BROWSERS.IE ) {\n $.setElementOpacity( this.element, opacity, true );\n } else {\n $.setElementOpacity( this.wrapper, opacity, true );\n }\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - ControlDock\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n /**\n * @class ControlDock\n * @classdesc Provides a container element (a &lt;form&gt; element) with support for the layout of control elements.\n *\n * @memberof OpenSeadragon\n */\n $.ControlDock = function( options ){\n var layouts = [ 'topleft', 'topright', 'bottomright', 'bottomleft'],\n layout,\n i;\n\n $.extend( true, this, {\n id: 'controldock-' + $.now() + '-' + Math.floor(Math.random() * 1000000),\n container: $.makeNeutralElement( 'div' ),\n controls: []\n }, options );\n\n // Disable the form's submit; otherwise button clicks and return keys\n // can trigger it.\n this.container.onsubmit = function() {\n return false;\n };\n\n if( this.element ){\n this.element = $.getElement( this.element );\n this.element.appendChild( this.container );\n this.element.style.position = 'relative';\n this.container.style.width = '100%';\n this.container.style.height = '100%';\n }\n\n for( i = 0; i < layouts.length; i++ ){\n layout = layouts[ i ];\n this.controls[ layout ] = $.makeNeutralElement( \"div\" );\n this.controls[ layout ].style.position = 'absolute';\n if ( layout.match( 'left' ) ){\n this.controls[ layout ].style.left = '0px';\n }\n if ( layout.match( 'right' ) ){\n this.controls[ layout ].style.right = '0px';\n }\n if ( layout.match( 'top' ) ){\n this.controls[ layout ].style.top = '0px';\n }\n if ( layout.match( 'bottom' ) ){\n this.controls[ layout ].style.bottom = '0px';\n }\n }\n\n this.container.appendChild( this.controls.topleft );\n this.container.appendChild( this.controls.topright );\n this.container.appendChild( this.controls.bottomright );\n this.container.appendChild( this.controls.bottomleft );\n };\n\n /** @lends OpenSeadragon.ControlDock.prototype */\n $.ControlDock.prototype = {\n\n /**\n * @function\n */\n addControl: function ( element, controlOptions ) {\n element = $.getElement( element );\n var div = null;\n\n if ( getControlIndex( this, element ) >= 0 ) {\n return; // they're trying to add a duplicate control\n }\n\n switch ( controlOptions.anchor ) {\n case $.ControlAnchor.TOP_RIGHT:\n div = this.controls.topright;\n element.style.position = \"relative\";\n element.style.paddingRight = \"0px\";\n element.style.paddingTop = \"0px\";\n break;\n case $.ControlAnchor.BOTTOM_RIGHT:\n div = this.controls.bottomright;\n element.style.position = \"relative\";\n element.style.paddingRight = \"0px\";\n element.style.paddingBottom = \"0px\";\n break;\n case $.ControlAnchor.BOTTOM_LEFT:\n div = this.controls.bottomleft;\n element.style.position = \"relative\";\n element.style.paddingLeft = \"0px\";\n element.style.paddingBottom = \"0px\";\n break;\n case $.ControlAnchor.TOP_LEFT:\n div = this.controls.topleft;\n element.style.position = \"relative\";\n element.style.paddingLeft = \"0px\";\n element.style.paddingTop = \"0px\";\n break;\n case $.ControlAnchor.ABSOLUTE:\n div = this.container;\n element.style.margin = \"0px\";\n element.style.padding = \"0px\";\n break;\n default:\n case $.ControlAnchor.NONE:\n div = this.container;\n element.style.margin = \"0px\";\n element.style.padding = \"0px\";\n break;\n }\n\n this.controls.push(\n new $.Control( element, controlOptions, div )\n );\n element.style.display = \"inline-block\";\n },\n\n\n /**\n * @function\n * @return {OpenSeadragon.ControlDock} Chainable.\n */\n removeControl: function ( element ) {\n element = $.getElement( element );\n var i = getControlIndex( this, element );\n\n if ( i >= 0 ) {\n this.controls[ i ].destroy();\n this.controls.splice( i, 1 );\n }\n\n return this;\n },\n\n /**\n * @function\n * @return {OpenSeadragon.ControlDock} Chainable.\n */\n clearControls: function () {\n while ( this.controls.length > 0 ) {\n this.controls.pop().destroy();\n }\n\n return this;\n },\n\n\n /**\n * @function\n * @return {Boolean}\n */\n areControlsEnabled: function () {\n var i;\n\n for ( i = this.controls.length - 1; i >= 0; i-- ) {\n if ( this.controls[ i ].isVisible() ) {\n return true;\n }\n }\n\n return false;\n },\n\n\n /**\n * @function\n * @return {OpenSeadragon.ControlDock} Chainable.\n */\n setControlsEnabled: function( enabled ) {\n var i;\n\n for ( i = this.controls.length - 1; i >= 0; i-- ) {\n this.controls[ i ].setVisible( enabled );\n }\n\n return this;\n }\n\n };\n\n\n ///////////////////////////////////////////////////////////////////////////////\n // Utility methods\n ///////////////////////////////////////////////////////////////////////////////\n function getControlIndex( dock, element ) {\n var controls = dock.controls,\n i;\n\n for ( i = controls.length - 1; i >= 0; i-- ) {\n if ( controls[ i ].element == element ) {\n return i;\n }\n }\n\n return -1;\n }\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Placement\n *\n * Copyright (C) 2010-2016 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($) {\n\n /**\n * An enumeration of positions to anchor an element.\n * @member Placement\n * @memberOf OpenSeadragon\n * @static\n * @readonly\n * @property {OpenSeadragon.Placement} CENTER\n * @property {OpenSeadragon.Placement} TOP_LEFT\n * @property {OpenSeadragon.Placement} TOP\n * @property {OpenSeadragon.Placement} TOP_RIGHT\n * @property {OpenSeadragon.Placement} RIGHT\n * @property {OpenSeadragon.Placement} BOTTOM_RIGHT\n * @property {OpenSeadragon.Placement} BOTTOM\n * @property {OpenSeadragon.Placement} BOTTOM_LEFT\n * @property {OpenSeadragon.Placement} LEFT\n */\n $.Placement = $.freezeObject({\n CENTER: 0,\n TOP_LEFT: 1,\n TOP: 2,\n TOP_RIGHT: 3,\n RIGHT: 4,\n BOTTOM_RIGHT: 5,\n BOTTOM: 6,\n BOTTOM_LEFT: 7,\n LEFT: 8,\n properties: {\n 0: {\n isLeft: false,\n isHorizontallyCentered: true,\n isRight: false,\n isTop: false,\n isVerticallyCentered: true,\n isBottom: false\n },\n 1: {\n isLeft: true,\n isHorizontallyCentered: false,\n isRight: false,\n isTop: true,\n isVerticallyCentered: false,\n isBottom: false\n },\n 2: {\n isLeft: false,\n isHorizontallyCentered: true,\n isRight: false,\n isTop: true,\n isVerticallyCentered: false,\n isBottom: false\n },\n 3: {\n isLeft: false,\n isHorizontallyCentered: false,\n isRight: true,\n isTop: true,\n isVerticallyCentered: false,\n isBottom: false\n },\n 4: {\n isLeft: false,\n isHorizontallyCentered: false,\n isRight: true,\n isTop: false,\n isVerticallyCentered: true,\n isBottom: false\n },\n 5: {\n isLeft: false,\n isHorizontallyCentered: false,\n isRight: true,\n isTop: false,\n isVerticallyCentered: false,\n isBottom: true\n },\n 6: {\n isLeft: false,\n isHorizontallyCentered: true,\n isRight: false,\n isTop: false,\n isVerticallyCentered: false,\n isBottom: true\n },\n 7: {\n isLeft: true,\n isHorizontallyCentered: false,\n isRight: false,\n isTop: false,\n isVerticallyCentered: false,\n isBottom: true\n },\n 8: {\n isLeft: true,\n isHorizontallyCentered: false,\n isRight: false,\n isTop: false,\n isVerticallyCentered: true,\n isBottom: false\n }\n }\n });\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - Viewer\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n// dictionary from hash to private properties\nvar THIS = {};\nvar nextHash = 1;\n\n/**\n *\n * The main point of entry into creating a zoomable image on the page.<br>\n * <br>\n * We have provided an idiomatic javascript constructor which takes\n * a single object, but still support the legacy positional arguments.<br>\n * <br>\n * The options below are given in order that they appeared in the constructor\n * as arguments and we translate a positional call into an idiomatic call.<br>\n * <br>\n * To create a viewer, you can use either of this methods:<br>\n * <ul>\n * <li><code>var viewer = new OpenSeadragon.Viewer(options);</code></li>\n * <li><code>var viewer = OpenSeadragon(options);</code></li>\n * </ul>\n * @class Viewer\n * @classdesc The main OpenSeadragon viewer class.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.EventSource\n * @extends OpenSeadragon.ControlDock\n * @param {OpenSeadragon.Options} options - Viewer options.\n *\n **/\n$.Viewer = function( options ) {\n\n var args = arguments,\n _this = this,\n i;\n\n\n //backward compatibility for positional args while preferring more\n //idiomatic javascript options object as the only argument\n if( !$.isPlainObject( options ) ){\n options = {\n id: args[ 0 ],\n xmlPath: args.length > 1 ? args[ 1 ] : undefined,\n prefixUrl: args.length > 2 ? args[ 2 ] : undefined,\n controls: args.length > 3 ? args[ 3 ] : undefined,\n overlays: args.length > 4 ? args[ 4 ] : undefined\n };\n }\n\n //options.config and the general config argument are deprecated\n //in favor of the more direct specification of optional settings\n //being pass directly on the options object\n if ( options.config ){\n $.extend( true, options, options.config );\n delete options.config;\n }\n\n //Public properties\n //Allow the options object to override global defaults\n $.extend( true, this, {\n\n //internal state and dom identifiers\n id: options.id,\n hash: options.hash || nextHash++,\n /**\n * Index for page to be shown first next time open() is called (only used in sequenceMode).\n * @member {Number} initialPage\n * @memberof OpenSeadragon.Viewer#\n */\n initialPage: 0,\n\n //dom nodes\n /**\n * The parent element of this Viewer instance, passed in when the Viewer was created.\n * @member {Element} element\n * @memberof OpenSeadragon.Viewer#\n */\n element: null,\n /**\n * A &lt;div&gt; element (provided by {@link OpenSeadragon.ControlDock}), the base element of this Viewer instance.<br><br>\n * Child element of {@link OpenSeadragon.Viewer#element}.\n * @member {Element} container\n * @memberof OpenSeadragon.Viewer#\n */\n container: null,\n /**\n * A &lt;div&gt; element, the element where user-input events are handled for panning and zooming.<br><br>\n * Child element of {@link OpenSeadragon.Viewer#container},\n * positioned on top of {@link OpenSeadragon.Viewer#keyboardCommandArea}.<br><br>\n * The parent of {@link OpenSeadragon.Drawer#canvas} instances.\n * @member {Element} canvas\n * @memberof OpenSeadragon.Viewer#\n */\n canvas: null,\n\n // Overlays list. An overlay allows to add html on top of the viewer.\n overlays: [],\n // Container inside the canvas where overlays are drawn.\n overlaysContainer: null,\n\n //private state properties\n previousBody: [],\n\n //This was originally initialized in the constructor and so could never\n //have anything in it. now it can because we allow it to be specified\n //in the options and is only empty by default if not specified. Also\n //this array was returned from get_controls which I find confusing\n //since this object has a controls property which is treated in other\n //functions like clearControls. I'm removing the accessors.\n customControls: [],\n\n //These are originally not part options but declared as members\n //in initialize. It's still considered idiomatic to put them here\n //source is here for backwards compatibility. It is not an official\n //part of the API and should not be relied upon.\n source: null,\n /**\n * Handles rendering of tiles in the viewer. Created for each TileSource opened.\n * @member {OpenSeadragon.Drawer} drawer\n * @memberof OpenSeadragon.Viewer#\n */\n drawer: null,\n /**\n * Keeps track of all of the tiled images in the scene.\n * @member {OpenSeadragon.Drawer} world\n * @memberof OpenSeadragon.Viewer#\n */\n world: null,\n /**\n * Handles coordinate-related functionality - zoom, pan, rotation, etc. Created for each TileSource opened.\n * @member {OpenSeadragon.Viewport} viewport\n * @memberof OpenSeadragon.Viewer#\n */\n viewport: null,\n /**\n * @member {OpenSeadragon.Navigator} navigator\n * @memberof OpenSeadragon.Viewer#\n */\n navigator: null,\n\n //A collection viewport is a separate viewport used to provide\n //simultaneous rendering of sets of tiles\n collectionViewport: null,\n collectionDrawer: null,\n\n //UI image resources\n //TODO: rename navImages to uiImages\n navImages: null,\n\n //interface button controls\n buttons: null,\n\n //TODO: this is defunct so safely remove it\n profiler: null\n\n }, $.DEFAULT_SETTINGS, options );\n\n if ( typeof ( this.hash) === \"undefined\" ) {\n throw new Error(\"A hash must be defined, either by specifying options.id or options.hash.\");\n }\n if ( typeof ( THIS[ this.hash ] ) !== \"undefined\" ) {\n // We don't want to throw an error here, as the user might have discarded\n // the previous viewer with the same hash and now want to recreate it.\n $.console.warn(\"Hash \" + this.hash + \" has already been used.\");\n }\n\n //Private state properties\n THIS[ this.hash ] = {\n \"fsBoundsDelta\": new $.Point( 1, 1 ),\n \"prevContainerSize\": null,\n \"animating\": false,\n \"forceRedraw\": false,\n \"mouseInside\": false,\n \"group\": null,\n // whether we should be continuously zooming\n \"zooming\": false,\n // how much we should be continuously zooming by\n \"zoomFactor\": null,\n \"lastZoomTime\": null,\n \"fullPage\": false,\n \"onfullscreenchange\": null\n };\n\n this._sequenceIndex = 0;\n this._firstOpen = true;\n this._updateRequestId = null;\n this._loadQueue = [];\n this.currentOverlays = [];\n\n this._lastScrollTime = $.now(); // variable used to help normalize the scroll event speed of different devices\n\n //Inherit some behaviors and properties\n $.EventSource.call( this );\n\n this.addHandler( 'open-failed', function ( event ) {\n var msg = $.getString( \"Errors.OpenFailed\", event.eventSource, event.message);\n _this._showMessage( msg );\n });\n\n $.ControlDock.call( this, options );\n\n //Deal with tile sources\n if (this.xmlPath) {\n //Deprecated option. Now it is preferred to use the tileSources option\n this.tileSources = [ this.xmlPath ];\n }\n\n this.element = this.element || document.getElementById( this.id );\n this.canvas = $.makeNeutralElement( \"div\" );\n\n this.canvas.className = \"openseadragon-canvas\";\n (function( style ){\n style.width = \"100%\";\n style.height = \"100%\";\n style.overflow = \"hidden\";\n style.position = \"absolute\";\n style.top = \"0px\";\n style.left = \"0px\";\n }(this.canvas.style));\n $.setElementTouchActionNone( this.canvas );\n if (options.tabIndex !== \"\") {\n this.canvas.tabIndex = (options.tabIndex === undefined ? 0 : options.tabIndex);\n }\n\n //the container is created through applying the ControlDock constructor above\n this.container.className = \"openseadragon-container\";\n (function( style ){\n style.width = \"100%\";\n style.height = \"100%\";\n style.position = \"relative\";\n style.overflow = \"hidden\";\n style.left = \"0px\";\n style.top = \"0px\";\n style.textAlign = \"left\"; // needed to protect against\n }( this.container.style ));\n\n this.container.insertBefore( this.canvas, this.container.firstChild );\n this.element.appendChild( this.container );\n\n //Used for toggling between fullscreen and default container size\n //TODO: these can be closure private and shared across Viewer\n // instances.\n this.bodyWidth = document.body.style.width;\n this.bodyHeight = document.body.style.height;\n this.bodyOverflow = document.body.style.overflow;\n this.docOverflow = document.documentElement.style.overflow;\n\n this.innerTracker = new $.MouseTracker({\n element: this.canvas,\n startDisabled: !this.mouseNavEnabled,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n dblClickTimeThreshold: this.dblClickTimeThreshold,\n dblClickDistThreshold: this.dblClickDistThreshold,\n keyDownHandler: $.delegate( this, onCanvasKeyDown ),\n keyHandler: $.delegate( this, onCanvasKeyPress ),\n clickHandler: $.delegate( this, onCanvasClick ),\n dblClickHandler: $.delegate( this, onCanvasDblClick ),\n dragHandler: $.delegate( this, onCanvasDrag ),\n dragEndHandler: $.delegate( this, onCanvasDragEnd ),\n enterHandler: $.delegate( this, onCanvasEnter ),\n exitHandler: $.delegate( this, onCanvasExit ),\n pressHandler: $.delegate( this, onCanvasPress ),\n releaseHandler: $.delegate( this, onCanvasRelease ),\n nonPrimaryPressHandler: $.delegate( this, onCanvasNonPrimaryPress ),\n nonPrimaryReleaseHandler: $.delegate( this, onCanvasNonPrimaryRelease ),\n scrollHandler: $.delegate( this, onCanvasScroll ),\n pinchHandler: $.delegate( this, onCanvasPinch )\n });\n\n this.outerTracker = new $.MouseTracker({\n element: this.container,\n startDisabled: !this.mouseNavEnabled,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n dblClickTimeThreshold: this.dblClickTimeThreshold,\n dblClickDistThreshold: this.dblClickDistThreshold,\n enterHandler: $.delegate( this, onContainerEnter ),\n exitHandler: $.delegate( this, onContainerExit )\n });\n\n if( this.toolbar ){\n this.toolbar = new $.ControlDock({ element: this.toolbar });\n }\n\n this.bindStandardControls();\n\n THIS[ this.hash ].prevContainerSize = _getSafeElemSize( this.container );\n\n // Create the world\n this.world = new $.World({\n viewer: this\n });\n\n this.world.addHandler('add-item', function(event) {\n // For backwards compatibility, we maintain the source property\n _this.source = _this.world.getItemAt(0).source;\n\n THIS[ _this.hash ].forceRedraw = true;\n\n if (!_this._updateRequestId) {\n _this._updateRequestId = scheduleUpdate( _this, updateMulti );\n }\n });\n\n this.world.addHandler('remove-item', function(event) {\n // For backwards compatibility, we maintain the source property\n if (_this.world.getItemCount()) {\n _this.source = _this.world.getItemAt(0).source;\n } else {\n _this.source = null;\n }\n\n THIS[ _this.hash ].forceRedraw = true;\n });\n\n this.world.addHandler('metrics-change', function(event) {\n if (_this.viewport) {\n _this.viewport._setContentBounds(_this.world.getHomeBounds(), _this.world.getContentFactor());\n }\n });\n\n this.world.addHandler('item-index-change', function(event) {\n // For backwards compatibility, we maintain the source property\n _this.source = _this.world.getItemAt(0).source;\n });\n\n // Create the viewport\n this.viewport = new $.Viewport({\n containerSize: THIS[ this.hash ].prevContainerSize,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime,\n minZoomImageRatio: this.minZoomImageRatio,\n maxZoomPixelRatio: this.maxZoomPixelRatio,\n visibilityRatio: this.visibilityRatio,\n wrapHorizontal: this.wrapHorizontal,\n wrapVertical: this.wrapVertical,\n defaultZoomLevel: this.defaultZoomLevel,\n minZoomLevel: this.minZoomLevel,\n maxZoomLevel: this.maxZoomLevel,\n viewer: this,\n degrees: this.degrees,\n flipped: this.flipped,\n navigatorRotate: this.navigatorRotate,\n homeFillsViewer: this.homeFillsViewer,\n margins: this.viewportMargins\n });\n\n this.viewport._setContentBounds(this.world.getHomeBounds(), this.world.getContentFactor());\n\n // Create the image loader\n this.imageLoader = new $.ImageLoader({\n jobLimit: this.imageLoaderLimit,\n timeout: options.timeout\n });\n\n // Create the tile cache\n this.tileCache = new $.TileCache({\n maxImageCacheCount: this.maxImageCacheCount\n });\n\n // Create the drawer\n this.drawer = new $.Drawer({\n viewer: this,\n viewport: this.viewport,\n element: this.canvas,\n debugGridColor: this.debugGridColor\n });\n\n // Overlay container\n this.overlaysContainer = $.makeNeutralElement( \"div\" );\n this.canvas.appendChild( this.overlaysContainer );\n\n // Now that we have a drawer, see if it supports rotate. If not we need to remove the rotate buttons\n if (!this.drawer.canRotate()) {\n // Disable/remove the rotate left/right buttons since they aren't supported\n if (this.rotateLeft) {\n i = this.buttons.buttons.indexOf(this.rotateLeft);\n this.buttons.buttons.splice(i, 1);\n this.buttons.element.removeChild(this.rotateLeft.element);\n }\n if (this.rotateRight) {\n i = this.buttons.buttons.indexOf(this.rotateRight);\n this.buttons.buttons.splice(i, 1);\n this.buttons.element.removeChild(this.rotateRight.element);\n }\n }\n\n //Instantiate a navigator if configured\n if ( this.showNavigator){\n this.navigator = new $.Navigator({\n id: this.navigatorId,\n position: this.navigatorPosition,\n sizeRatio: this.navigatorSizeRatio,\n maintainSizeRatio: this.navigatorMaintainSizeRatio,\n top: this.navigatorTop,\n left: this.navigatorLeft,\n width: this.navigatorWidth,\n height: this.navigatorHeight,\n autoResize: this.navigatorAutoResize,\n autoFade: this.navigatorAutoFade,\n prefixUrl: this.prefixUrl,\n viewer: this,\n navigatorRotate: this.navigatorRotate,\n background: this.navigatorBackground,\n opacity: this.navigatorOpacity,\n borderColor: this.navigatorBorderColor,\n displayRegionColor: this.navigatorDisplayRegionColor,\n crossOriginPolicy: this.crossOriginPolicy\n });\n }\n\n // Sequence mode\n if (this.sequenceMode) {\n this.bindSequenceControls();\n }\n\n // Open initial tilesources\n if (this.tileSources) {\n this.open( this.tileSources );\n }\n\n // Add custom controls\n for ( i = 0; i < this.customControls.length; i++ ) {\n this.addControl(\n this.customControls[ i ].id,\n {anchor: this.customControls[ i ].anchor}\n );\n }\n\n // Initial fade out\n $.requestAnimationFrame( function(){\n beginControlsAutoHide( _this );\n } );\n\n // Initial canvas options\n if ( this.imageSmoothingEnabled !== undefined && !this.imageSmoothingEnabled){\n this.drawer.setImageSmoothingEnabled(this.imageSmoothingEnabled);\n }\n\n};\n\n$.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, /** @lends OpenSeadragon.Viewer.prototype */{\n\n\n /**\n * @function\n * @return {Boolean}\n */\n isOpen: function () {\n return !!this.world.getItemCount();\n },\n\n // deprecated\n openDzi: function ( dzi ) {\n $.console.error( \"[Viewer.openDzi] this function is deprecated; use Viewer.open() instead.\" );\n return this.open( dzi );\n },\n\n // deprecated\n openTileSource: function ( tileSource ) {\n $.console.error( \"[Viewer.openTileSource] this function is deprecated; use Viewer.open() instead.\" );\n return this.open( tileSource );\n },\n\n /**\n * Open tiled images into the viewer, closing any others.\n * To get the TiledImage instance created by open, add an event listener for\n * {@link OpenSeadragon.Viewer.html#.event:open}, which when fired can be used to get access\n * to the instance, i.e., viewer.world.getItemAt(0).\n * @function\n * @param {Array|String|Object|Function} tileSources - This can be a TiledImage\n * specifier, a TileSource specifier, or an array of either. A TiledImage specifier\n * is the same as the options parameter for {@link OpenSeadragon.Viewer#addTiledImage},\n * except for the index property; images are added in sequence.\n * A TileSource specifier is anything you could pass as the tileSource property\n * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}.\n * @param {Number} initialPage - If sequenceMode is true, display this page initially\n * for the given tileSources. If specified, will overwrite the Viewer's existing initialPage property.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:open\n * @fires OpenSeadragon.Viewer.event:open-failed\n */\n open: function (tileSources, initialPage) {\n var _this = this;\n\n this.close();\n\n if (!tileSources) {\n return;\n }\n\n if (this.sequenceMode && $.isArray(tileSources)) {\n if (this.referenceStrip) {\n this.referenceStrip.destroy();\n this.referenceStrip = null;\n }\n\n if (typeof initialPage != 'undefined' && !isNaN(initialPage)) {\n this.initialPage = initialPage;\n }\n\n this.tileSources = tileSources;\n this._sequenceIndex = Math.max(0, Math.min(this.tileSources.length - 1, this.initialPage));\n if (this.tileSources.length) {\n this.open(this.tileSources[this._sequenceIndex]);\n\n if ( this.showReferenceStrip ){\n this.addReferenceStrip();\n }\n }\n\n this._updateSequenceButtons( this._sequenceIndex );\n return;\n }\n\n if (!$.isArray(tileSources)) {\n tileSources = [tileSources];\n }\n\n if (!tileSources.length) {\n return;\n }\n\n this._opening = true;\n\n var expected = tileSources.length;\n var successes = 0;\n var failures = 0;\n var failEvent;\n\n var checkCompletion = function() {\n if (successes + failures === expected) {\n if (successes) {\n if (_this._firstOpen || !_this.preserveViewport) {\n _this.viewport.goHome( true );\n _this.viewport.update();\n }\n\n _this._firstOpen = false;\n\n var source = tileSources[0];\n if (source.tileSource) {\n source = source.tileSource;\n }\n\n // Global overlays\n if( _this.overlays && !_this.preserveOverlays ){\n for ( var i = 0; i < _this.overlays.length; i++ ) {\n _this.currentOverlays[ i ] = getOverlayObject( _this, _this.overlays[ i ] );\n }\n }\n\n _this._drawOverlays();\n _this._opening = false;\n\n /**\n * Raised when the viewer has opened and loaded one or more TileSources.\n *\n * @event open\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {OpenSeadragon.TileSource} source - The tile source that was opened.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n // TODO: what if there are multiple sources?\n _this.raiseEvent( 'open', { source: source } );\n } else {\n _this._opening = false;\n\n /**\n * Raised when an error occurs loading a TileSource.\n *\n * @event open-failed\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {String} message - Information about what failed.\n * @property {String} source - The tile source that failed.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'open-failed', failEvent );\n }\n }\n };\n\n var doOne = function(options) {\n if (!$.isPlainObject(options) || !options.tileSource) {\n options = {\n tileSource: options\n };\n }\n\n if (options.index !== undefined) {\n $.console.error('[Viewer.open] setting indexes here is not supported; use addTiledImage instead');\n delete options.index;\n }\n\n if (options.collectionImmediately === undefined) {\n options.collectionImmediately = true;\n }\n\n var originalSuccess = options.success;\n options.success = function(event) {\n successes++;\n\n // TODO: now that options has other things besides tileSource, the overlays\n // should probably be at the options level, not the tileSource level.\n if (options.tileSource.overlays) {\n for (var i = 0; i < options.tileSource.overlays.length; i++) {\n _this.addOverlay(options.tileSource.overlays[i]);\n }\n }\n\n if (originalSuccess) {\n originalSuccess(event);\n }\n\n checkCompletion();\n };\n\n var originalError = options.error;\n options.error = function(event) {\n failures++;\n\n if (!failEvent) {\n failEvent = event;\n }\n\n if (originalError) {\n originalError(event);\n }\n\n checkCompletion();\n };\n\n _this.addTiledImage(options);\n };\n\n // TileSources\n for (var i = 0; i < tileSources.length; i++) {\n doOne(tileSources[i]);\n }\n\n return this;\n },\n\n\n /**\n * @function\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:close\n */\n close: function ( ) {\n if ( !THIS[ this.hash ] ) {\n //this viewer has already been destroyed: returning immediately\n return this;\n }\n\n this._opening = false;\n\n if ( this.navigator ) {\n this.navigator.close();\n }\n\n if (!this.preserveOverlays) {\n this.clearOverlays();\n this.overlaysContainer.innerHTML = \"\";\n }\n\n THIS[ this.hash ].animating = false;\n this.world.removeAll();\n this.imageLoader.clear();\n\n /**\n * Raised when the viewer is closed (see {@link OpenSeadragon.Viewer#close}).\n *\n * @event close\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'close' );\n\n return this;\n },\n\n\n /**\n * Function to destroy the viewer and clean up everything created by OpenSeadragon.\n *\n * Example:\n * var viewer = OpenSeadragon({\n * [...]\n * });\n *\n * //when you are done with the viewer:\n * viewer.destroy();\n * viewer = null; //important\n *\n * @function\n */\n destroy: function( ) {\n if ( !THIS[ this.hash ] ) {\n //this viewer has already been destroyed: returning immediately\n return;\n }\n\n this.close();\n\n this.clearOverlays();\n this.overlaysContainer.innerHTML = \"\";\n\n //TODO: implement this...\n //this.unbindSequenceControls()\n //this.unbindStandardControls()\n\n if (this.referenceStrip) {\n this.referenceStrip.destroy();\n this.referenceStrip = null;\n }\n\n if ( this._updateRequestId !== null ) {\n $.cancelAnimationFrame( this._updateRequestId );\n this._updateRequestId = null;\n }\n\n if ( this.drawer ) {\n this.drawer.destroy();\n }\n\n this.removeAllHandlers();\n\n // Go through top element (passed to us) and remove all children\n // Use removeChild to make sure it handles SVG or any non-html\n // also it performs better - http://jsperf.com/innerhtml-vs-removechild/15\n if (this.element){\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n\n // destroy the mouse trackers\n if (this.innerTracker){\n this.innerTracker.destroy();\n }\n if (this.outerTracker){\n this.outerTracker.destroy();\n }\n\n THIS[ this.hash ] = null;\n delete THIS[ this.hash ];\n\n // clear all our references to dom objects\n this.canvas = null;\n this.container = null;\n\n // clear our reference to the main element - they will need to pass it in again, creating a new viewer\n this.element = null;\n },\n\n /**\n * @function\n * @return {Boolean}\n */\n isMouseNavEnabled: function () {\n return this.innerTracker.isTracking();\n },\n\n /**\n * @function\n * @param {Boolean} enabled - true to enable, false to disable\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:mouse-enabled\n */\n setMouseNavEnabled: function( enabled ){\n this.innerTracker.setTracking( enabled );\n this.outerTracker.setTracking( enabled );\n /**\n * Raised when mouse/touch navigation is enabled or disabled (see {@link OpenSeadragon.Viewer#setMouseNavEnabled}).\n *\n * @event mouse-enabled\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} enabled\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'mouse-enabled', { enabled: enabled } );\n return this;\n },\n\n\n /**\n * @function\n * @return {Boolean}\n */\n areControlsEnabled: function () {\n var enabled = this.controls.length,\n i;\n for( i = 0; i < this.controls.length; i++ ){\n enabled = enabled && this.controls[ i ].isVisible();\n }\n return enabled;\n },\n\n\n /**\n * Shows or hides the controls (e.g. the default navigation buttons).\n *\n * @function\n * @param {Boolean} true to show, false to hide.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:controls-enabled\n */\n setControlsEnabled: function( enabled ) {\n if( enabled ){\n abortControlsAutoHide( this );\n } else {\n beginControlsAutoHide( this );\n }\n /**\n * Raised when the navigation controls are shown or hidden (see {@link OpenSeadragon.Viewer#setControlsEnabled}).\n *\n * @event controls-enabled\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} enabled\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'controls-enabled', { enabled: enabled } );\n return this;\n },\n\n /**\n * Turns debugging mode on or off for this viewer.\n *\n * @function\n * @param {Boolean} true to turn debug on, false to turn debug off.\n */\n setDebugMode: function(debugMode){\n\n for (var i = 0; i < this.world.getItemCount(); i++) {\n this.world.getItemAt(i).debugMode = debugMode;\n }\n\n this.debugMode = debugMode;\n this.forceRedraw();\n },\n\n /**\n * @function\n * @return {Boolean}\n */\n isFullPage: function () {\n return THIS[ this.hash ].fullPage;\n },\n\n\n /**\n * Toggle full page mode.\n * @function\n * @param {Boolean} fullPage\n * If true, enter full page mode. If false, exit full page mode.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:pre-full-page\n * @fires OpenSeadragon.Viewer.event:full-page\n */\n setFullPage: function( fullPage ) {\n\n var body = document.body,\n bodyStyle = body.style,\n docStyle = document.documentElement.style,\n _this = this,\n nodes,\n i;\n\n //don't bother modifying the DOM if we are already in full page mode.\n if ( fullPage == this.isFullPage() ) {\n return this;\n }\n\n var fullPageEventArgs = {\n fullPage: fullPage,\n preventDefaultAction: false\n };\n /**\n * Raised when the viewer is about to change to/from full-page mode (see {@link OpenSeadragon.Viewer#setFullPage}).\n *\n * @event pre-full-page\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} fullPage - True if entering full-page mode, false if exiting full-page mode.\n * @property {Boolean} preventDefaultAction - Set to true to prevent full-page mode change. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'pre-full-page', fullPageEventArgs );\n if ( fullPageEventArgs.preventDefaultAction ) {\n return this;\n }\n\n if ( fullPage ) {\n\n this.elementSize = $.getElementSize( this.element );\n this.pageScroll = $.getPageScroll();\n\n this.elementMargin = this.element.style.margin;\n this.element.style.margin = \"0\";\n this.elementPadding = this.element.style.padding;\n this.element.style.padding = \"0\";\n\n this.bodyMargin = bodyStyle.margin;\n this.docMargin = docStyle.margin;\n bodyStyle.margin = \"0\";\n docStyle.margin = \"0\";\n\n this.bodyPadding = bodyStyle.padding;\n this.docPadding = docStyle.padding;\n bodyStyle.padding = \"0\";\n docStyle.padding = \"0\";\n\n this.bodyWidth = bodyStyle.width;\n this.docWidth = docStyle.width;\n bodyStyle.width = \"100%\";\n docStyle.width = \"100%\";\n\n this.bodyHeight = bodyStyle.height;\n this.docHeight = docStyle.height;\n bodyStyle.height = \"100%\";\n docStyle.height = \"100%\";\n\n //when entering full screen on the ipad it wasn't sufficient to leave\n //the body intact as only only the top half of the screen would\n //respond to touch events on the canvas, while the bottom half treated\n //them as touch events on the document body. Thus we remove and store\n //the bodies elements and replace them when we leave full screen.\n this.previousBody = [];\n THIS[ this.hash ].prevElementParent = this.element.parentNode;\n THIS[ this.hash ].prevNextSibling = this.element.nextSibling;\n THIS[ this.hash ].prevElementWidth = this.element.style.width;\n THIS[ this.hash ].prevElementHeight = this.element.style.height;\n nodes = body.childNodes.length;\n for ( i = 0; i < nodes; i++ ) {\n this.previousBody.push( body.childNodes[ 0 ] );\n body.removeChild( body.childNodes[ 0 ] );\n }\n\n //If we've got a toolbar, we need to enable the user to use css to\n //preserve it in fullpage mode\n if ( this.toolbar && this.toolbar.element ) {\n //save a reference to the parent so we can put it back\n //in the long run we need a better strategy\n this.toolbar.parentNode = this.toolbar.element.parentNode;\n this.toolbar.nextSibling = this.toolbar.element.nextSibling;\n body.appendChild( this.toolbar.element );\n\n //Make sure the user has some ability to style the toolbar based\n //on the mode\n $.addClass( this.toolbar.element, 'fullpage' );\n }\n\n $.addClass( this.element, 'fullpage' );\n body.appendChild( this.element );\n\n this.element.style.height = $.getWindowSize().y + 'px';\n this.element.style.width = $.getWindowSize().x + 'px';\n\n if ( this.toolbar && this.toolbar.element ) {\n this.element.style.height = (\n $.getElementSize( this.element ).y - $.getElementSize( this.toolbar.element ).y\n ) + 'px';\n }\n\n THIS[ this.hash ].fullPage = true;\n\n // mouse will be inside container now\n $.delegate( this, onContainerEnter )( {} );\n\n } else {\n\n this.element.style.margin = this.elementMargin;\n this.element.style.padding = this.elementPadding;\n\n bodyStyle.margin = this.bodyMargin;\n docStyle.margin = this.docMargin;\n\n bodyStyle.padding = this.bodyPadding;\n docStyle.padding = this.docPadding;\n\n bodyStyle.width = this.bodyWidth;\n docStyle.width = this.docWidth;\n\n bodyStyle.height = this.bodyHeight;\n docStyle.height = this.docHeight;\n\n body.removeChild( this.element );\n nodes = this.previousBody.length;\n for ( i = 0; i < nodes; i++ ) {\n body.appendChild( this.previousBody.shift() );\n }\n\n $.removeClass( this.element, 'fullpage' );\n THIS[ this.hash ].prevElementParent.insertBefore(\n this.element,\n THIS[ this.hash ].prevNextSibling\n );\n\n //If we've got a toolbar, we need to enable the user to use css to\n //reset it to its original state\n if ( this.toolbar && this.toolbar.element ) {\n body.removeChild( this.toolbar.element );\n\n //Make sure the user has some ability to style the toolbar based\n //on the mode\n $.removeClass( this.toolbar.element, 'fullpage' );\n\n this.toolbar.parentNode.insertBefore(\n this.toolbar.element,\n this.toolbar.nextSibling\n );\n delete this.toolbar.parentNode;\n delete this.toolbar.nextSibling;\n }\n\n this.element.style.width = THIS[ this.hash ].prevElementWidth;\n this.element.style.height = THIS[ this.hash ].prevElementHeight;\n\n // After exiting fullPage or fullScreen, it can take some time\n // before the browser can actually set the scroll.\n var restoreScrollCounter = 0;\n var restoreScroll = function() {\n $.setPageScroll( _this.pageScroll );\n var pageScroll = $.getPageScroll();\n restoreScrollCounter++;\n if (restoreScrollCounter < 10 &&\n (pageScroll.x !== _this.pageScroll.x ||\n pageScroll.y !== _this.pageScroll.y)) {\n $.requestAnimationFrame( restoreScroll );\n }\n };\n $.requestAnimationFrame( restoreScroll );\n\n THIS[ this.hash ].fullPage = false;\n\n // mouse will likely be outside now\n $.delegate( this, onContainerExit )( { } );\n\n }\n\n if ( this.navigator && this.viewport ) {\n this.navigator.update( this.viewport );\n }\n\n /**\n * Raised when the viewer has changed to/from full-page mode (see {@link OpenSeadragon.Viewer#setFullPage}).\n *\n * @event full-page\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} fullPage - True if changed to full-page mode, false if exited full-page mode.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'full-page', { fullPage: fullPage } );\n\n return this;\n },\n\n /**\n * Toggle full screen mode if supported. Toggle full page mode otherwise.\n * @function\n * @param {Boolean} fullScreen\n * If true, enter full screen mode. If false, exit full screen mode.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:pre-full-screen\n * @fires OpenSeadragon.Viewer.event:full-screen\n */\n setFullScreen: function( fullScreen ) {\n var _this = this;\n\n if ( !$.supportsFullScreen ) {\n return this.setFullPage( fullScreen );\n }\n\n if ( $.isFullScreen() === fullScreen ) {\n return this;\n }\n\n var fullScreeEventArgs = {\n fullScreen: fullScreen,\n preventDefaultAction: false\n };\n /**\n * Raised when the viewer is about to change to/from full-screen mode (see {@link OpenSeadragon.Viewer#setFullScreen}).\n * Note: the pre-full-screen event is not raised when the user is exiting\n * full-screen mode by pressing the Esc key. In that case, consider using\n * the full-screen, pre-full-page or full-page events.\n *\n * @event pre-full-screen\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} fullScreen - True if entering full-screen mode, false if exiting full-screen mode.\n * @property {Boolean} preventDefaultAction - Set to true to prevent full-screen mode change. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'pre-full-screen', fullScreeEventArgs );\n if ( fullScreeEventArgs.preventDefaultAction ) {\n return this;\n }\n\n if ( fullScreen ) {\n\n this.setFullPage( true );\n // If the full page mode is not actually entered, we need to prevent\n // the full screen mode.\n if ( !this.isFullPage() ) {\n return this;\n }\n\n this.fullPageStyleWidth = this.element.style.width;\n this.fullPageStyleHeight = this.element.style.height;\n this.element.style.width = '100%';\n this.element.style.height = '100%';\n\n var onFullScreenChange = function() {\n var isFullScreen = $.isFullScreen();\n if ( !isFullScreen ) {\n $.removeEvent( document, $.fullScreenEventName, onFullScreenChange );\n $.removeEvent( document, $.fullScreenErrorEventName, onFullScreenChange );\n\n _this.setFullPage( false );\n if ( _this.isFullPage() ) {\n _this.element.style.width = _this.fullPageStyleWidth;\n _this.element.style.height = _this.fullPageStyleHeight;\n }\n }\n if ( _this.navigator && _this.viewport ) {\n //09/08/2018 - Fabroh : Fix issue #1504 : Ensure to get the navigator updated on fullscreen out with custom location with a timeout\n setTimeout(function(){\n _this.navigator.update( _this.viewport );\n });\n }\n /**\n * Raised when the viewer has changed to/from full-screen mode (see {@link OpenSeadragon.Viewer#setFullScreen}).\n *\n * @event full-screen\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} fullScreen - True if changed to full-screen mode, false if exited full-screen mode.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'full-screen', { fullScreen: isFullScreen } );\n };\n $.addEvent( document, $.fullScreenEventName, onFullScreenChange );\n $.addEvent( document, $.fullScreenErrorEventName, onFullScreenChange );\n\n $.requestFullScreen( document.body );\n\n } else {\n $.exitFullScreen();\n }\n return this;\n },\n\n /**\n * @function\n * @return {Boolean}\n */\n isVisible: function () {\n return this.container.style.visibility != \"hidden\";\n },\n\n\n /**\n * @function\n * @param {Boolean} visible\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:visible\n */\n setVisible: function( visible ){\n this.container.style.visibility = visible ? \"\" : \"hidden\";\n /**\n * Raised when the viewer is shown or hidden (see {@link OpenSeadragon.Viewer#setVisible}).\n *\n * @event visible\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Boolean} visible\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'visible', { visible: visible } );\n return this;\n },\n\n /**\n * Add a tiled image to the viewer.\n * options.tileSource can be anything that {@link OpenSeadragon.Viewer#open}\n * supports except arrays of images.\n * Note that you can specify options.width or options.height, but not both.\n * The other dimension will be calculated according to the item's aspect ratio.\n * If collectionMode is on (see {@link OpenSeadragon.Options}), the new image is\n * automatically arranged with the others.\n * @function\n * @param {Object} options\n * @param {String|Object|Function} options.tileSource - The TileSource specifier.\n * A String implies a url used to determine the tileSource implementation\n * based on the file extension of url. JSONP is implied by *.js,\n * otherwise the url is retrieved as text and the resulting text is\n * introspected to determine if its json, xml, or text and parsed.\n * An Object implies an inline configuration which has a single\n * property sufficient for being able to determine tileSource\n * implementation. If the object has a property which is a function\n * named 'getTileUrl', it is treated as a custom TileSource.\n * @param {Number} [options.index] The index of the item. Added on top of\n * all other items if not specified.\n * @param {Boolean} [options.replace=false] If true, the item at options.index will be\n * removed and the new item is added in its place. options.tileSource will be\n * interpreted and fetched if necessary before the old item is removed to avoid leaving\n * a gap in the world.\n * @param {Number} [options.x=0] The X position for the image in viewport coordinates.\n * @param {Number} [options.y=0] The Y position for the image in viewport coordinates.\n * @param {Number} [options.width=1] The width for the image in viewport coordinates.\n * @param {Number} [options.height] The height for the image in viewport coordinates.\n * @param {OpenSeadragon.Rect} [options.fitBounds] The bounds in viewport coordinates\n * to fit the image into. If specified, x, y, width and height get ignored.\n * @param {OpenSeadragon.Placement} [options.fitBoundsPlacement=OpenSeadragon.Placement.CENTER]\n * How to anchor the image in the bounds if options.fitBounds is set.\n * @param {OpenSeadragon.Rect} [options.clip] - An area, in image pixels, to clip to\n * (portions of the image outside of this area will not be visible). Only works on\n * browsers that support the HTML5 canvas.\n * @param {Number} [options.opacity=1] Proportional opacity of the tiled images (1=opaque, 0=hidden)\n * @param {Boolean} [options.preload=false] Default switch for loading hidden images (true loads, false blocks)\n * @param {Number} [options.degrees=0] Initial rotation of the tiled image around\n * its top left corner in degrees.\n * @param {String} [options.compositeOperation] How the image is composited onto other images.\n * @param {String} [options.crossOriginPolicy] The crossOriginPolicy for this specific image,\n * overriding viewer.crossOriginPolicy.\n * @param {Boolean} [options.ajaxWithCredentials] Whether to set withCredentials on tile AJAX\n * @param {Boolean} [options.loadTilesWithAjax]\n * Whether to load tile data using AJAX requests.\n * Defaults to the setting in {@link OpenSeadragon.Options}.\n * @param {Object} [options.ajaxHeaders]\n * A set of headers to include when making tile AJAX requests.\n * Note that these headers will be merged over any headers specified in {@link OpenSeadragon.Options}.\n * Specifying a falsy value for a header will clear its existing value set at the Viewer level (if any).\n * requests.\n * @param {Function} [options.success] A function that gets called when the image is\n * successfully added. It's passed the event object which contains a single property:\n * \"item\", which is the resulting instance of TiledImage.\n * @param {Function} [options.error] A function that gets called if the image is\n * unable to be added. It's passed the error event object, which contains \"message\"\n * and \"source\" properties.\n * @param {Boolean} [options.collectionImmediately=false] If collectionMode is on,\n * specifies whether to snap to the new arrangement immediately or to animate to it.\n * @param {String|CanvasGradient|CanvasPattern|Function} [options.placeholderFillStyle] - See {@link OpenSeadragon.Options}.\n * @fires OpenSeadragon.World.event:add-item\n * @fires OpenSeadragon.Viewer.event:add-item-failed\n */\n addTiledImage: function( options ) {\n $.console.assert(options, \"[Viewer.addTiledImage] options is required\");\n $.console.assert(options.tileSource, \"[Viewer.addTiledImage] options.tileSource is required\");\n $.console.assert(!options.replace || (options.index > -1 && options.index < this.world.getItemCount()),\n \"[Viewer.addTiledImage] if options.replace is used, options.index must be a valid index in Viewer.world\");\n\n var _this = this;\n\n if (options.replace) {\n options.replaceItem = _this.world.getItemAt(options.index);\n }\n\n this._hideMessage();\n\n if (options.placeholderFillStyle === undefined) {\n options.placeholderFillStyle = this.placeholderFillStyle;\n }\n if (options.opacity === undefined) {\n options.opacity = this.opacity;\n }\n if (options.preload === undefined) {\n options.preload = this.preload;\n }\n if (options.compositeOperation === undefined) {\n options.compositeOperation = this.compositeOperation;\n }\n if (options.crossOriginPolicy === undefined) {\n options.crossOriginPolicy = options.tileSource.crossOriginPolicy !== undefined ? options.tileSource.crossOriginPolicy : this.crossOriginPolicy;\n }\n if (options.ajaxWithCredentials === undefined) {\n options.ajaxWithCredentials = this.ajaxWithCredentials;\n }\n if (options.loadTilesWithAjax === undefined) {\n options.loadTilesWithAjax = this.loadTilesWithAjax;\n }\n if (options.ajaxHeaders === undefined || options.ajaxHeaders === null) {\n options.ajaxHeaders = this.ajaxHeaders;\n } else if ($.isPlainObject(options.ajaxHeaders) && $.isPlainObject(this.ajaxHeaders)) {\n options.ajaxHeaders = $.extend({}, this.ajaxHeaders, options.ajaxHeaders);\n }\n\n var myQueueItem = {\n options: options\n };\n\n function raiseAddItemFailed( event ) {\n for (var i = 0; i < _this._loadQueue.length; i++) {\n if (_this._loadQueue[i] === myQueueItem) {\n _this._loadQueue.splice(i, 1);\n break;\n }\n }\n\n if (_this._loadQueue.length === 0) {\n refreshWorld(myQueueItem);\n }\n\n /**\n * Raised when an error occurs while adding a item.\n * @event add-item-failed\n * @memberOf OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {String} message\n * @property {String} source\n * @property {Object} options The options passed to the addTiledImage method.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'add-item-failed', event );\n\n if (options.error) {\n options.error(event);\n }\n }\n\n function refreshWorld(theItem) {\n if (_this.collectionMode) {\n _this.world.arrange({\n immediately: theItem.options.collectionImmediately,\n rows: _this.collectionRows,\n columns: _this.collectionColumns,\n layout: _this.collectionLayout,\n tileSize: _this.collectionTileSize,\n tileMargin: _this.collectionTileMargin\n });\n _this.world.setAutoRefigureSizes(true);\n }\n }\n\n if ($.isArray(options.tileSource)) {\n setTimeout(function() {\n raiseAddItemFailed({\n message: \"[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.\",\n source: options.tileSource,\n options: options\n });\n });\n return;\n }\n\n this._loadQueue.push(myQueueItem);\n\n function processReadyItems() {\n var queueItem, tiledImage, optionsClone;\n while (_this._loadQueue.length) {\n queueItem = _this._loadQueue[0];\n if (!queueItem.tileSource) {\n break;\n }\n\n _this._loadQueue.splice(0, 1);\n\n if (queueItem.options.replace) {\n var newIndex = _this.world.getIndexOfItem(queueItem.options.replaceItem);\n if (newIndex != -1) {\n queueItem.options.index = newIndex;\n }\n _this.world.removeItem(queueItem.options.replaceItem);\n }\n\n tiledImage = new $.TiledImage({\n viewer: _this,\n source: queueItem.tileSource,\n viewport: _this.viewport,\n drawer: _this.drawer,\n tileCache: _this.tileCache,\n imageLoader: _this.imageLoader,\n x: queueItem.options.x,\n y: queueItem.options.y,\n width: queueItem.options.width,\n height: queueItem.options.height,\n fitBounds: queueItem.options.fitBounds,\n fitBoundsPlacement: queueItem.options.fitBoundsPlacement,\n clip: queueItem.options.clip,\n placeholderFillStyle: queueItem.options.placeholderFillStyle,\n opacity: queueItem.options.opacity,\n preload: queueItem.options.preload,\n degrees: queueItem.options.degrees,\n compositeOperation: queueItem.options.compositeOperation,\n springStiffness: _this.springStiffness,\n animationTime: _this.animationTime,\n minZoomImageRatio: _this.minZoomImageRatio,\n wrapHorizontal: _this.wrapHorizontal,\n wrapVertical: _this.wrapVertical,\n immediateRender: _this.immediateRender,\n blendTime: _this.blendTime,\n alwaysBlend: _this.alwaysBlend,\n minPixelRatio: _this.minPixelRatio,\n smoothTileEdgesMinZoom: _this.smoothTileEdgesMinZoom,\n iOSDevice: _this.iOSDevice,\n crossOriginPolicy: queueItem.options.crossOriginPolicy,\n ajaxWithCredentials: queueItem.options.ajaxWithCredentials,\n loadTilesWithAjax: queueItem.options.loadTilesWithAjax,\n ajaxHeaders: queueItem.options.ajaxHeaders,\n debugMode: _this.debugMode\n });\n\n if (_this.collectionMode) {\n _this.world.setAutoRefigureSizes(false);\n }\n _this.world.addItem( tiledImage, {\n index: queueItem.options.index\n });\n\n if (_this._loadQueue.length === 0) {\n //this restores the autoRefigureSizes flag to true.\n refreshWorld(queueItem);\n }\n\n if (_this.world.getItemCount() === 1 && !_this.preserveViewport) {\n _this.viewport.goHome(true);\n }\n\n if (_this.navigator) {\n optionsClone = $.extend({}, queueItem.options, {\n replace: false, // navigator already removed the layer, nothing to replace\n originalTiledImage: tiledImage,\n tileSource: queueItem.tileSource\n });\n\n _this.navigator.addTiledImage(optionsClone);\n }\n\n if (queueItem.options.success) {\n queueItem.options.success({\n item: tiledImage\n });\n }\n }\n }\n\n getTileSourceImplementation( this, options.tileSource, options, function( tileSource ) {\n\n myQueueItem.tileSource = tileSource;\n\n // add everybody at the front of the queue that's ready to go\n processReadyItems();\n }, function( event ) {\n event.options = options;\n raiseAddItemFailed(event);\n\n // add everybody at the front of the queue that's ready to go\n processReadyItems();\n } );\n },\n\n /**\n * Add a simple image to the viewer.\n * The options are the same as the ones in {@link OpenSeadragon.Viewer#addTiledImage}\n * except for options.tileSource which is replaced by options.url.\n * @function\n * @param {Object} options - See {@link OpenSeadragon.Viewer#addTiledImage}\n * for all the options\n * @param {String} options.url - The URL of the image to add.\n * @fires OpenSeadragon.World.event:add-item\n * @fires OpenSeadragon.Viewer.event:add-item-failed\n */\n addSimpleImage: function(options) {\n $.console.assert(options, \"[Viewer.addSimpleImage] options is required\");\n $.console.assert(options.url, \"[Viewer.addSimpleImage] options.url is required\");\n\n var opts = $.extend({}, options, {\n tileSource: {\n type: 'image',\n url: options.url\n }\n });\n delete opts.url;\n this.addTiledImage(opts);\n },\n\n // deprecated\n addLayer: function( options ) {\n var _this = this;\n\n $.console.error( \"[Viewer.addLayer] this function is deprecated; use Viewer.addTiledImage() instead.\" );\n\n var optionsClone = $.extend({}, options, {\n success: function(event) {\n _this.raiseEvent(\"add-layer\", {\n options: options,\n drawer: event.item\n });\n },\n error: function(event) {\n _this.raiseEvent(\"add-layer-failed\", event);\n }\n });\n\n this.addTiledImage(optionsClone);\n return this;\n },\n\n // deprecated\n getLayerAtLevel: function( level ) {\n $.console.error( \"[Viewer.getLayerAtLevel] this function is deprecated; use World.getItemAt() instead.\" );\n return this.world.getItemAt(level);\n },\n\n // deprecated\n getLevelOfLayer: function( drawer ) {\n $.console.error( \"[Viewer.getLevelOfLayer] this function is deprecated; use World.getIndexOfItem() instead.\" );\n return this.world.getIndexOfItem(drawer);\n },\n\n // deprecated\n getLayersCount: function() {\n $.console.error( \"[Viewer.getLayersCount] this function is deprecated; use World.getItemCount() instead.\" );\n return this.world.getItemCount();\n },\n\n // deprecated\n setLayerLevel: function( drawer, level ) {\n $.console.error( \"[Viewer.setLayerLevel] this function is deprecated; use World.setItemIndex() instead.\" );\n return this.world.setItemIndex(drawer, level);\n },\n\n // deprecated\n removeLayer: function( drawer ) {\n $.console.error( \"[Viewer.removeLayer] this function is deprecated; use World.removeItem() instead.\" );\n return this.world.removeItem(drawer);\n },\n\n /**\n * Force the viewer to redraw its contents.\n * @returns {OpenSeadragon.Viewer} Chainable.\n */\n forceRedraw: function() {\n THIS[ this.hash ].forceRedraw = true;\n return this;\n },\n\n /**\n * @function\n * @return {OpenSeadragon.Viewer} Chainable.\n */\n bindSequenceControls: function(){\n\n //////////////////////////////////////////////////////////////////////////\n // Image Sequence Controls\n //////////////////////////////////////////////////////////////////////////\n var onFocusHandler = $.delegate( this, onFocus ),\n onBlurHandler = $.delegate( this, onBlur ),\n onNextHandler = $.delegate( this, onNext ),\n onPreviousHandler = $.delegate( this, onPrevious ),\n navImages = this.navImages,\n useGroup = true;\n\n if( this.showSequenceControl ){\n\n if( this.previousButton || this.nextButton ){\n //if we are binding to custom buttons then layout and\n //grouping is the responsibility of the page author\n useGroup = false;\n }\n\n this.previousButton = new $.Button({\n element: this.previousButton ? $.getElement( this.previousButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.PreviousPage\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.previous.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.previous.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.previous.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.previous.DOWN ),\n onRelease: onPreviousHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n });\n\n this.nextButton = new $.Button({\n element: this.nextButton ? $.getElement( this.nextButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.NextPage\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.next.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.next.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.next.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.next.DOWN ),\n onRelease: onNextHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n });\n\n if( !this.navPrevNextWrap ){\n this.previousButton.disable();\n }\n\n if (!this.tileSources || !this.tileSources.length) {\n this.nextButton.disable();\n }\n\n if( useGroup ){\n this.paging = new $.ButtonGroup({\n buttons: [\n this.previousButton,\n this.nextButton\n ],\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold\n });\n\n this.pagingControl = this.paging.element;\n\n if( this.toolbar ){\n this.toolbar.addControl(\n this.pagingControl,\n {anchor: $.ControlAnchor.BOTTOM_RIGHT}\n );\n }else{\n this.addControl(\n this.pagingControl,\n {anchor: this.sequenceControlAnchor || $.ControlAnchor.TOP_LEFT}\n );\n }\n }\n }\n return this;\n },\n\n\n /**\n * @function\n * @return {OpenSeadragon.Viewer} Chainable.\n */\n bindStandardControls: function(){\n //////////////////////////////////////////////////////////////////////////\n // Navigation Controls\n //////////////////////////////////////////////////////////////////////////\n var beginZoomingInHandler = $.delegate( this, beginZoomingIn ),\n endZoomingHandler = $.delegate( this, endZooming ),\n doSingleZoomInHandler = $.delegate( this, doSingleZoomIn ),\n beginZoomingOutHandler = $.delegate( this, beginZoomingOut ),\n doSingleZoomOutHandler = $.delegate( this, doSingleZoomOut ),\n onHomeHandler = $.delegate( this, onHome ),\n onFullScreenHandler = $.delegate( this, onFullScreen ),\n onRotateLeftHandler = $.delegate( this, onRotateLeft ),\n onRotateRightHandler = $.delegate( this, onRotateRight ),\n onFlipHandler = $.delegate( this, onFlip),\n onFocusHandler = $.delegate( this, onFocus ),\n onBlurHandler = $.delegate( this, onBlur ),\n navImages = this.navImages,\n buttons = [],\n useGroup = true;\n\n\n if ( this.showNavigationControl ) {\n\n if( this.zoomInButton || this.zoomOutButton ||\n this.homeButton || this.fullPageButton ||\n this.rotateLeftButton || this.rotateRightButton ||\n this.flipButton ) {\n //if we are binding to custom buttons then layout and\n //grouping is the responsibility of the page author\n useGroup = false;\n }\n\n if ( this.showZoomControl ) {\n buttons.push( this.zoomInButton = new $.Button({\n element: this.zoomInButton ? $.getElement( this.zoomInButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.ZoomIn\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.zoomIn.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.zoomIn.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.zoomIn.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.zoomIn.DOWN ),\n onPress: beginZoomingInHandler,\n onRelease: endZoomingHandler,\n onClick: doSingleZoomInHandler,\n onEnter: beginZoomingInHandler,\n onExit: endZoomingHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n\n buttons.push( this.zoomOutButton = new $.Button({\n element: this.zoomOutButton ? $.getElement( this.zoomOutButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.ZoomOut\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.zoomOut.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.zoomOut.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.zoomOut.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.zoomOut.DOWN ),\n onPress: beginZoomingOutHandler,\n onRelease: endZoomingHandler,\n onClick: doSingleZoomOutHandler,\n onEnter: beginZoomingOutHandler,\n onExit: endZoomingHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n }\n\n if ( this.showHomeControl ) {\n buttons.push( this.homeButton = new $.Button({\n element: this.homeButton ? $.getElement( this.homeButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.Home\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.home.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.home.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.home.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.home.DOWN ),\n onRelease: onHomeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n }\n\n if ( this.showFullPageControl ) {\n buttons.push( this.fullPageButton = new $.Button({\n element: this.fullPageButton ? $.getElement( this.fullPageButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.FullPage\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.fullpage.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.fullpage.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.fullpage.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.fullpage.DOWN ),\n onRelease: onFullScreenHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n }\n\n if ( this.showRotationControl ) {\n buttons.push( this.rotateLeftButton = new $.Button({\n element: this.rotateLeftButton ? $.getElement( this.rotateLeftButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.RotateLeft\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.rotateleft.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.rotateleft.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.rotateleft.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.rotateleft.DOWN ),\n onRelease: onRotateLeftHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n\n buttons.push( this.rotateRightButton = new $.Button({\n element: this.rotateRightButton ? $.getElement( this.rotateRightButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.RotateRight\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.rotateright.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.rotateright.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.rotateright.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.rotateright.DOWN ),\n onRelease: onRotateRightHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n }\n\n if ( this.showFlipControl ) {\n buttons.push( this.flipButton = new $.Button({\n element: this.flipButton ? $.getElement( this.flipButton ) : null,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n tooltip: $.getString( \"Tooltips.Flip\" ),\n srcRest: resolveUrl( this.prefixUrl, navImages.flip.REST ),\n srcGroup: resolveUrl( this.prefixUrl, navImages.flip.GROUP ),\n srcHover: resolveUrl( this.prefixUrl, navImages.flip.HOVER ),\n srcDown: resolveUrl( this.prefixUrl, navImages.flip.DOWN ),\n onRelease: onFlipHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler\n }));\n }\n\n if ( useGroup ) {\n this.buttons = new $.ButtonGroup({\n buttons: buttons,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold\n });\n\n this.navControl = this.buttons.element;\n this.addHandler( 'open', $.delegate( this, lightUp ) );\n\n if( this.toolbar ){\n this.toolbar.addControl(\n this.navControl,\n {anchor: this.navigationControlAnchor || $.ControlAnchor.TOP_LEFT}\n );\n } else {\n this.addControl(\n this.navControl,\n {anchor: this.navigationControlAnchor || $.ControlAnchor.TOP_LEFT}\n );\n }\n }\n\n }\n return this;\n },\n\n /**\n * Gets the active page of a sequence\n * @function\n * @return {Number}\n */\n currentPage: function() {\n return this._sequenceIndex;\n },\n\n /**\n * @function\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:page\n */\n goToPage: function( page ){\n if( this.tileSources && page >= 0 && page < this.tileSources.length ){\n this._sequenceIndex = page;\n\n this._updateSequenceButtons( page );\n\n this.open( this.tileSources[ page ] );\n\n if( this.referenceStrip ){\n this.referenceStrip.setFocus( page );\n }\n\n /**\n * Raised when the page is changed on a viewer configured with multiple image sources (see {@link OpenSeadragon.Viewer#goToPage}).\n *\n * @event page\n * @memberof OpenSeadragon.Viewer\n * @type {Object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Number} page - The page index.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'page', { page: page } );\n }\n\n return this;\n },\n\n /**\n * Adds an html element as an overlay to the current viewport. Useful for\n * highlighting words or areas of interest on an image or other zoomable\n * interface. The overlays added via this method are removed when the viewport\n * is closed which include when changing page.\n * @method\n * @param {Element|String|Object} element - A reference to an element or an id for\n * the element which will be overlaid. Or an Object specifying the configuration for the overlay.\n * If using an object, see {@link OpenSeadragon.Overlay} for a list of\n * all available options.\n * @param {OpenSeadragon.Point|OpenSeadragon.Rect} location - The point or\n * rectangle which will be overlaid. This is a viewport relative location.\n * @param {OpenSeadragon.Placement} placement - The position of the\n * viewport which the location coordinates will be treated as relative\n * to.\n * @param {function} onDraw - If supplied the callback is called when the overlay\n * needs to be drawn. It it the responsibility of the callback to do any drawing/positioning.\n * It is passed position, size and element.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:add-overlay\n */\n addOverlay: function( element, location, placement, onDraw ) {\n var options;\n if( $.isPlainObject( element ) ){\n options = element;\n } else {\n options = {\n element: element,\n location: location,\n placement: placement,\n onDraw: onDraw\n };\n }\n\n element = $.getElement( options.element );\n\n if ( getOverlayIndex( this.currentOverlays, element ) >= 0 ) {\n // they're trying to add a duplicate overlay\n return this;\n }\n\n var overlay = getOverlayObject( this, options);\n this.currentOverlays.push(overlay);\n overlay.drawHTML( this.overlaysContainer, this.viewport );\n\n /**\n * Raised when an overlay is added to the viewer (see {@link OpenSeadragon.Viewer#addOverlay}).\n *\n * @event add-overlay\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Element} element - The overlay element.\n * @property {OpenSeadragon.Point|OpenSeadragon.Rect} location\n * @property {OpenSeadragon.Placement} placement\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'add-overlay', {\n element: element,\n location: options.location,\n placement: options.placement\n });\n return this;\n },\n\n /**\n * Updates the overlay represented by the reference to the element or\n * element id moving it to the new location, relative to the new placement.\n * @method\n * @param {Element|String} element - A reference to an element or an id for\n * the element which is overlaid.\n * @param {OpenSeadragon.Point|OpenSeadragon.Rect} location - The point or\n * rectangle which will be overlaid. This is a viewport relative location.\n * @param {OpenSeadragon.Placement} placement - The position of the\n * viewport which the location coordinates will be treated as relative\n * to.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:update-overlay\n */\n updateOverlay: function( element, location, placement ) {\n var i;\n\n element = $.getElement( element );\n i = getOverlayIndex( this.currentOverlays, element );\n\n if ( i >= 0 ) {\n this.currentOverlays[ i ].update( location, placement );\n THIS[ this.hash ].forceRedraw = true;\n /**\n * Raised when an overlay's location or placement changes\n * (see {@link OpenSeadragon.Viewer#updateOverlay}).\n *\n * @event update-overlay\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the\n * Viewer which raised the event.\n * @property {Element} element\n * @property {OpenSeadragon.Point|OpenSeadragon.Rect} location\n * @property {OpenSeadragon.Placement} placement\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'update-overlay', {\n element: element,\n location: location,\n placement: placement\n });\n }\n return this;\n },\n\n /**\n * Removes an overlay identified by the reference element or element id\n * and schedules an update.\n * @method\n * @param {Element|String} element - A reference to the element or an\n * element id which represent the ovelay content to be removed.\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:remove-overlay\n */\n removeOverlay: function( element ) {\n var i;\n\n element = $.getElement( element );\n i = getOverlayIndex( this.currentOverlays, element );\n\n if ( i >= 0 ) {\n this.currentOverlays[ i ].destroy();\n this.currentOverlays.splice( i, 1 );\n THIS[ this.hash ].forceRedraw = true;\n /**\n * Raised when an overlay is removed from the viewer\n * (see {@link OpenSeadragon.Viewer#removeOverlay}).\n *\n * @event remove-overlay\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the\n * Viewer which raised the event.\n * @property {Element} element - The overlay element.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'remove-overlay', {\n element: element\n });\n }\n return this;\n },\n\n /**\n * Removes all currently configured Overlays from this Viewer and schedules\n * an update.\n * @method\n * @return {OpenSeadragon.Viewer} Chainable.\n * @fires OpenSeadragon.Viewer.event:clear-overlay\n */\n clearOverlays: function() {\n while ( this.currentOverlays.length > 0 ) {\n this.currentOverlays.pop().destroy();\n }\n THIS[ this.hash ].forceRedraw = true;\n /**\n * Raised when all overlays are removed from the viewer (see {@link OpenSeadragon.Drawer#clearOverlays}).\n *\n * @event clear-overlay\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'clear-overlay', {} );\n return this;\n },\n\n /**\n * Finds an overlay identified by the reference element or element id\n * and returns it as an object, return null if not found.\n * @method\n * @param {Element|String} element - A reference to the element or an\n * element id which represents the overlay content.\n * @return {OpenSeadragon.Overlay} the matching overlay or null if none found.\n */\n getOverlayById: function( element ) {\n var i;\n\n element = $.getElement( element );\n i = getOverlayIndex( this.currentOverlays, element );\n\n if (i >= 0) {\n return this.currentOverlays[i];\n } else {\n return null;\n }\n },\n\n /**\n * Updates the sequence buttons.\n * @function OpenSeadragon.Viewer.prototype._updateSequenceButtons\n * @private\n * @param {Number} Sequence Value\n */\n _updateSequenceButtons: function( page ) {\n\n if ( this.nextButton ) {\n if(!this.tileSources || this.tileSources.length - 1 === page) {\n //Disable next button\n if ( !this.navPrevNextWrap ) {\n this.nextButton.disable();\n }\n } else {\n this.nextButton.enable();\n }\n }\n if ( this.previousButton ) {\n if ( page > 0 ) {\n //Enable previous button\n this.previousButton.enable();\n } else {\n if ( !this.navPrevNextWrap ) {\n this.previousButton.disable();\n }\n }\n }\n },\n\n /**\n * Display a message in the viewport\n * @function OpenSeadragon.Viewer.prototype._showMessage\n * @private\n * @param {String} text message\n */\n _showMessage: function ( message ) {\n this._hideMessage();\n\n var div = $.makeNeutralElement( \"div\" );\n div.appendChild( document.createTextNode( message ) );\n\n this.messageDiv = $.makeCenteredNode( div );\n\n $.addClass(this.messageDiv, \"openseadragon-message\");\n\n this.container.appendChild( this.messageDiv );\n },\n\n /**\n * Hide any currently displayed viewport message\n * @function OpenSeadragon.Viewer.prototype._hideMessage\n * @private\n */\n _hideMessage: function () {\n var div = this.messageDiv;\n if (div) {\n div.parentNode.removeChild(div);\n delete this.messageDiv;\n }\n },\n\n /**\n * Gets this viewer's gesture settings for the given pointer device type.\n * @method\n * @param {String} type - The pointer device type to get the gesture settings for (\"mouse\", \"touch\", \"pen\", etc.).\n * @return {OpenSeadragon.GestureSettings}\n */\n gestureSettingsByDeviceType: function ( type ) {\n switch ( type ) {\n case 'mouse':\n return this.gestureSettingsMouse;\n case 'touch':\n return this.gestureSettingsTouch;\n case 'pen':\n return this.gestureSettingsPen;\n default:\n return this.gestureSettingsUnknown;\n }\n },\n\n // private\n _drawOverlays: function() {\n var i,\n length = this.currentOverlays.length;\n for ( i = 0; i < length; i++ ) {\n this.currentOverlays[ i ].drawHTML( this.overlaysContainer, this.viewport );\n }\n },\n\n /**\n * Cancel the \"in flight\" images.\n */\n _cancelPendingImages: function() {\n this._loadQueue = [];\n },\n\n /**\n * Removes the reference strip and disables displaying it.\n * @function\n */\n removeReferenceStrip: function() {\n this.showReferenceStrip = false;\n\n if (this.referenceStrip) {\n this.referenceStrip.destroy();\n this.referenceStrip = null;\n }\n },\n\n /**\n * Enables and displays the reference strip based on the currently set tileSources.\n * Works only when the Viewer has sequenceMode set to true.\n * @function\n */\n addReferenceStrip: function() {\n this.showReferenceStrip = true;\n\n if (this.sequenceMode) {\n if (this.referenceStrip) {\n return;\n }\n\n if (this.tileSources.length && this.tileSources.length > 1) {\n this.referenceStrip = new $.ReferenceStrip({\n id: this.referenceStripElement,\n position: this.referenceStripPosition,\n sizeRatio: this.referenceStripSizeRatio,\n scroll: this.referenceStripScroll,\n height: this.referenceStripHeight,\n width: this.referenceStripWidth,\n tileSources: this.tileSources,\n prefixUrl: this.prefixUrl,\n viewer: this\n });\n\n this.referenceStrip.setFocus( this._sequenceIndex );\n }\n } else {\n $.console.warn('Attempting to display a reference strip while \"sequenceMode\" is off.');\n }\n }\n});\n\n\n/**\n * _getSafeElemSize is like getElementSize(), but refuses to return 0 for x or y,\n * which was causing some calling operations to return NaN.\n * @returns {Point}\n * @private\n */\nfunction _getSafeElemSize (oElement) {\n oElement = $.getElement( oElement );\n\n return new $.Point(\n (oElement.clientWidth === 0 ? 1 : oElement.clientWidth),\n (oElement.clientHeight === 0 ? 1 : oElement.clientHeight)\n );\n}\n\n\n/**\n * @function\n * @private\n */\nfunction getTileSourceImplementation( viewer, tileSource, imgOptions, successCallback,\n failCallback ) {\n var _this = viewer;\n\n //allow plain xml strings or json strings to be parsed here\n if ( $.type( tileSource ) == 'string' ) {\n //xml should start with \"<\" and end with \">\"\n if ( tileSource.match( /^\\s*<.*>\\s*$/ ) ) {\n tileSource = $.parseXml( tileSource );\n //json should start with \"{\" or \"[\" and end with \"}\" or \"]\"\n } else if ( tileSource.match(/^\\s*[\\{\\[].*[\\}\\]]\\s*$/ ) ) {\n try {\n var tileSourceJ = $.parseJSON(tileSource);\n tileSource = tileSourceJ;\n } catch (e) {\n //tileSource = tileSource;\n }\n }\n }\n\n function waitUntilReady(tileSource, originalTileSource) {\n if (tileSource.ready) {\n successCallback(tileSource);\n } else {\n tileSource.addHandler('ready', function () {\n successCallback(tileSource);\n });\n tileSource.addHandler('open-failed', function (event) {\n failCallback({\n message: event.message,\n source: originalTileSource\n });\n });\n }\n }\n\n setTimeout( function() {\n if ( $.type( tileSource ) == 'string' ) {\n //If its still a string it means it must be a url at this point\n tileSource = new $.TileSource({\n url: tileSource,\n crossOriginPolicy: imgOptions.crossOriginPolicy !== undefined ?\n imgOptions.crossOriginPolicy : viewer.crossOriginPolicy,\n ajaxWithCredentials: viewer.ajaxWithCredentials,\n ajaxHeaders: viewer.ajaxHeaders,\n useCanvas: viewer.useCanvas,\n success: function( event ) {\n successCallback( event.tileSource );\n }\n });\n tileSource.addHandler( 'open-failed', function( event ) {\n failCallback( event );\n } );\n\n } else if ($.isPlainObject(tileSource) || tileSource.nodeType) {\n if (tileSource.crossOriginPolicy === undefined &&\n (imgOptions.crossOriginPolicy !== undefined || viewer.crossOriginPolicy !== undefined)) {\n tileSource.crossOriginPolicy = imgOptions.crossOriginPolicy !== undefined ?\n imgOptions.crossOriginPolicy : viewer.crossOriginPolicy;\n }\n if (tileSource.ajaxWithCredentials === undefined) {\n tileSource.ajaxWithCredentials = viewer.ajaxWithCredentials;\n }\n if (tileSource.useCanvas === undefined) {\n tileSource.useCanvas = viewer.useCanvas;\n }\n\n if ( $.isFunction( tileSource.getTileUrl ) ) {\n //Custom tile source\n var customTileSource = new $.TileSource( tileSource );\n customTileSource.getTileUrl = tileSource.getTileUrl;\n successCallback( customTileSource );\n } else {\n //inline configuration\n var $TileSource = $.TileSource.determineType( _this, tileSource );\n if ( !$TileSource ) {\n failCallback( {\n message: \"Unable to load TileSource\",\n source: tileSource\n });\n return;\n }\n var options = $TileSource.prototype.configure.apply( _this, [ tileSource ] );\n waitUntilReady(new $TileSource(options), tileSource);\n }\n } else {\n //can assume it's already a tile source implementation\n waitUntilReady(tileSource, tileSource);\n }\n });\n}\n\nfunction getOverlayObject( viewer, overlay ) {\n if ( overlay instanceof $.Overlay ) {\n return overlay;\n }\n\n var element = null;\n if ( overlay.element ) {\n element = $.getElement( overlay.element );\n } else {\n var id = overlay.id ?\n overlay.id :\n \"openseadragon-overlay-\" + Math.floor( Math.random() * 10000000 );\n\n element = $.getElement( overlay.id );\n if ( !element ) {\n element = document.createElement( \"a\" );\n element.href = \"#/overlay/\" + id;\n }\n element.id = id;\n $.addClass( element, overlay.className ?\n overlay.className :\n \"openseadragon-overlay\"\n );\n }\n\n var location = overlay.location;\n var width = overlay.width;\n var height = overlay.height;\n if (!location) {\n var x = overlay.x;\n var y = overlay.y;\n if (overlay.px !== undefined) {\n var rect = viewer.viewport.imageToViewportRectangle(new $.Rect(\n overlay.px,\n overlay.py,\n width || 0,\n height || 0));\n x = rect.x;\n y = rect.y;\n width = width !== undefined ? rect.width : undefined;\n height = height !== undefined ? rect.height : undefined;\n }\n location = new $.Point(x, y);\n }\n\n var placement = overlay.placement;\n if (placement && $.type(placement) === \"string\") {\n placement = $.Placement[overlay.placement.toUpperCase()];\n }\n\n return new $.Overlay({\n element: element,\n location: location,\n placement: placement,\n onDraw: overlay.onDraw,\n checkResize: overlay.checkResize,\n width: width,\n height: height,\n rotationMode: overlay.rotationMode\n });\n}\n\n/**\n * @private\n * @inner\n * Determines the index of the given overlay in the given overlays array.\n */\nfunction getOverlayIndex( overlays, element ) {\n var i;\n for ( i = overlays.length - 1; i >= 0; i-- ) {\n if ( overlays[ i ].element === element ) {\n return i;\n }\n }\n\n return -1;\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// Schedulers provide the general engine for animation\n///////////////////////////////////////////////////////////////////////////////\nfunction scheduleUpdate( viewer, updateFunc ){\n return $.requestAnimationFrame( function(){\n updateFunc( viewer );\n } );\n}\n\n\n//provides a sequence in the fade animation\nfunction scheduleControlsFade( viewer ) {\n $.requestAnimationFrame( function(){\n updateControlsFade( viewer );\n });\n}\n\n\n//initiates an animation to hide the controls\nfunction beginControlsAutoHide( viewer ) {\n if ( !viewer.autoHideControls ) {\n return;\n }\n viewer.controlsShouldFade = true;\n viewer.controlsFadeBeginTime =\n $.now() +\n viewer.controlsFadeDelay;\n\n window.setTimeout( function(){\n scheduleControlsFade( viewer );\n }, viewer.controlsFadeDelay );\n}\n\n\n//determines if fade animation is done or continues the animation\nfunction updateControlsFade( viewer ) {\n var currentTime,\n deltaTime,\n opacity,\n i;\n if ( viewer.controlsShouldFade ) {\n currentTime = $.now();\n deltaTime = currentTime - viewer.controlsFadeBeginTime;\n opacity = 1.0 - deltaTime / viewer.controlsFadeLength;\n\n opacity = Math.min( 1.0, opacity );\n opacity = Math.max( 0.0, opacity );\n\n for ( i = viewer.controls.length - 1; i >= 0; i--) {\n if (viewer.controls[ i ].autoFade) {\n viewer.controls[ i ].setOpacity( opacity );\n }\n }\n\n if ( opacity > 0 ) {\n // fade again\n scheduleControlsFade( viewer );\n }\n }\n}\n\n\n//stop the fade animation on the controls and show them\nfunction abortControlsAutoHide( viewer ) {\n var i;\n viewer.controlsShouldFade = false;\n for ( i = viewer.controls.length - 1; i >= 0; i-- ) {\n viewer.controls[ i ].setOpacity( 1.0 );\n }\n}\n\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Default view event handlers.\n///////////////////////////////////////////////////////////////////////////////\nfunction onFocus(){\n abortControlsAutoHide( this );\n}\n\nfunction onBlur(){\n beginControlsAutoHide( this );\n\n}\n\nfunction onCanvasKeyDown( event ) {\n var canvasKeyDownEventArgs = {\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction,\n preventVerticalPan: event.preventVerticalPan,\n preventHorizontalPan: event.preventHorizontalPan\n };\n\n /**\n * Raised when a keyboard key is pressed and the focus is on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-key\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default keyboard behaviour. Default: false.\n * @property {Boolean} preventVerticalPan - Set to true to prevent keyboard vertical panning. Default: false.\n * @property {Boolean} preventHorizontalPan - Set to true to prevent keyboard horizontal panning. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n\n this.raiseEvent('canvas-key', canvasKeyDownEventArgs);\n\n if ( !canvasKeyDownEventArgs.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {\n switch( event.keyCode ){\n case 38://up arrow\n if (!canvasKeyDownEventArgs.preventVerticalPan) {\n if ( event.shift ) {\n this.viewport.zoomBy(1.1);\n } else {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(0, -this.pixelsPerArrowPress)));\n }\n this.viewport.applyConstraints();\n }\n return false;\n case 40://down arrow\n if (!canvasKeyDownEventArgs.preventVerticalPan) {\n if ( event.shift ) {\n this.viewport.zoomBy(0.9);\n } else {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(0, this.pixelsPerArrowPress)));\n }\n this.viewport.applyConstraints();\n }\n return false;\n case 37://left arrow\n if (!canvasKeyDownEventArgs.preventHorizontalPan) {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-this.pixelsPerArrowPress, 0)));\n this.viewport.applyConstraints();\n }\n return false;\n case 39://right arrow\n if (!canvasKeyDownEventArgs.preventHorizontalPan) {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(this.pixelsPerArrowPress, 0)));\n this.viewport.applyConstraints();\n }\n return false;\n default:\n //console.log( 'navigator keycode %s', event.keyCode );\n return true;\n }\n } else {\n return true;\n }\n}\nfunction onCanvasKeyPress( event ) {\n var canvasKeyPressEventArgs = {\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction,\n preventVerticalPan: event.preventVerticalPan,\n preventHorizontalPan: event.preventHorizontalPan\n };\n\n // This event is documented in onCanvasKeyDown\n this.raiseEvent('canvas-key', canvasKeyPressEventArgs);\n\n if ( !canvasKeyPressEventArgs.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {\n switch( event.keyCode ){\n case 43://=|+\n case 61://=|+\n this.viewport.zoomBy(1.1);\n this.viewport.applyConstraints();\n return false;\n case 45://-|_\n this.viewport.zoomBy(0.9);\n this.viewport.applyConstraints();\n return false;\n case 48://0|)\n this.viewport.goHome();\n this.viewport.applyConstraints();\n return false;\n case 119://w\n case 87://W\n if (!canvasKeyPressEventArgs.preventVerticalPan) {\n if ( event.shift ) {\n this.viewport.zoomBy(1.1);\n } else {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(0, -40)));\n }\n this.viewport.applyConstraints();\n }\n return false;\n case 115://s\n case 83://S\n if (!canvasKeyPressEventArgs.preventVerticalPan) {\n if ( event.shift ) {\n this.viewport.zoomBy(0.9);\n } else {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(0, 40)));\n }\n this.viewport.applyConstraints();\n }\n return false;\n case 97://a\n if (!canvasKeyPressEventArgs.preventHorizontalPan) {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0)));\n this.viewport.applyConstraints();\n }\n return false;\n case 100://d\n if (!canvasKeyPressEventArgs.preventHorizontalPan) {\n this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(40, 0)));\n this.viewport.applyConstraints();\n }\n return false;\n case 114: //r - clockwise rotation\n if(this.viewport.flipped){\n this.viewport.setRotation($.positiveModulo(this.viewport.degrees - this.rotationIncrement, 360));\n } else{\n this.viewport.setRotation($.positiveModulo(this.viewport.degrees + this.rotationIncrement, 360));\n }\n this.viewport.applyConstraints();\n return false;\n case 82: //R - counterclockwise rotation\n if(this.viewport.flipped){\n this.viewport.setRotation($.positiveModulo(this.viewport.degrees + this.rotationIncrement, 360));\n } else{\n this.viewport.setRotation($.positiveModulo(this.viewport.degrees - this.rotationIncrement, 360));\n }\n this.viewport.applyConstraints();\n return false;\n case 102: //f\n this.viewport.toggleFlip();\n return false;\n default:\n // console.log( 'navigator keycode %s', event.keyCode );\n return true;\n }\n } else {\n return true;\n }\n}\n\nfunction onCanvasClick( event ) {\n var gestureSettings;\n\n var haveKeyboardFocus = document.activeElement == this.canvas;\n\n // If we don't have keyboard focus, request it.\n if ( !haveKeyboardFocus ) {\n this.canvas.focus();\n }\n if(this.viewport.flipped){\n event.position.x = this.viewport.getContainerSize().x - event.position.x;\n }\n\n var canvasClickEventArgs = {\n tracker: event.eventSource,\n position: event.position,\n quick: event.quick,\n shift: event.shift,\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction\n };\n\n /**\n * Raised when a mouse press/release or touch/remove occurs on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-click\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Boolean} quick - True only if the clickDistThreshold and clickTimeThreshold are both passed. Useful for differentiating between clicks and drags.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default click to zoom behaviour. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-click', canvasClickEventArgs);\n\n if ( !canvasClickEventArgs.preventDefaultAction && this.viewport && event.quick ) {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if ( gestureSettings.clickToZoom ) {\n this.viewport.zoomBy(\n event.shift ? 1.0 / this.zoomPerClick : this.zoomPerClick,\n gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null\n );\n this.viewport.applyConstraints();\n }\n }\n}\n\nfunction onCanvasDblClick( event ) {\n var gestureSettings;\n\n var canvasDblClickEventArgs = {\n tracker: event.eventSource,\n position: event.position,\n shift: event.shift,\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction\n };\n\n /**\n * Raised when a double mouse press/release or touch/remove occurs on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-double-click\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default double tap to zoom behaviour. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-double-click', canvasDblClickEventArgs);\n\n if ( !canvasDblClickEventArgs.preventDefaultAction && this.viewport ) {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if ( gestureSettings.dblClickToZoom ) {\n this.viewport.zoomBy(\n event.shift ? 1.0 / this.zoomPerClick : this.zoomPerClick,\n gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null\n );\n this.viewport.applyConstraints();\n }\n }\n}\n\nfunction onCanvasDrag( event ) {\n var gestureSettings;\n\n var canvasDragEventArgs = {\n tracker: event.eventSource,\n position: event.position,\n delta: event.delta,\n speed: event.speed,\n direction: event.direction,\n shift: event.shift,\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction\n };\n\n /**\n * Raised when a mouse or touch drag operation occurs on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-drag\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {OpenSeadragon.Point} delta - The x,y components of the difference between start drag and end drag.\n * @property {Number} speed - Current computed speed, in pixels per second.\n * @property {Number} direction - Current computed direction, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default drag behaviour. Default: false.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-drag', canvasDragEventArgs);\n\n if ( !canvasDragEventArgs.preventDefaultAction && this.viewport ) {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if( !this.panHorizontal ){\n event.delta.x = 0;\n }\n if( !this.panVertical ){\n event.delta.y = 0;\n }\n if(this.viewport.flipped){\n event.delta.x = -event.delta.x;\n }\n\n if( this.constrainDuringPan ){\n var delta = this.viewport.deltaPointsFromPixels( event.delta.negate() );\n\n this.viewport.centerSpringX.target.value += delta.x;\n this.viewport.centerSpringY.target.value += delta.y;\n\n var bounds = this.viewport.getBounds();\n var constrainedBounds = this.viewport.getConstrainedBounds();\n\n this.viewport.centerSpringX.target.value -= delta.x;\n this.viewport.centerSpringY.target.value -= delta.y;\n\n if (bounds.x != constrainedBounds.x) {\n event.delta.x = 0;\n }\n\n if (bounds.y != constrainedBounds.y) {\n event.delta.y = 0;\n }\n }\n\n this.viewport.panBy( this.viewport.deltaPointsFromPixels( event.delta.negate() ), gestureSettings.flickEnabled && !this.constrainDuringPan);\n }\n}\n\nfunction onCanvasDragEnd( event ) {\n if (!event.preventDefaultAction && this.viewport) {\n var gestureSettings = this.gestureSettingsByDeviceType(event.pointerType);\n if (gestureSettings.flickEnabled &&\n event.speed >= gestureSettings.flickMinSpeed) {\n var amplitudeX = 0;\n if (this.panHorizontal) {\n amplitudeX = gestureSettings.flickMomentum * event.speed *\n Math.cos(event.direction);\n }\n var amplitudeY = 0;\n if (this.panVertical) {\n amplitudeY = gestureSettings.flickMomentum * event.speed *\n Math.sin(event.direction);\n }\n var center = this.viewport.pixelFromPoint(\n this.viewport.getCenter(true));\n var target = this.viewport.pointFromPixel(\n new $.Point(center.x - amplitudeX, center.y - amplitudeY));\n this.viewport.panTo(target, false);\n }\n this.viewport.applyConstraints();\n }\n /**\n * Raised when a mouse or touch drag operation ends on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-drag-end\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} speed - Speed at the end of a drag gesture, in pixels per second.\n * @property {Number} direction - Direction at the end of a drag gesture, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('canvas-drag-end', {\n tracker: event.eventSource,\n position: event.position,\n speed: event.speed,\n direction: event.direction,\n shift: event.shift,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasEnter( event ) {\n /**\n * Raised when a pointer enters the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-enter\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} buttons - Current buttons pressed. A combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Number} pointers - Number of pointers (all types) active in the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} buttonDownAny - Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-enter', {\n tracker: event.eventSource,\n pointerType: event.pointerType,\n position: event.position,\n buttons: event.buttons,\n pointers: event.pointers,\n insideElementPressed: event.insideElementPressed,\n buttonDownAny: event.buttonDownAny,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasExit( event ) {\n\n if (window.location != window.parent.location){\n $.MouseTracker.resetAllMouseTrackers();\n }\n\n /**\n * Raised when a pointer leaves the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-exit\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} buttons - Current buttons pressed. A combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Number} pointers - Number of pointers (all types) active in the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} buttonDownAny - Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-exit', {\n tracker: event.eventSource,\n pointerType: event.pointerType,\n position: event.position,\n buttons: event.buttons,\n pointers: event.pointers,\n insideElementPressed: event.insideElementPressed,\n buttonDownAny: event.buttonDownAny,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasPress( event ) {\n /**\n * Raised when the primary mouse button is pressed or touch starts on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-press\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} insideElementReleased - True if the cursor still inside the tracked element when the button was released.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-press', {\n tracker: event.eventSource,\n pointerType: event.pointerType,\n position: event.position,\n insideElementPressed: event.insideElementPressed,\n insideElementReleased: event.insideElementReleased,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasRelease( event ) {\n /**\n * Raised when the primary mouse button is released or touch ends on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-release\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} insideElementReleased - True if the cursor still inside the tracked element when the button was released.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-release', {\n tracker: event.eventSource,\n pointerType: event.pointerType,\n position: event.position,\n insideElementPressed: event.insideElementPressed,\n insideElementReleased: event.insideElementReleased,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasNonPrimaryPress( event ) {\n /**\n * Raised when any non-primary pointer button is pressed on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-nonprimary-press\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {Number} button - Button which caused the event.\n * -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * @property {Number} buttons - Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-nonprimary-press', {\n tracker: event.eventSource,\n position: event.position,\n pointerType: event.pointerType,\n button: event.button,\n buttons: event.buttons,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasNonPrimaryRelease( event ) {\n /**\n * Raised when any non-primary pointer button is released on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-nonprimary-release\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {String} pointerType - \"mouse\", \"touch\", \"pen\", etc.\n * @property {Number} button - Button which caused the event.\n * -1: none, 0: primary/left, 1: aux/middle, 2: secondary/right, 3: X1/back, 4: X2/forward, 5: pen eraser.\n * @property {Number} buttons - Current buttons pressed.\n * Combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-nonprimary-release', {\n tracker: event.eventSource,\n position: event.position,\n pointerType: event.pointerType,\n button: event.button,\n buttons: event.buttons,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onCanvasPinch( event ) {\n var gestureSettings,\n centerPt,\n lastCenterPt,\n panByPt;\n\n if ( !event.preventDefaultAction && this.viewport ) {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if ( gestureSettings.pinchToZoom ) {\n centerPt = this.viewport.pointFromPixel( event.center, true );\n lastCenterPt = this.viewport.pointFromPixel( event.lastCenter, true );\n panByPt = lastCenterPt.minus( centerPt );\n if( !this.panHorizontal ) {\n panByPt.x = 0;\n }\n if( !this.panVertical ) {\n panByPt.y = 0;\n }\n this.viewport.zoomBy( event.distance / event.lastDistance, centerPt, true );\n if ( gestureSettings.zoomToRefPoint ) {\n this.viewport.panBy(panByPt, true);\n }\n this.viewport.applyConstraints();\n }\n if ( gestureSettings.pinchRotate ) {\n // Pinch rotate\n var angle1 = Math.atan2(event.gesturePoints[0].currentPos.y - event.gesturePoints[1].currentPos.y,\n event.gesturePoints[0].currentPos.x - event.gesturePoints[1].currentPos.x);\n var angle2 = Math.atan2(event.gesturePoints[0].lastPos.y - event.gesturePoints[1].lastPos.y,\n event.gesturePoints[0].lastPos.x - event.gesturePoints[1].lastPos.x);\n this.viewport.setRotation(this.viewport.getRotation() + ((angle1 - angle2) * (180 / Math.PI)));\n }\n }\n /**\n * Raised when a pinch event occurs on the {@link OpenSeadragon.Viewer#canvas} element.\n *\n * @event canvas-pinch\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {Array.<OpenSeadragon.MouseTracker.GesturePoint>} gesturePoints - Gesture points associated with the gesture. Velocity data can be found here.\n * @property {OpenSeadragon.Point} lastCenter - The previous center point of the two pinch contact points relative to the tracked element.\n * @property {OpenSeadragon.Point} center - The center point of the two pinch contact points relative to the tracked element.\n * @property {Number} lastDistance - The previous distance between the two pinch contact points in CSS pixels.\n * @property {Number} distance - The distance between the two pinch contact points in CSS pixels.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('canvas-pinch', {\n tracker: event.eventSource,\n gesturePoints: event.gesturePoints,\n lastCenter: event.lastCenter,\n center: event.center,\n lastDistance: event.lastDistance,\n distance: event.distance,\n shift: event.shift,\n originalEvent: event.originalEvent\n });\n //cancels event\n return false;\n}\n\nfunction onCanvasScroll( event ) {\n var gestureSettings,\n factor,\n thisScrollTime,\n deltaScrollTime;\n\n /* Certain scroll devices fire the scroll event way too fast so we are injecting a simple adjustment to keep things\n * partially normalized. If we have already fired an event within the last 'minScrollDelta' milliseconds we skip\n * this one and wait for the next event. */\n thisScrollTime = $.now();\n deltaScrollTime = thisScrollTime - this._lastScrollTime;\n if (deltaScrollTime > this.minScrollDeltaTime) {\n this._lastScrollTime = thisScrollTime;\n\n if(this.viewport.flipped){\n event.position.x = this.viewport.getContainerSize().x - event.position.x;\n }\n\n if ( !event.preventDefaultAction && this.viewport ) {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if ( gestureSettings.scrollToZoom ) {\n factor = Math.pow( this.zoomPerScroll, event.scroll );\n this.viewport.zoomBy(\n factor,\n gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null\n );\n this.viewport.applyConstraints();\n }\n }\n /**\n * Raised when a scroll event occurs on the {@link OpenSeadragon.Viewer#canvas} element (mouse wheel).\n *\n * @event canvas-scroll\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} scroll - The scroll delta for the event.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'canvas-scroll', {\n tracker: event.eventSource,\n position: event.position,\n scroll: event.scroll,\n shift: event.shift,\n originalEvent: event.originalEvent\n });\n if (gestureSettings && gestureSettings.scrollToZoom) {\n //cancels event\n return false;\n }\n }\n else {\n gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );\n if (gestureSettings && gestureSettings.scrollToZoom) {\n return false; // We are swallowing this event\n }\n }\n}\n\nfunction onContainerEnter( event ) {\n THIS[ this.hash ].mouseInside = true;\n abortControlsAutoHide( this );\n /**\n * Raised when the cursor enters the {@link OpenSeadragon.Viewer#container} element.\n *\n * @event container-enter\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} buttons - Current buttons pressed. A combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Number} pointers - Number of pointers (all types) active in the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} buttonDownAny - Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'container-enter', {\n tracker: event.eventSource,\n position: event.position,\n buttons: event.buttons,\n pointers: event.pointers,\n insideElementPressed: event.insideElementPressed,\n buttonDownAny: event.buttonDownAny,\n originalEvent: event.originalEvent\n });\n}\n\nfunction onContainerExit( event ) {\n if ( event.pointers < 1 ) {\n THIS[ this.hash ].mouseInside = false;\n if ( !THIS[ this.hash ].animating ) {\n beginControlsAutoHide( this );\n }\n }\n /**\n * Raised when the cursor leaves the {@link OpenSeadragon.Viewer#container} element.\n *\n * @event container-exit\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} buttons - Current buttons pressed. A combination of bit flags 0: none, 1: primary (or touch contact), 2: secondary, 4: aux (often middle), 8: X1 (often back), 16: X2 (often forward), 32: pen eraser.\n * @property {Number} pointers - Number of pointers (all types) active in the tracked element.\n * @property {Boolean} insideElementPressed - True if the left mouse button is currently being pressed and was initiated inside the tracked element, otherwise false.\n * @property {Boolean} buttonDownAny - Was the button down anywhere in the screen during the event. <span style=\"color:red;\">Deprecated. Use buttons instead.</span>\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'container-exit', {\n tracker: event.eventSource,\n position: event.position,\n buttons: event.buttons,\n pointers: event.pointers,\n insideElementPressed: event.insideElementPressed,\n buttonDownAny: event.buttonDownAny,\n originalEvent: event.originalEvent\n });\n}\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Page update routines ( aka Views - for future reference )\n///////////////////////////////////////////////////////////////////////////////\n\nfunction updateMulti( viewer ) {\n updateOnce( viewer );\n\n // Request the next frame, unless we've been closed\n if ( viewer.isOpen() ) {\n viewer._updateRequestId = scheduleUpdate( viewer, updateMulti );\n } else {\n viewer._updateRequestId = false;\n }\n}\n\nfunction updateOnce( viewer ) {\n\n //viewer.profiler.beginUpdate();\n\n if (viewer._opening) {\n return;\n }\n\n if (viewer.autoResize) {\n var containerSize = _getSafeElemSize(viewer.container);\n var prevContainerSize = THIS[viewer.hash].prevContainerSize;\n if (!containerSize.equals(prevContainerSize)) {\n var viewport = viewer.viewport;\n if (viewer.preserveImageSizeOnResize) {\n var resizeRatio = prevContainerSize.x / containerSize.x;\n var zoom = viewport.getZoom() * resizeRatio;\n var center = viewport.getCenter();\n viewport.resize(containerSize, false);\n viewport.zoomTo(zoom, null, true);\n viewport.panTo(center, true);\n } else {\n // maintain image position\n var oldBounds = viewport.getBounds();\n viewport.resize(containerSize, true);\n viewport.fitBoundsWithConstraints(oldBounds, true);\n }\n THIS[viewer.hash].prevContainerSize = containerSize;\n THIS[viewer.hash].forceRedraw = true;\n }\n }\n\n var viewportChange = viewer.viewport.update();\n var animated = viewer.world.update() || viewportChange;\n\n if (viewportChange) {\n /**\n * Raised when any spring animation update occurs (zoom, pan, etc.),\n * before the viewer has drawn the new location.\n *\n * @event viewport-change\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n viewer.raiseEvent('viewport-change');\n }\n\n if( viewer.referenceStrip ){\n animated = viewer.referenceStrip.update( viewer.viewport ) || animated;\n }\n\n if ( !THIS[ viewer.hash ].animating && animated ) {\n /**\n * Raised when any spring animation starts (zoom, pan, etc.).\n *\n * @event animation-start\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n viewer.raiseEvent( \"animation-start\" );\n abortControlsAutoHide( viewer );\n }\n\n if ( animated || THIS[ viewer.hash ].forceRedraw || viewer.world.needsDraw() ) {\n drawWorld( viewer );\n viewer._drawOverlays();\n if( viewer.navigator ){\n viewer.navigator.update( viewer.viewport );\n }\n\n THIS[ viewer.hash ].forceRedraw = false;\n\n if (animated) {\n /**\n * Raised when any spring animation update occurs (zoom, pan, etc.),\n * after the viewer has drawn the new location.\n *\n * @event animation\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n viewer.raiseEvent( \"animation\" );\n }\n }\n\n if ( THIS[ viewer.hash ].animating && !animated ) {\n /**\n * Raised when any spring animation ends (zoom, pan, etc.).\n *\n * @event animation-finish\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n viewer.raiseEvent( \"animation-finish\" );\n\n if ( !THIS[ viewer.hash ].mouseInside ) {\n beginControlsAutoHide( viewer );\n }\n }\n\n THIS[ viewer.hash ].animating = animated;\n\n //viewer.profiler.endUpdate();\n}\n\nfunction drawWorld( viewer ) {\n viewer.imageLoader.clear();\n viewer.drawer.clear();\n viewer.world.draw();\n\n /**\n * <em>- Needs documentation -</em>\n *\n * @event update-viewport\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n viewer.raiseEvent( 'update-viewport', {} );\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// Navigation Controls\n///////////////////////////////////////////////////////////////////////////////\nfunction resolveUrl( prefix, url ) {\n return prefix ? prefix + url : url;\n}\n\n\n\nfunction beginZoomingIn() {\n THIS[ this.hash ].lastZoomTime = $.now();\n THIS[ this.hash ].zoomFactor = this.zoomPerSecond;\n THIS[ this.hash ].zooming = true;\n scheduleZoom( this );\n}\n\n\nfunction beginZoomingOut() {\n THIS[ this.hash ].lastZoomTime = $.now();\n THIS[ this.hash ].zoomFactor = 1.0 / this.zoomPerSecond;\n THIS[ this.hash ].zooming = true;\n scheduleZoom( this );\n}\n\n\nfunction endZooming() {\n THIS[ this.hash ].zooming = false;\n}\n\n\nfunction scheduleZoom( viewer ) {\n $.requestAnimationFrame( $.delegate( viewer, doZoom ) );\n}\n\n\nfunction doZoom() {\n var currentTime,\n deltaTime,\n adjustedFactor;\n\n if ( THIS[ this.hash ].zooming && this.viewport) {\n currentTime = $.now();\n deltaTime = currentTime - THIS[ this.hash ].lastZoomTime;\n adjustedFactor = Math.pow( THIS[ this.hash ].zoomFactor, deltaTime / 1000 );\n\n this.viewport.zoomBy( adjustedFactor );\n this.viewport.applyConstraints();\n THIS[ this.hash ].lastZoomTime = currentTime;\n scheduleZoom( this );\n }\n}\n\n\nfunction doSingleZoomIn() {\n if ( this.viewport ) {\n THIS[ this.hash ].zooming = false;\n this.viewport.zoomBy(\n this.zoomPerClick / 1.0\n );\n this.viewport.applyConstraints();\n }\n}\n\n\nfunction doSingleZoomOut() {\n if ( this.viewport ) {\n THIS[ this.hash ].zooming = false;\n this.viewport.zoomBy(\n 1.0 / this.zoomPerClick\n );\n this.viewport.applyConstraints();\n }\n}\n\n\nfunction lightUp() {\n this.buttons.emulateEnter();\n this.buttons.emulateExit();\n}\n\n\nfunction onHome() {\n if ( this.viewport ) {\n this.viewport.goHome();\n }\n}\n\n\nfunction onFullScreen() {\n if ( this.isFullPage() && !$.isFullScreen() ) {\n // Is fullPage but not fullScreen\n this.setFullPage( false );\n } else {\n this.setFullScreen( !this.isFullPage() );\n }\n // correct for no mouseout event on change\n if ( this.buttons ) {\n this.buttons.emulateExit();\n }\n this.fullPageButton.element.focus();\n if ( this.viewport ) {\n this.viewport.applyConstraints();\n }\n}\n\nfunction onRotateLeft() {\n if ( this.viewport ) {\n var currRotation = this.viewport.getRotation();\n\n if ( this.viewport.flipped ){\n currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);\n } else {\n currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);\n }\n this.viewport.setRotation(currRotation);\n }\n}\n\nfunction onRotateRight() {\n if ( this.viewport ) {\n var currRotation = this.viewport.getRotation();\n\n if ( this.viewport.flipped ){\n currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);\n } else {\n currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);\n }\n this.viewport.setRotation(currRotation);\n }\n}\n/**\n * Note: When pressed flip control button\n */\nfunction onFlip() {\n this.viewport.toggleFlip();\n}\n\nfunction onPrevious(){\n var previous = this._sequenceIndex - 1;\n if(this.navPrevNextWrap && previous < 0){\n previous += this.tileSources.length;\n }\n this.goToPage( previous );\n}\n\n\nfunction onNext(){\n var next = this._sequenceIndex + 1;\n if(this.navPrevNextWrap && next >= this.tileSources.length){\n next = 0;\n }\n this.goToPage( next );\n}\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Navigator\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class Navigator\n * @classdesc The Navigator provides a small view of the current image as fixed\n * while representing the viewport as a moving box serving as a frame\n * of reference in the larger viewport as to which portion of the image\n * is currently being examined. The navigator's viewport can be interacted\n * with using the keyboard or the mouse.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.Viewer\n * @extends OpenSeadragon.EventSource\n * @param {Object} options\n */\n$.Navigator = function( options ){\n\n var viewer = options.viewer,\n _this = this,\n viewerSize,\n navigatorSize;\n\n //We may need to create a new element and id if they did not\n //provide the id for the existing element\n if( !options.id ){\n options.id = 'navigator-' + $.now();\n this.element = $.makeNeutralElement( \"div\" );\n options.controlOptions = {\n anchor: $.ControlAnchor.TOP_RIGHT,\n attachToViewer: true,\n autoFade: options.autoFade\n };\n\n if( options.position ){\n if( 'BOTTOM_RIGHT' == options.position ){\n options.controlOptions.anchor = $.ControlAnchor.BOTTOM_RIGHT;\n } else if( 'BOTTOM_LEFT' == options.position ){\n options.controlOptions.anchor = $.ControlAnchor.BOTTOM_LEFT;\n } else if( 'TOP_RIGHT' == options.position ){\n options.controlOptions.anchor = $.ControlAnchor.TOP_RIGHT;\n } else if( 'TOP_LEFT' == options.position ){\n options.controlOptions.anchor = $.ControlAnchor.TOP_LEFT;\n } else if( 'ABSOLUTE' == options.position ){\n options.controlOptions.anchor = $.ControlAnchor.ABSOLUTE;\n options.controlOptions.top = options.top;\n options.controlOptions.left = options.left;\n options.controlOptions.height = options.height;\n options.controlOptions.width = options.width;\n }\n }\n\n } else {\n this.element = document.getElementById( options.id );\n options.controlOptions = {\n anchor: $.ControlAnchor.NONE,\n attachToViewer: false,\n autoFade: false\n };\n }\n this.element.id = options.id;\n this.element.className += ' navigator';\n\n options = $.extend( true, {\n sizeRatio: $.DEFAULT_SETTINGS.navigatorSizeRatio\n }, options, {\n element: this.element,\n tabIndex: -1, // No keyboard navigation, omit from tab order\n //These need to be overridden to prevent recursion since\n //the navigator is a viewer and a viewer has a navigator\n showNavigator: false,\n mouseNavEnabled: false,\n showNavigationControl: false,\n showSequenceControl: false,\n immediateRender: true,\n blendTime: 0,\n animationTime: 0,\n autoResize: options.autoResize,\n // prevent resizing the navigator from adding unwanted space around the image\n minZoomImageRatio: 1.0,\n background: options.background,\n opacity: options.opacity,\n borderColor: options.borderColor,\n displayRegionColor: options.displayRegionColor\n });\n\n options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio;\n\n $.setElementTouchActionNone( this.element );\n\n this.borderWidth = 2;\n //At some browser magnification levels the display regions lines up correctly, but at some there appears to\n //be a one pixel gap.\n this.fudge = new $.Point(1, 1);\n this.totalBorderWidths = new $.Point(this.borderWidth * 2, this.borderWidth * 2).minus(this.fudge);\n\n\n if ( options.controlOptions.anchor != $.ControlAnchor.NONE ) {\n (function( style, borderWidth ){\n style.margin = '0px';\n style.border = borderWidth + 'px solid ' + options.borderColor;\n style.padding = '0px';\n style.background = options.background;\n style.opacity = options.opacity;\n style.overflow = 'hidden';\n }( this.element.style, this.borderWidth));\n }\n\n this.displayRegion = $.makeNeutralElement( \"div\" );\n this.displayRegion.id = this.element.id + '-displayregion';\n this.displayRegion.className = 'displayregion';\n\n (function( style, borderWidth ){\n style.position = 'relative';\n style.top = '0px';\n style.left = '0px';\n style.fontSize = '0px';\n style.overflow = 'hidden';\n style.border = borderWidth + 'px solid ' + options.displayRegionColor;\n style.margin = '0px';\n style.padding = '0px';\n //TODO: IE doesn't like this property being set\n //try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/}\n\n style.background = 'transparent';\n\n // We use square bracket notation on the statement below, because float is a keyword.\n // This is important for the Google Closure compiler, if nothing else.\n /*jshint sub:true */\n style['float'] = 'left'; //Webkit\n\n style.cssFloat = 'left'; //Firefox\n style.styleFloat = 'left'; //IE\n style.zIndex = 999999999;\n style.cursor = 'default';\n }( this.displayRegion.style, this.borderWidth ));\n\n this.displayRegionContainer = $.makeNeutralElement(\"div\");\n this.displayRegionContainer.id = this.element.id + '-displayregioncontainer';\n this.displayRegionContainer.className = \"displayregioncontainer\";\n this.displayRegionContainer.style.width = \"100%\";\n this.displayRegionContainer.style.height = \"100%\";\n\n viewer.addControl(\n this.element,\n options.controlOptions\n );\n\n this._resizeWithViewer = options.controlOptions.anchor != $.ControlAnchor.ABSOLUTE &&\n options.controlOptions.anchor != $.ControlAnchor.NONE;\n\n if ( this._resizeWithViewer ) {\n if ( options.width && options.height ) {\n this.element.style.height = typeof (options.height) == \"number\" ? (options.height + 'px') : options.height;\n this.element.style.width = typeof (options.width) == \"number\" ? (options.width + 'px') : options.width;\n } else {\n viewerSize = $.getElementSize( viewer.element );\n this.element.style.height = Math.round( viewerSize.y * options.sizeRatio ) + 'px';\n this.element.style.width = Math.round( viewerSize.x * options.sizeRatio ) + 'px';\n this.oldViewerSize = viewerSize;\n }\n navigatorSize = $.getElementSize( this.element );\n this.elementArea = navigatorSize.x * navigatorSize.y;\n }\n\n this.oldContainerSize = new $.Point( 0, 0 );\n\n $.Viewer.apply( this, [ options ] );\n\n this.displayRegionContainer.appendChild(this.displayRegion);\n this.element.getElementsByTagName('div')[0].appendChild(this.displayRegionContainer);\n\n function rotate(degrees) {\n _setTransformRotate(_this.displayRegionContainer, degrees);\n _setTransformRotate(_this.displayRegion, -degrees);\n _this.viewport.setRotation(degrees);\n }\n if (options.navigatorRotate) {\n var degrees = options.viewer.viewport ?\n options.viewer.viewport.getRotation() :\n options.viewer.degrees || 0;\n\n rotate(degrees);\n options.viewer.addHandler(\"rotate\", function (args) {\n rotate(args.degrees);\n });\n }\n\n\n // Remove the base class' (Viewer's) innerTracker and replace it with our own\n this.innerTracker.destroy();\n this.innerTracker = new $.MouseTracker({\n element: this.element,\n dragHandler: $.delegate( this, onCanvasDrag ),\n clickHandler: $.delegate( this, onCanvasClick ),\n releaseHandler: $.delegate( this, onCanvasRelease ),\n scrollHandler: $.delegate( this, onCanvasScroll )\n });\n\n this.addHandler(\"reset-size\", function() {\n if (_this.viewport) {\n _this.viewport.goHome(true);\n }\n });\n\n viewer.world.addHandler(\"item-index-change\", function(event) {\n window.setTimeout(function(){\n var item = _this.world.getItemAt(event.previousIndex);\n _this.world.setItemIndex(item, event.newIndex);\n }, 1);\n });\n\n viewer.world.addHandler(\"remove-item\", function(event) {\n var theirItem = event.item;\n var myItem = _this._getMatchingItem(theirItem);\n if (myItem) {\n _this.world.removeItem(myItem);\n }\n });\n\n this.update(viewer.viewport);\n};\n\n$.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /** @lends OpenSeadragon.Navigator.prototype */{\n\n /**\n * Used to notify the navigator when its size has changed.\n * Especially useful when {@link OpenSeadragon.Options}.navigatorAutoResize is set to false and the navigator is resizable.\n * @function\n */\n updateSize: function () {\n if ( this.viewport ) {\n var containerSize = new $.Point(\n (this.container.clientWidth === 0 ? 1 : this.container.clientWidth),\n (this.container.clientHeight === 0 ? 1 : this.container.clientHeight)\n );\n\n if ( !containerSize.equals( this.oldContainerSize ) ) {\n this.viewport.resize( containerSize, true );\n this.viewport.goHome(true);\n this.oldContainerSize = containerSize;\n this.drawer.clear();\n this.world.draw();\n }\n }\n },\n /**\n /* Flip navigator element\n * @param {Boolean} state - Flip state to set.\n */\n setFlip: function(state) {\n this.viewport.setFlip(state);\n\n this.setDisplayTransform(this.viewer.viewport.getFlip() ? \"scale(-1,1)\" : \"scale(1,1)\");\n return this;\n },\n\n setDisplayTransform: function(rule) {\n setElementTransform(this.displayRegion, rule);\n setElementTransform(this.canvas, rule);\n setElementTransform(this.element, rule);\n },\n\n /**\n * Used to update the navigator minimap's viewport rectangle when a change in the viewer's viewport occurs.\n * @function\n * @param {OpenSeadragon.Viewport} The viewport this navigator is tracking.\n */\n update: function( viewport ) {\n\n var viewerSize,\n newWidth,\n newHeight,\n bounds,\n topleft,\n bottomright;\n\n viewerSize = $.getElementSize( this.viewer.element );\n if ( this._resizeWithViewer && viewerSize.x && viewerSize.y && !viewerSize.equals( this.oldViewerSize ) ) {\n this.oldViewerSize = viewerSize;\n\n if ( this.maintainSizeRatio || !this.elementArea) {\n newWidth = viewerSize.x * this.sizeRatio;\n newHeight = viewerSize.y * this.sizeRatio;\n } else {\n newWidth = Math.sqrt(this.elementArea * (viewerSize.x / viewerSize.y));\n newHeight = this.elementArea / newWidth;\n }\n\n this.element.style.width = Math.round( newWidth ) + 'px';\n this.element.style.height = Math.round( newHeight ) + 'px';\n\n if (!this.elementArea) {\n this.elementArea = newWidth * newHeight;\n }\n\n this.updateSize();\n }\n\n if (viewport && this.viewport) {\n bounds = viewport.getBoundsNoRotate(true);\n topleft = this.viewport.pixelFromPointNoRotate(bounds.getTopLeft(), false);\n bottomright = this.viewport.pixelFromPointNoRotate(bounds.getBottomRight(), false)\n .minus( this.totalBorderWidths );\n\n //update style for navigator-box\n var style = this.displayRegion.style;\n style.display = this.world.getItemCount() ? 'block' : 'none';\n\n style.top = Math.round( topleft.y ) + 'px';\n style.left = Math.round( topleft.x ) + 'px';\n\n var width = Math.abs( topleft.x - bottomright.x );\n var height = Math.abs( topleft.y - bottomright.y );\n // make sure width and height are non-negative so IE doesn't throw\n style.width = Math.round( Math.max( width, 0 ) ) + 'px';\n style.height = Math.round( Math.max( height, 0 ) ) + 'px';\n }\n\n },\n\n // overrides Viewer.addTiledImage\n addTiledImage: function(options) {\n var _this = this;\n\n var original = options.originalTiledImage;\n delete options.original;\n\n var optionsClone = $.extend({}, options, {\n success: function(event) {\n var myItem = event.item;\n myItem._originalForNavigator = original;\n _this._matchBounds(myItem, original, true);\n\n function matchBounds() {\n _this._matchBounds(myItem, original);\n }\n\n function matchOpacity() {\n _this._matchOpacity(myItem, original);\n }\n\n function matchCompositeOperation() {\n _this._matchCompositeOperation(myItem, original);\n }\n\n original.addHandler('bounds-change', matchBounds);\n original.addHandler('clip-change', matchBounds);\n original.addHandler('opacity-change', matchOpacity);\n original.addHandler('composite-operation-change', matchCompositeOperation);\n }\n });\n\n return $.Viewer.prototype.addTiledImage.apply(this, [optionsClone]);\n },\n\n // private\n _getMatchingItem: function(theirItem) {\n var count = this.world.getItemCount();\n var item;\n for (var i = 0; i < count; i++) {\n item = this.world.getItemAt(i);\n if (item._originalForNavigator === theirItem) {\n return item;\n }\n }\n\n return null;\n },\n\n // private\n _matchBounds: function(myItem, theirItem, immediately) {\n var bounds = theirItem.getBoundsNoRotate();\n myItem.setPosition(bounds.getTopLeft(), immediately);\n myItem.setWidth(bounds.width, immediately);\n myItem.setRotation(theirItem.getRotation(), immediately);\n myItem.setClip(theirItem.getClip());\n },\n\n // private\n _matchOpacity: function(myItem, theirItem) {\n myItem.setOpacity(theirItem.opacity);\n },\n\n // private\n _matchCompositeOperation: function(myItem, theirItem) {\n myItem.setCompositeOperation(theirItem.compositeOperation);\n }\n});\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onCanvasClick( event ) {\n var canvasClickEventArgs = {\n tracker: event.eventSource,\n position: event.position,\n quick: event.quick,\n shift: event.shift,\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction\n };\n /**\n * Raised when a click event occurs on the {@link OpenSeadragon.Viewer#navigator} element.\n *\n * @event navigator-click\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Boolean} quick - True only if the clickDistThreshold and clickTimeThreshold are both passed. Useful for differentiating between clicks and drags.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default click to zoom behaviour. Default: false.\n */\n\n this.viewer.raiseEvent('navigator-click', canvasClickEventArgs);\n\n if ( !canvasClickEventArgs.preventDefaultAction && event.quick && this.viewer.viewport && (this.panVertical || this.panHorizontal)) {\n if(this.viewer.viewport.flipped) {\n event.position.x = this.viewport.getContainerSize().x - event.position.x;\n }\n var target = this.viewport.pointFromPixel(event.position);\n if (!this.panVertical) {\n // perform only horizonal pan\n target.y = this.viewer.viewport.getCenter(true).y;\n } else if (!this.panHorizontal) {\n // perform only vertical pan\n target.x = this.viewer.viewport.getCenter(true).x;\n }\n this.viewer.viewport.panTo(target);\n this.viewer.viewport.applyConstraints();\n }\n\n}\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onCanvasDrag( event ) {\n var canvasDragEventArgs = {\n tracker: event.eventSource,\n position: event.position,\n delta: event.delta,\n speed: event.speed,\n direction: event.direction,\n shift: event.shift,\n originalEvent: event.originalEvent,\n preventDefaultAction: event.preventDefaultAction\n };\n /**\n * Raised when a drag event occurs on the {@link OpenSeadragon.Viewer#navigator} element.\n *\n * @event navigator-drag\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {OpenSeadragon.Point} delta - The x,y components of the difference between start drag and end drag.\n * @property {Number} speed - Current computed speed, in pixels per second.\n * @property {Number} direction - Current computed direction, expressed as an angle counterclockwise relative to the positive X axis (-pi to pi, in radians). Only valid if speed > 0.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n * @property {Boolean} preventDefaultAction - Set to true to prevent default click to zoom behaviour. Default: false.\n */\n this.viewer.raiseEvent('navigator-drag', canvasDragEventArgs);\n\n if ( !canvasDragEventArgs.preventDefaultAction && this.viewer.viewport ) {\n if( !this.panHorizontal ){\n event.delta.x = 0;\n }\n if( !this.panVertical ){\n event.delta.y = 0;\n }\n\n if(this.viewer.viewport.flipped){\n event.delta.x = -event.delta.x;\n }\n\n this.viewer.viewport.panBy(\n this.viewport.deltaPointsFromPixels(\n event.delta\n )\n );\n if( this.viewer.constrainDuringPan ){\n this.viewer.viewport.applyConstraints();\n }\n }\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onCanvasRelease( event ) {\n if ( event.insideElementPressed && this.viewer.viewport ) {\n this.viewer.viewport.applyConstraints();\n }\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onCanvasScroll( event ) {\n /**\n * Raised when a scroll event occurs on the {@link OpenSeadragon.Viewer#navigator} element (mouse wheel, touch pinch, etc.).\n *\n * @event navigator-scroll\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event.\n * @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element.\n * @property {Number} scroll - The scroll delta for the event.\n * @property {Boolean} shift - True if the shift key was pressed during this event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent( 'navigator-scroll', {\n tracker: event.eventSource,\n position: event.position,\n scroll: event.scroll,\n shift: event.shift,\n originalEvent: event.originalEvent\n });\n\n //don't scroll the page up and down if the user is scrolling\n //in the navigator\n return false;\n}\n\n/**\n * @function\n * @private\n * @param {Object} element\n * @param {Number} degrees\n */\nfunction _setTransformRotate( element, degrees ) {\n setElementTransform(element, \"rotate(\" + degrees + \"deg)\");\n}\n\nfunction setElementTransform( element, rule ) {\n element.style.webkitTransform = rule;\n element.style.mozTransform = rule;\n element.style.msTransform = rule;\n element.style.oTransform = rule;\n element.style.transform = rule;\n}\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - getString/setString\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n//TODO: I guess this is where the i18n needs to be reimplemented. I'll look\n// into existing patterns for i18n in javascript but i think that mimicking\n// pythons gettext might be a reasonable approach.\nvar I18N = {\n Errors: {\n Dzc: \"Sorry, we don't support Deep Zoom Collections!\",\n Dzi: \"Hmm, this doesn't appear to be a valid Deep Zoom Image.\",\n Xml: \"Hmm, this doesn't appear to be a valid Deep Zoom Image.\",\n ImageFormat: \"Sorry, we don't support {0}-based Deep Zoom Images.\",\n Security: \"It looks like a security restriction stopped us from \" +\n \"loading this Deep Zoom Image.\",\n Status: \"This space unintentionally left blank ({0} {1}).\",\n OpenFailed: \"Unable to open {0}: {1}\"\n },\n\n Tooltips: {\n FullPage: \"Toggle full page\",\n Home: \"Go home\",\n ZoomIn: \"Zoom in\",\n ZoomOut: \"Zoom out\",\n NextPage: \"Next page\",\n PreviousPage: \"Previous page\",\n RotateLeft: \"Rotate left\",\n RotateRight: \"Rotate right\",\n Flip: \"Flip Horizontally\"\n }\n};\n\n$.extend( $, /** @lends OpenSeadragon */{\n\n /**\n * @function\n * @param {String} property\n */\n getString: function( prop ) {\n\n var props = prop.split('.'),\n string = null,\n args = arguments,\n container = I18N,\n i;\n\n for (i = 0; i < props.length - 1; i++) {\n // in case not a subproperty\n container = container[ props[ i ] ] || {};\n }\n string = container[ props[ i ] ];\n\n if ( typeof ( string ) != \"string\" ) {\n $.console.log( \"Untranslated source string:\", prop );\n string = \"\"; // FIXME: this breaks gettext()-style convention, which would return source\n }\n\n return string.replace(/\\{\\d+\\}/g, function(capture) {\n var i = parseInt( capture.match( /\\d+/ ), 10 ) + 1;\n return i < args.length ?\n args[ i ] :\n \"\";\n });\n },\n\n /**\n * @function\n * @param {String} property\n * @param {*} value\n */\n setString: function( prop, value ) {\n\n var props = prop.split('.'),\n container = I18N,\n i;\n\n for ( i = 0; i < props.length - 1; i++ ) {\n if ( !container[ props[ i ] ] ) {\n container[ props[ i ] ] = {};\n }\n container = container[ props[ i ] ];\n }\n\n container[ props[ i ] ] = value;\n }\n\n});\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Point\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class Point\n * @classdesc A Point is really used as a 2-dimensional vector, equally useful for\n * representing a point on a plane, or the height and width of a plane\n * not requiring any other frame of reference.\n *\n * @memberof OpenSeadragon\n * @param {Number} [x] The vector component 'x'. Defaults to the origin at 0.\n * @param {Number} [y] The vector component 'y'. Defaults to the origin at 0.\n */\n$.Point = function( x, y ) {\n /**\n * The vector component 'x'.\n * @member {Number} x\n * @memberof OpenSeadragon.Point#\n */\n this.x = typeof ( x ) == \"number\" ? x : 0;\n /**\n * The vector component 'y'.\n * @member {Number} y\n * @memberof OpenSeadragon.Point#\n */\n this.y = typeof ( y ) == \"number\" ? y : 0;\n};\n\n/** @lends OpenSeadragon.Point.prototype */\n$.Point.prototype = {\n /**\n * @function\n * @returns {OpenSeadragon.Point} a duplicate of this Point\n */\n clone: function() {\n return new $.Point(this.x, this.y);\n },\n\n /**\n * Add another Point to this point and return a new Point.\n * @function\n * @param {OpenSeadragon.Point} point The point to add vector components.\n * @returns {OpenSeadragon.Point} A new point representing the sum of the\n * vector components\n */\n plus: function( point ) {\n return new $.Point(\n this.x + point.x,\n this.y + point.y\n );\n },\n\n /**\n * Subtract another Point to this point and return a new Point.\n * @function\n * @param {OpenSeadragon.Point} point The point to subtract vector components.\n * @returns {OpenSeadragon.Point} A new point representing the subtraction of the\n * vector components\n */\n minus: function( point ) {\n return new $.Point(\n this.x - point.x,\n this.y - point.y\n );\n },\n\n /**\n * Multiply this point by a factor and return a new Point.\n * @function\n * @param {Number} factor The factor to multiply vector components.\n * @returns {OpenSeadragon.Point} A new point representing the multiplication\n * of the vector components by the factor\n */\n times: function( factor ) {\n return new $.Point(\n this.x * factor,\n this.y * factor\n );\n },\n\n /**\n * Divide this point by a factor and return a new Point.\n * @function\n * @param {Number} factor The factor to divide vector components.\n * @returns {OpenSeadragon.Point} A new point representing the division of the\n * vector components by the factor\n */\n divide: function( factor ) {\n return new $.Point(\n this.x / factor,\n this.y / factor\n );\n },\n\n /**\n * Compute the opposite of this point and return a new Point.\n * @function\n * @returns {OpenSeadragon.Point} A new point representing the opposite of the\n * vector components\n */\n negate: function() {\n return new $.Point( -this.x, -this.y );\n },\n\n /**\n * Compute the distance between this point and another point.\n * @function\n * @param {OpenSeadragon.Point} point The point to compute the distance with.\n * @returns {Number} The distance between the 2 points\n */\n distanceTo: function( point ) {\n return Math.sqrt(\n Math.pow( this.x - point.x, 2 ) +\n Math.pow( this.y - point.y, 2 )\n );\n },\n\n /**\n * Compute the squared distance between this point and another point.\n * Useful for optimizing things like comparing distances.\n * @function\n * @param {OpenSeadragon.Point} point The point to compute the squared distance with.\n * @returns {Number} The squared distance between the 2 points\n */\n squaredDistanceTo: function( point ) {\n return Math.pow( this.x - point.x, 2 ) +\n Math.pow( this.y - point.y, 2 );\n },\n\n /**\n * Apply a function to each coordinate of this point and return a new point.\n * @function\n * @param {function} func The function to apply to each coordinate.\n * @returns {OpenSeadragon.Point} A new point with the coordinates computed\n * by the specified function\n */\n apply: function( func ) {\n return new $.Point( func( this.x ), func( this.y ) );\n },\n\n /**\n * Check if this point is equal to another one.\n * @function\n * @param {OpenSeadragon.Point} point The point to compare this point with.\n * @returns {Boolean} true if they are equal, false otherwise.\n */\n equals: function( point ) {\n return (\n point instanceof $.Point\n ) && (\n this.x === point.x\n ) && (\n this.y === point.y\n );\n },\n\n /**\n * Rotates the point around the specified pivot\n * From http://stackoverflow.com/questions/4465931/rotate-rectangle-around-a-point\n * @function\n * @param {Number} degress to rotate around the pivot.\n * @param {OpenSeadragon.Point} [pivot=(0,0)] Point around which to rotate.\n * Defaults to the origin.\n * @returns {OpenSeadragon.Point}. A new point representing the point rotated around the specified pivot\n */\n rotate: function (degrees, pivot) {\n pivot = pivot || new $.Point(0, 0);\n var cos;\n var sin;\n // Avoid float computations when possible\n if (degrees % 90 === 0) {\n var d = $.positiveModulo(degrees, 360);\n switch (d) {\n case 0:\n cos = 1;\n sin = 0;\n break;\n case 90:\n cos = 0;\n sin = 1;\n break;\n case 180:\n cos = -1;\n sin = 0;\n break;\n case 270:\n cos = 0;\n sin = -1;\n break;\n }\n } else {\n var angle = degrees * Math.PI / 180.0;\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n }\n var x = cos * (this.x - pivot.x) - sin * (this.y - pivot.y) + pivot.x;\n var y = sin * (this.x - pivot.x) + cos * (this.y - pivot.y) + pivot.y;\n return new $.Point(x, y);\n },\n\n /**\n * Convert this point to a string in the format (x,y) where x and y are\n * rounded to the nearest integer.\n * @function\n * @returns {String} A string representation of this point.\n */\n toString: function() {\n return \"(\" + (Math.round(this.x * 100) / 100) + \",\" + (Math.round(this.y * 100) / 100) + \")\";\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - TileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n\n/**\n * @class TileSource\n * @classdesc The TileSource contains the most basic implementation required to create a\n * smooth transition between layers in an image pyramid. It has only a single key\n * interface that must be implemented to complete its key functionality:\n * 'getTileUrl'. It also has several optional interfaces that can be\n * implemented if a new TileSource wishes to support configuration via a simple\n * object or array ('configure') and if the tile source supports or requires\n * configuration via retrieval of a document on the network ala AJAX or JSONP,\n * ('getImageInfo').\n * <br/>\n * By default the image pyramid is split into N layers where the image's longest\n * side in M (in pixels), where N is the smallest integer which satisfies\n * <strong>2^(N+1) >= M</strong>.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.EventSource\n * @param {Object} options\n * You can either specify a URL, or literally define the TileSource (by specifying\n * width, height, tileSize, tileOverlap, minLevel, and maxLevel). For the former,\n * the extending class is expected to implement 'getImageInfo' and 'configure'.\n * For the latter, the construction is assumed to occur through\n * the extending classes implementation of 'configure'.\n * @param {String} [options.url]\n * The URL for the data necessary for this TileSource.\n * @param {String} [options.referenceStripThumbnailUrl]\n * The URL for a thumbnail image to be used by the reference strip\n * @param {Function} [options.success]\n * A function to be called upon successful creation.\n * @param {Boolean} [options.ajaxWithCredentials]\n * If this TileSource needs to make an AJAX call, this specifies whether to set\n * the XHR's withCredentials (for accessing secure data).\n * @param {Object} [options.ajaxHeaders]\n * A set of headers to include in AJAX requests.\n * @param {Number} [options.width]\n * Width of the source image at max resolution in pixels.\n * @param {Number} [options.height]\n * Height of the source image at max resolution in pixels.\n * @param {Number} [options.tileSize]\n * The size of the tiles to assumed to make up each pyramid layer in pixels.\n * Tile size determines the point at which the image pyramid must be\n * divided into a matrix of smaller images.\n * Use options.tileWidth and options.tileHeight to support non-square tiles.\n * @param {Number} [options.tileWidth]\n * The width of the tiles to assumed to make up each pyramid layer in pixels.\n * @param {Number} [options.tileHeight]\n * The height of the tiles to assumed to make up each pyramid layer in pixels.\n * @param {Number} [options.tileOverlap]\n * The number of pixels each tile is expected to overlap touching tiles.\n * @param {Number} [options.minLevel]\n * The minimum level to attempt to load.\n * @param {Number} [options.maxLevel]\n * The maximum level to attempt to load.\n */\n$.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLevel ) {\n var _this = this;\n\n var args = arguments,\n options,\n i;\n\n if( $.isPlainObject( width ) ){\n options = width;\n }else{\n options = {\n width: args[0],\n height: args[1],\n tileSize: args[2],\n tileOverlap: args[3],\n minLevel: args[4],\n maxLevel: args[5]\n };\n }\n\n //Tile sources supply some events, namely 'ready' when they must be configured\n //by asynchronously fetching their configuration data.\n $.EventSource.call( this );\n\n //we allow options to override anything we don't treat as\n //required via idiomatic options or which is functionally\n //set depending on the state of the readiness of this tile\n //source\n $.extend( true, this, options );\n\n if (!this.success) {\n //Any functions that are passed as arguments are bound to the ready callback\n for ( i = 0; i < arguments.length; i++ ) {\n if ( $.isFunction( arguments[ i ] ) ) {\n this.success = arguments[ i ];\n //only one callback per constructor\n break;\n }\n }\n }\n\n if (this.success) {\n this.addHandler( 'ready', function ( event ) {\n _this.success( event );\n } );\n }\n\n /**\n * Ratio of width to height\n * @member {Number} aspectRatio\n * @memberof OpenSeadragon.TileSource#\n */\n /**\n * Vector storing x and y dimensions ( width and height respectively ).\n * @member {OpenSeadragon.Point} dimensions\n * @memberof OpenSeadragon.TileSource#\n */\n /**\n * The overlap in pixels each tile shares with its adjacent neighbors.\n * @member {Number} tileOverlap\n * @memberof OpenSeadragon.TileSource#\n */\n /**\n * The minimum pyramid level this tile source supports or should attempt to load.\n * @member {Number} minLevel\n * @memberof OpenSeadragon.TileSource#\n */\n /**\n * The maximum pyramid level this tile source supports or should attempt to load.\n * @member {Number} maxLevel\n * @memberof OpenSeadragon.TileSource#\n */\n /**\n *\n * @member {Boolean} ready\n * @memberof OpenSeadragon.TileSource#\n */\n\n if( 'string' == $.type( arguments[ 0 ] ) ){\n this.url = arguments[0];\n }\n\n if (this.url) {\n //in case the getImageInfo method is overridden and/or implies an\n //async mechanism set some safe defaults first\n this.aspectRatio = 1;\n this.dimensions = new $.Point( 10, 10 );\n this._tileWidth = 0;\n this._tileHeight = 0;\n this.tileOverlap = 0;\n this.minLevel = 0;\n this.maxLevel = 0;\n this.ready = false;\n //configuration via url implies the extending class\n //implements and 'configure'\n this.getImageInfo( this.url );\n\n } else {\n\n //explicit configuration via positional args in constructor\n //or the more idiomatic 'options' object\n this.ready = true;\n this.aspectRatio = (options.width && options.height) ?\n (options.width / options.height) : 1;\n this.dimensions = new $.Point( options.width, options.height );\n\n if ( this.tileSize ){\n this._tileWidth = this._tileHeight = this.tileSize;\n delete this.tileSize;\n } else {\n if( this.tileWidth ){\n // We were passed tileWidth in options, but we want to rename it\n // with a leading underscore to make clear that it is not safe to directly modify it\n this._tileWidth = this.tileWidth;\n delete this.tileWidth;\n } else {\n this._tileWidth = 0;\n }\n\n if( this.tileHeight ){\n // See note above about renaming this.tileWidth\n this._tileHeight = this.tileHeight;\n delete this.tileHeight;\n } else {\n this._tileHeight = 0;\n }\n }\n\n this.tileOverlap = options.tileOverlap ? options.tileOverlap : 0;\n this.minLevel = options.minLevel ? options.minLevel : 0;\n this.maxLevel = ( undefined !== options.maxLevel && null !== options.maxLevel ) ?\n options.maxLevel : (\n ( options.width && options.height ) ? Math.ceil(\n Math.log( Math.max( options.width, options.height ) ) /\n Math.log( 2 )\n ) : 0\n );\n if( this.success && $.isFunction( this.success ) ){\n this.success( this );\n }\n }\n\n\n};\n\n/** @lends OpenSeadragon.TileSource.prototype */\n$.TileSource.prototype = {\n\n getTileSize: function( level ) {\n $.console.error(\n \"[TileSource.getTileSize] is deprecated. \" +\n \"Use TileSource.getTileWidth() and TileSource.getTileHeight() instead\"\n );\n return this._tileWidth;\n },\n\n /**\n * Return the tileWidth for a given level.\n * Subclasses should override this if tileWidth can be different at different levels\n * such as in IIIFTileSource. Code should use this function rather than reading\n * from ._tileWidth directly.\n * @function\n * @param {Number} level\n */\n getTileWidth: function( level ) {\n if (!this._tileWidth) {\n return this.getTileSize(level);\n }\n return this._tileWidth;\n },\n\n /**\n * Return the tileHeight for a given level.\n * Subclasses should override this if tileHeight can be different at different levels\n * such as in IIIFTileSource. Code should use this function rather than reading\n * from ._tileHeight directly.\n * @function\n * @param {Number} level\n */\n getTileHeight: function( level ) {\n if (!this._tileHeight) {\n return this.getTileSize(level);\n }\n return this._tileHeight;\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getLevelScale: function( level ) {\n\n // see https://github.com/openseadragon/openseadragon/issues/22\n // we use the tilesources implementation of getLevelScale to generate\n // a memoized re-implementation\n var levelScaleCache = {},\n i;\n for( i = 0; i <= this.maxLevel; i++ ){\n levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i);\n }\n this.getLevelScale = function( _level ){\n return levelScaleCache[ _level ];\n };\n return this.getLevelScale( level );\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getNumTiles: function( level ) {\n var scale = this.getLevelScale( level ),\n x = Math.ceil( scale * this.dimensions.x / this.getTileWidth(level) ),\n y = Math.ceil( scale * this.dimensions.y / this.getTileHeight(level) );\n\n return new $.Point( x, y );\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getPixelRatio: function( level ) {\n var imageSizeScaled = this.dimensions.times( this.getLevelScale( level ) ),\n rx = 1.0 / imageSizeScaled.x,\n ry = 1.0 / imageSizeScaled.y;\n\n return new $.Point(rx, ry);\n },\n\n\n /**\n * @function\n * @returns {Number} The highest level in this tile source that can be contained in a single tile.\n */\n getClosestLevel: function() {\n var i,\n tiles;\n\n for (i = this.minLevel + 1; i <= this.maxLevel; i++){\n tiles = this.getNumTiles(i);\n if (tiles.x > 1 || tiles.y > 1) {\n break;\n }\n }\n\n return i - 1;\n },\n\n /**\n * @function\n * @param {Number} level\n * @param {OpenSeadragon.Point} point\n */\n getTileAtPoint: function(level, point) {\n var validPoint = point.x >= 0 && point.x <= 1 &&\n point.y >= 0 && point.y <= 1 / this.aspectRatio;\n $.console.assert(validPoint, \"[TileSource.getTileAtPoint] must be called with a valid point.\");\n\n var widthScaled = this.dimensions.x * this.getLevelScale(level);\n var pixelX = point.x * widthScaled;\n var pixelY = point.y * widthScaled;\n\n var x = Math.floor(pixelX / this.getTileWidth(level));\n var y = Math.floor(pixelY / this.getTileHeight(level));\n\n // When point.x == 1 or point.y == 1 / this.aspectRatio we want to\n // return the last tile of the row/column\n if (point.x >= 1) {\n x = this.getNumTiles(level).x - 1;\n }\n var EPSILON = 1e-15;\n if (point.y >= 1 / this.aspectRatio - EPSILON) {\n y = this.getNumTiles(level).y - 1;\n }\n\n return new $.Point(x, y);\n },\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n * @param {Boolean} [isSource=false] Whether to return the source bounds of the tile.\n * @returns {OpenSeadragon.Rect} Either where this tile fits (in normalized coordinates) or the\n * portion of the tile to use as the source of the drawing operation (in pixels), depending on\n * the isSource parameter.\n */\n getTileBounds: function( level, x, y, isSource ) {\n var dimensionsScaled = this.dimensions.times( this.getLevelScale( level ) ),\n tileWidth = this.getTileWidth(level),\n tileHeight = this.getTileHeight(level),\n px = ( x === 0 ) ? 0 : tileWidth * x - this.tileOverlap,\n py = ( y === 0 ) ? 0 : tileHeight * y - this.tileOverlap,\n sx = tileWidth + ( x === 0 ? 1 : 2 ) * this.tileOverlap,\n sy = tileHeight + ( y === 0 ? 1 : 2 ) * this.tileOverlap,\n scale = 1.0 / dimensionsScaled.x;\n\n sx = Math.min( sx, dimensionsScaled.x - px );\n sy = Math.min( sy, dimensionsScaled.y - py );\n\n if (isSource) {\n return new $.Rect(0, 0, sx, sy);\n }\n\n return new $.Rect( px * scale, py * scale, sx * scale, sy * scale );\n },\n\n\n /**\n * Responsible for retrieving, and caching the\n * image metadata pertinent to this TileSources implementation.\n * @function\n * @param {String} url\n * @throws {Error}\n */\n getImageInfo: function( url ) {\n var _this = this,\n callbackName,\n callback,\n readySource,\n options,\n urlParts,\n filename,\n lastDot;\n\n\n if( url ) {\n urlParts = url.split( '/' );\n filename = urlParts[ urlParts.length - 1 ];\n lastDot = filename.lastIndexOf( '.' );\n if ( lastDot > -1 ) {\n urlParts[ urlParts.length - 1 ] = filename.slice( 0, lastDot );\n }\n }\n\n callback = function( data ){\n if( typeof (data) === \"string\" ) {\n data = $.parseXml( data );\n }\n var $TileSource = $.TileSource.determineType( _this, data, url );\n if ( !$TileSource ) {\n /**\n * Raised when an error occurs loading a TileSource.\n *\n * @event open-failed\n * @memberof OpenSeadragon.TileSource\n * @type {object}\n * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.\n * @property {String} message\n * @property {String} source\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'open-failed', { message: \"Unable to load TileSource\", source: url } );\n return;\n }\n\n options = $TileSource.prototype.configure.apply( _this, [ data, url ]);\n if (options.ajaxWithCredentials === undefined) {\n options.ajaxWithCredentials = _this.ajaxWithCredentials;\n }\n\n readySource = new $TileSource( options );\n _this.ready = true;\n /**\n * Raised when a TileSource is opened and initialized.\n *\n * @event ready\n * @memberof OpenSeadragon.TileSource\n * @type {object}\n * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.\n * @property {Object} tileSource\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'ready', { tileSource: readySource } );\n };\n\n if( url.match(/\\.js$/) ){\n //TODO: Its not very flexible to require tile sources to end jsonp\n // request for info with a url that ends with '.js' but for\n // now it's the only way I see to distinguish uniformly.\n callbackName = url.split('/').pop().replace('.js', '');\n $.jsonp({\n url: url,\n async: false,\n callbackName: callbackName,\n callback: callback\n });\n } else {\n // request info via xhr asynchronously.\n $.makeAjaxRequest( {\n url: url,\n withCredentials: this.ajaxWithCredentials,\n headers: this.ajaxHeaders,\n success: function( xhr ) {\n var data = processResponse( xhr );\n callback( data );\n },\n error: function ( xhr, exc ) {\n var msg;\n\n /*\n IE < 10 will block XHR requests to different origins. Any property access on the request\n object will raise an exception which we'll attempt to handle by formatting the original\n exception rather than the second one raised when we try to access xhr.status\n */\n try {\n msg = \"HTTP \" + xhr.status + \" attempting to load TileSource\";\n } catch ( e ) {\n var formattedExc;\n if ( typeof ( exc ) == \"undefined\" || !exc.toString ) {\n formattedExc = \"Unknown error\";\n } else {\n formattedExc = exc.toString();\n }\n\n msg = formattedExc + \" attempting to load TileSource\";\n }\n\n /***\n * Raised when an error occurs loading a TileSource.\n *\n * @event open-failed\n * @memberof OpenSeadragon.TileSource\n * @type {object}\n * @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.\n * @property {String} message\n * @property {String} source\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( 'open-failed', {\n message: msg,\n source: url\n });\n }\n });\n }\n\n },\n\n /**\n * Responsible determining if a the particular TileSource supports the\n * data format ( and allowed to apply logic against the url the data was\n * loaded from, if any ). Overriding implementations are expected to do\n * something smart with data and / or url to determine support. Also\n * understand that iteration order of TileSources is not guarunteed so\n * please make sure your data or url is expressive enough to ensure a simple\n * and sufficient mechanisim for clear determination.\n * @function\n * @param {String|Object|Array|Document} data\n * @param {String} url - the url the data was loaded\n * from if any.\n * @return {Boolean}\n */\n supports: function( data, url ) {\n return false;\n },\n\n /**\n * Responsible for parsing and configuring the\n * image metadata pertinent to this TileSources implementation.\n * This method is not implemented by this class other than to throw an Error\n * announcing you have to implement it. Because of the variety of tile\n * server technologies, and various specifications for building image\n * pyramids, this method is here to allow easy integration.\n * @function\n * @param {String|Object|Array|Document} data\n * @param {String} url - the url the data was loaded\n * from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n * @throws {Error}\n */\n configure: function( data, url ) {\n throw new Error( \"Method not implemented.\" );\n },\n\n /**\n * Responsible for retrieving the url which will return an image for the\n * region specified by the given x, y, and level components.\n * This method is not implemented by this class other than to throw an Error\n * announcing you have to implement it. Because of the variety of tile\n * server technologies, and various specifications for building image\n * pyramids, this method is here to allow easy integration.\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n * @throws {Error}\n */\n getTileUrl: function( level, x, y ) {\n throw new Error( \"Method not implemented.\" );\n },\n\n /**\n * Responsible for retrieving the headers which will be attached to the image request for the\n * region specified by the given x, y, and level components.\n * This option is only relevant if {@link OpenSeadragon.Options}.loadTilesWithAjax is set to true.\n * The headers returned here will override headers specified at the Viewer or TiledImage level.\n * Specifying a falsy value for a header will clear its existing value set at the Viewer or\n * TiledImage level (if any).\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n * @returns {Object}\n */\n getTileAjaxHeaders: function( level, x, y ) {\n return {};\n },\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n tileExists: function( level, x, y ) {\n var numTiles = this.getNumTiles( level );\n return level >= this.minLevel &&\n level <= this.maxLevel &&\n x >= 0 &&\n y >= 0 &&\n x < numTiles.x &&\n y < numTiles.y;\n }\n};\n\n\n$.extend( true, $.TileSource.prototype, $.EventSource.prototype );\n\n\n/**\n * Decides whether to try to process the response as xml, json, or hand back\n * the text\n * @private\n * @inner\n * @function\n * @param {XMLHttpRequest} xhr - the completed network request\n */\nfunction processResponse( xhr ){\n var responseText = xhr.responseText,\n status = xhr.status,\n statusText,\n data;\n\n if ( !xhr ) {\n throw new Error( $.getString( \"Errors.Security\" ) );\n } else if ( xhr.status !== 200 && xhr.status !== 0 ) {\n status = xhr.status;\n statusText = ( status == 404 ) ?\n \"Not Found\" :\n xhr.statusText;\n throw new Error( $.getString( \"Errors.Status\", status, statusText ) );\n }\n\n if( responseText.match(/\\s*<.*/) ){\n try{\n data = ( xhr.responseXML && xhr.responseXML.documentElement ) ?\n xhr.responseXML :\n $.parseXml( responseText );\n } catch (e){\n data = xhr.responseText;\n }\n }else if( responseText.match(/\\s*[\\{\\[].*/) ){\n try{\n data = $.parseJSON(responseText);\n } catch(e){\n data = responseText;\n }\n }else{\n data = responseText;\n }\n return data;\n}\n\n\n/**\n * Determines the TileSource Implementation by introspection of OpenSeadragon\n * namespace, calling each TileSource implementation of 'isType'\n * @private\n * @inner\n * @function\n * @param {Object|Array|Document} data - the tile source configuration object\n * @param {String} url - the url where the tile source configuration object was\n * loaded from, if any.\n */\n$.TileSource.determineType = function( tileSource, data, url ){\n var property;\n for( property in OpenSeadragon ){\n if( property.match(/.+TileSource$/) &&\n $.isFunction( OpenSeadragon[ property ] ) &&\n $.isFunction( OpenSeadragon[ property ].prototype.supports ) &&\n OpenSeadragon[ property ].prototype.supports.call( tileSource, data, url )\n ){\n return OpenSeadragon[ property ];\n }\n }\n\n $.console.error( \"No TileSource was able to open %s %s\", url, data );\n};\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - DziTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class DziTileSource\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Number|Object} width - the pixel width of the image or the idiomatic\n * options object which is used instead of positional arguments.\n * @param {Number} height\n * @param {Number} tileSize\n * @param {Number} tileOverlap\n * @param {String} tilesUrl\n * @param {String} fileFormat\n * @param {OpenSeadragon.DisplayRect[]} displayRects\n * @property {String} tilesUrl\n * @property {String} fileFormat\n * @property {OpenSeadragon.DisplayRect[]} displayRects\n */\n$.DziTileSource = function( width, height, tileSize, tileOverlap, tilesUrl, fileFormat, displayRects, minLevel, maxLevel ) {\n var i,\n rect,\n level,\n options;\n\n if( $.isPlainObject( width ) ){\n options = width;\n }else{\n options = {\n width: arguments[ 0 ],\n height: arguments[ 1 ],\n tileSize: arguments[ 2 ],\n tileOverlap: arguments[ 3 ],\n tilesUrl: arguments[ 4 ],\n fileFormat: arguments[ 5 ],\n displayRects: arguments[ 6 ],\n minLevel: arguments[ 7 ],\n maxLevel: arguments[ 8 ]\n };\n }\n\n this._levelRects = {};\n this.tilesUrl = options.tilesUrl;\n this.fileFormat = options.fileFormat;\n this.displayRects = options.displayRects;\n\n if ( this.displayRects ) {\n for ( i = this.displayRects.length - 1; i >= 0; i-- ) {\n rect = this.displayRects[ i ];\n for ( level = rect.minLevel; level <= rect.maxLevel; level++ ) {\n if ( !this._levelRects[ level ] ) {\n this._levelRects[ level ] = [];\n }\n this._levelRects[ level ].push( rect );\n }\n }\n }\n\n $.TileSource.apply( this, [ options ] );\n\n};\n\n$.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.DziTileSource.prototype */{\n\n\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function( data, url ){\n var ns;\n if ( data.Image ) {\n ns = data.Image.xmlns;\n } else if ( data.documentElement) {\n if (\"Image\" == data.documentElement.localName || \"Image\" == data.documentElement.tagName) {\n ns = data.documentElement.namespaceURI;\n }\n }\n\n ns = (ns || '').toLowerCase();\n\n return (ns.indexOf('schemas.microsoft.com/deepzoom/2008') !== -1 ||\n ns.indexOf('schemas.microsoft.com/deepzoom/2009') !== -1);\n },\n\n /**\n *\n * @function\n * @param {Object|XMLDocument} data - the raw configuration\n * @param {String} url - the url the data was retrieved from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function( data, url ){\n\n var options;\n\n if( !$.isPlainObject(data) ){\n\n options = configureFromXML( this, data );\n\n }else{\n\n options = configureFromObject( this, data );\n }\n\n if (url && !options.tilesUrl) {\n options.tilesUrl = url.replace(\n /([^\\/]+?)(\\.(dzi|xml|js)?(\\?[^\\/]*)?)?\\/?$/, '$1_files/');\n\n if (url.search(/\\.(dzi|xml|js)\\?/) != -1) {\n options.queryParams = url.match(/\\?.*/);\n }else{\n options.queryParams = '';\n }\n }\n\n return options;\n },\n\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n getTileUrl: function( level, x, y ) {\n return [ this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat, this.queryParams ].join( '' );\n },\n\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n tileExists: function( level, x, y ) {\n var rects = this._levelRects[ level ],\n rect,\n scale,\n xMin,\n yMin,\n xMax,\n yMax,\n i;\n\n if ((this.minLevel && level < this.minLevel) || (this.maxLevel && level > this.maxLevel)) {\n return false;\n }\n\n if ( !rects || !rects.length ) {\n return true;\n }\n\n for ( i = rects.length - 1; i >= 0; i-- ) {\n rect = rects[ i ];\n\n if ( level < rect.minLevel || level > rect.maxLevel ) {\n continue;\n }\n\n scale = this.getLevelScale( level );\n xMin = rect.x * scale;\n yMin = rect.y * scale;\n xMax = xMin + rect.width * scale;\n yMax = yMin + rect.height * scale;\n\n xMin = Math.floor( xMin / this._tileWidth );\n yMin = Math.floor( yMin / this._tileWidth ); // DZI tiles are square, so we just use _tileWidth\n xMax = Math.ceil( xMax / this._tileWidth );\n yMax = Math.ceil( yMax / this._tileWidth );\n\n if ( xMin <= x && x < xMax && yMin <= y && y < yMax ) {\n return true;\n }\n }\n\n return false;\n }\n});\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction configureFromXML( tileSource, xmlDoc ){\n\n if ( !xmlDoc || !xmlDoc.documentElement ) {\n throw new Error( $.getString( \"Errors.Xml\" ) );\n }\n\n var root = xmlDoc.documentElement,\n rootName = root.localName || root.tagName,\n ns = xmlDoc.documentElement.namespaceURI,\n configuration = null,\n displayRects = [],\n dispRectNodes,\n dispRectNode,\n rectNode,\n sizeNode,\n i;\n\n if ( rootName == \"Image\" ) {\n\n try {\n sizeNode = root.getElementsByTagName(\"Size\" )[ 0 ];\n if (sizeNode === undefined) {\n sizeNode = root.getElementsByTagNameNS(ns, \"Size\" )[ 0 ];\n }\n\n configuration = {\n Image: {\n xmlns: \"http://schemas.microsoft.com/deepzoom/2008\",\n Url: root.getAttribute( \"Url\" ),\n Format: root.getAttribute( \"Format\" ),\n DisplayRect: null,\n Overlap: parseInt( root.getAttribute( \"Overlap\" ), 10 ),\n TileSize: parseInt( root.getAttribute( \"TileSize\" ), 10 ),\n Size: {\n Height: parseInt( sizeNode.getAttribute( \"Height\" ), 10 ),\n Width: parseInt( sizeNode.getAttribute( \"Width\" ), 10 )\n }\n }\n };\n\n if ( !$.imageFormatSupported( configuration.Image.Format ) ) {\n throw new Error(\n $.getString( \"Errors.ImageFormat\", configuration.Image.Format.toUpperCase() )\n );\n }\n\n dispRectNodes = root.getElementsByTagName(\"DisplayRect\" );\n if (dispRectNodes === undefined) {\n dispRectNodes = root.getElementsByTagNameNS(ns, \"DisplayRect\" )[ 0 ];\n }\n\n for ( i = 0; i < dispRectNodes.length; i++ ) {\n dispRectNode = dispRectNodes[ i ];\n rectNode = dispRectNode.getElementsByTagName(\"Rect\" )[ 0 ];\n if (rectNode === undefined) {\n rectNode = dispRectNode.getElementsByTagNameNS(ns, \"Rect\" )[ 0 ];\n }\n\n displayRects.push({\n Rect: {\n X: parseInt( rectNode.getAttribute( \"X\" ), 10 ),\n Y: parseInt( rectNode.getAttribute( \"Y\" ), 10 ),\n Width: parseInt( rectNode.getAttribute( \"Width\" ), 10 ),\n Height: parseInt( rectNode.getAttribute( \"Height\" ), 10 ),\n MinLevel: parseInt( dispRectNode.getAttribute( \"MinLevel\" ), 10 ),\n MaxLevel: parseInt( dispRectNode.getAttribute( \"MaxLevel\" ), 10 )\n }\n });\n }\n\n if( displayRects.length ){\n configuration.Image.DisplayRect = displayRects;\n }\n\n return configureFromObject( tileSource, configuration );\n\n } catch ( e ) {\n throw (e instanceof Error) ?\n e :\n new Error( $.getString(\"Errors.Dzi\") );\n }\n } else if ( rootName == \"Collection\" ) {\n throw new Error( $.getString( \"Errors.Dzc\" ) );\n } else if ( rootName == \"Error\" ) {\n var messageNode = root.getElementsByTagName(\"Message\")[0];\n var message = messageNode.firstChild.nodeValue;\n throw new Error(message);\n }\n\n throw new Error( $.getString( \"Errors.Dzi\" ) );\n}\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction configureFromObject( tileSource, configuration ){\n var imageData = configuration.Image,\n tilesUrl = imageData.Url,\n fileFormat = imageData.Format,\n sizeData = imageData.Size,\n dispRectData = imageData.DisplayRect || [],\n width = parseInt( sizeData.Width, 10 ),\n height = parseInt( sizeData.Height, 10 ),\n tileSize = parseInt( imageData.TileSize, 10 ),\n tileOverlap = parseInt( imageData.Overlap, 10 ),\n displayRects = [],\n rectData,\n i;\n\n //TODO: need to figure out out to better handle image format compatibility\n // which actually includes additional file formats like xml and pdf\n // and plain text for various tilesource implementations to avoid low\n // level errors.\n //\n // For now, just don't perform the check.\n //\n /*if ( !imageFormatSupported( fileFormat ) ) {\n throw new Error(\n $.getString( \"Errors.ImageFormat\", fileFormat.toUpperCase() )\n );\n }*/\n\n for ( i = 0; i < dispRectData.length; i++ ) {\n rectData = dispRectData[ i ].Rect;\n\n displayRects.push( new $.DisplayRect(\n parseInt( rectData.X, 10 ),\n parseInt( rectData.Y, 10 ),\n parseInt( rectData.Width, 10 ),\n parseInt( rectData.Height, 10 ),\n parseInt( rectData.MinLevel, 10 ),\n parseInt( rectData.MaxLevel, 10 )\n ));\n }\n\n return $.extend(true, {\n width: width, /* width *required */\n height: height, /* height *required */\n tileSize: tileSize, /* tileSize *required */\n tileOverlap: tileOverlap, /* tileOverlap *required */\n minLevel: null, /* minLevel */\n maxLevel: null, /* maxLevel */\n tilesUrl: tilesUrl, /* tilesUrl */\n fileFormat: fileFormat, /* fileFormat */\n displayRects: displayRects /* displayRects */\n }, configuration );\n\n}\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - IIIFTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class IIIFTileSource\n * @classdesc A client implementation of the International Image Interoperability Framework\n * Format: Image API 1.0 - 2.1\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @see http://iiif.io/api/image/\n * @param {String} [options.tileFormat='jpg']\n * The extension that will be used when requiring tiles.\n */\n$.IIIFTileSource = function( options ){\n\n /* eslint-disable camelcase */\n\n $.extend( true, this, options );\n\n if ( !( this.height && this.width && this['@id'] ) ) {\n throw new Error( 'IIIF required parameters not provided.' );\n }\n\n options.tileSizePerScaleFactor = {};\n\n this.tileFormat = this.tileFormat || 'jpg';\n\n // N.B. 2.0 renamed scale_factors to scaleFactors\n if ( this.tile_width && this.tile_height ) {\n options.tileWidth = this.tile_width;\n options.tileHeight = this.tile_height;\n } else if ( this.tile_width ) {\n options.tileSize = this.tile_width;\n } else if ( this.tile_height ) {\n options.tileSize = this.tile_height;\n } else if ( this.tiles ) {\n // Version 2.0 forwards\n if ( this.tiles.length == 1 ) {\n options.tileWidth = this.tiles[0].width;\n // Use height if provided, otherwise assume square tiles and use width.\n options.tileHeight = this.tiles[0].height || this.tiles[0].width;\n this.scale_factors = this.tiles[0].scaleFactors;\n } else {\n // Multiple tile sizes at different levels\n this.scale_factors = [];\n for (var t = 0; t < this.tiles.length; t++ ) {\n for (var sf = 0; sf < this.tiles[t].scaleFactors.length; sf++) {\n var scaleFactor = this.tiles[t].scaleFactors[sf];\n this.scale_factors.push(scaleFactor);\n options.tileSizePerScaleFactor[scaleFactor] = {\n width: this.tiles[t].width,\n height: this.tiles[t].height || this.tiles[t].width\n };\n }\n }\n }\n } else if ( canBeTiled(options.profile) ) {\n // use the largest of tileOptions that is smaller than the short dimension\n var shortDim = Math.min( this.height, this.width ),\n tileOptions = [256, 512, 1024],\n smallerTiles = [];\n\n for ( var c = 0; c < tileOptions.length; c++ ) {\n if ( tileOptions[c] <= shortDim ) {\n smallerTiles.push( tileOptions[c] );\n }\n }\n\n if ( smallerTiles.length > 0 ) {\n options.tileSize = Math.max.apply( null, smallerTiles );\n } else {\n // If we're smaller than 256, just use the short side.\n options.tileSize = shortDim;\n }\n } else if (this.sizes && this.sizes.length > 0) {\n // This info.json can't be tiled, but we can still construct a legacy pyramid from the sizes array.\n // In this mode, IIIFTileSource will call functions from the abstract baseTileSource or the\n // LegacyTileSource instead of performing IIIF tiling.\n this.emulateLegacyImagePyramid = true;\n\n options.levels = constructLevels( this );\n // use the largest available size to define tiles\n $.extend( true, options, {\n width: options.levels[ options.levels.length - 1 ].width,\n height: options.levels[ options.levels.length - 1 ].height,\n tileSize: Math.max( options.height, options.width ),\n tileOverlap: 0,\n minLevel: 0,\n maxLevel: options.levels.length - 1\n });\n this.levels = options.levels;\n } else {\n $.console.error(\"Nothing in the info.json to construct image pyramids from\");\n }\n\n if (!options.maxLevel && !this.emulateLegacyImagePyramid) {\n if (!this.scale_factors) {\n options.maxLevel = Number(Math.ceil(Math.log(Math.max(this.width, this.height), 2)));\n } else {\n var maxScaleFactor = Math.max.apply(null, this.scale_factors);\n options.maxLevel = Math.round(Math.log(maxScaleFactor) * Math.LOG2E);\n }\n }\n\n $.TileSource.apply( this, [ options ] );\n};\n\n$.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.IIIFTileSource.prototype */{\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n\n supports: function( data, url ) {\n // Version 2.0 and forwards\n if (data.protocol && data.protocol == 'http://iiif.io/api/image') {\n return true;\n // Version 1.1\n } else if ( data['@context'] && (\n data['@context'] == \"http://library.stanford.edu/iiif/image-api/1.1/context.json\" ||\n data['@context'] == \"http://iiif.io/api/image/1/context.json\") ) {\n // N.B. the iiif.io context is wrong, but where the representation lives so likely to be used\n return true;\n\n // Version 1.0\n } else if ( data.profile &&\n data.profile.indexOf(\"http://library.stanford.edu/iiif/image-api/compliance.html\") === 0) {\n return true;\n } else if ( data.identifier && data.width && data.height ) {\n return true;\n } else if ( data.documentElement &&\n \"info\" == data.documentElement.tagName &&\n \"http://library.stanford.edu/iiif/image-api/ns/\" ==\n data.documentElement.namespaceURI) {\n return true;\n\n // Not IIIF\n } else {\n return false;\n }\n },\n\n /**\n *\n * @function\n * @param {Object} data - the raw configuration\n * @example <caption>IIIF 1.1 Info Looks like this</caption>\n * {\n * \"@context\" : \"http://library.stanford.edu/iiif/image-api/1.1/context.json\",\n * \"@id\" : \"http://iiif.example.com/prefix/1E34750D-38DB-4825-A38A-B60A345E591C\",\n * \"width\" : 6000,\n * \"height\" : 4000,\n * \"scale_factors\" : [ 1, 2, 4 ],\n * \"tile_width\" : 1024,\n * \"tile_height\" : 1024,\n * \"formats\" : [ \"jpg\", \"png\" ],\n * \"qualities\" : [ \"native\", \"grey\" ],\n * \"profile\" : \"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\"\n * }\n */\n configure: function( data, url ){\n // Try to deduce our version and fake it upwards if needed\n if ( !$.isPlainObject(data) ) {\n var options = configureFromXml10( data );\n options['@context'] = \"http://iiif.io/api/image/1.0/context.json\";\n options['@id'] = url.replace('/info.xml', '');\n return options;\n } else {\n if ( !data['@context'] ) {\n data['@context'] = 'http://iiif.io/api/image/1.0/context.json';\n data['@id'] = url.replace('/info.json', '');\n }\n if(data.preferredFormats) {\n for (var f = 0; f < data.preferredFormats.length; f++ ) {\n if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {\n data.tileFormat = data.preferredFormats[f];\n break;\n }\n }\n }\n return data;\n }\n },\n\n /**\n * Return the tileWidth for the given level.\n * @function\n * @param {Number} level\n */\n getTileWidth: function( level ) {\n\n if(this.emulateLegacyImagePyramid) {\n return $.TileSource.prototype.getTileWidth.call(this, level);\n }\n\n var scaleFactor = Math.pow(2, this.maxLevel - level);\n\n if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {\n return this.tileSizePerScaleFactor[scaleFactor].width;\n }\n return this._tileWidth;\n },\n\n /**\n * Return the tileHeight for the given level.\n * @function\n * @param {Number} level\n */\n getTileHeight: function( level ) {\n\n if(this.emulateLegacyImagePyramid) {\n return $.TileSource.prototype.getTileHeight.call(this, level);\n }\n\n var scaleFactor = Math.pow(2, this.maxLevel - level);\n\n if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {\n return this.tileSizePerScaleFactor[scaleFactor].height;\n }\n return this._tileHeight;\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getLevelScale: function ( level ) {\n\n if(this.emulateLegacyImagePyramid) {\n var levelScale = NaN;\n if (this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel) {\n levelScale =\n this.levels[level].width /\n this.levels[this.maxLevel].width;\n }\n return levelScale;\n }\n\n return $.TileSource.prototype.getLevelScale.call(this, level);\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getNumTiles: function( level ) {\n\n if(this.emulateLegacyImagePyramid) {\n var scale = this.getLevelScale(level);\n if (scale) {\n return new $.Point(1, 1);\n } else {\n return new $.Point(0, 0);\n }\n }\n\n return $.TileSource.prototype.getNumTiles.call(this, level);\n },\n\n\n /**\n * @function\n * @param {Number} level\n * @param {OpenSeadragon.Point} point\n */\n getTileAtPoint: function( level, point ) {\n\n if(this.emulateLegacyImagePyramid) {\n return new $.Point(0, 0);\n }\n\n return $.TileSource.prototype.getTileAtPoint.call(this, level, point);\n },\n\n\n /**\n * Responsible for retrieving the url which will return an image for the\n * region specified by the given x, y, and level components.\n * @function\n * @param {Number} level - z index\n * @param {Number} x\n * @param {Number} y\n * @throws {Error}\n */\n getTileUrl: function( level, x, y ){\n\n if(this.emulateLegacyImagePyramid) {\n var url = null;\n if ( this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel ) {\n url = this.levels[ level ].url;\n }\n return url;\n }\n\n //# constants\n var IIIF_ROTATION = '0',\n //## get the scale (level as a decimal)\n scale = Math.pow( 0.5, this.maxLevel - level ),\n\n //# image dimensions at this level\n levelWidth = Math.ceil( this.width * scale ),\n levelHeight = Math.ceil( this.height * scale ),\n\n //## iiif region\n tileWidth,\n tileHeight,\n iiifTileSizeWidth,\n iiifTileSizeHeight,\n iiifRegion,\n iiifTileX,\n iiifTileY,\n iiifTileW,\n iiifTileH,\n iiifSize,\n iiifSizeW,\n iiifQuality,\n uri,\n isv1;\n\n tileWidth = this.getTileWidth(level);\n tileHeight = this.getTileHeight(level);\n iiifTileSizeWidth = Math.ceil( tileWidth / scale );\n iiifTileSizeHeight = Math.ceil( tileHeight / scale );\n isv1 = ( this['@context'].indexOf('/1.0/context.json') > -1 ||\n this['@context'].indexOf('/1.1/context.json') > -1 ||\n this['@context'].indexOf('/1/context.json') > -1 );\n if (isv1) {\n iiifQuality = \"native.\" + this.tileFormat;\n } else {\n iiifQuality = \"default.\" + this.tileFormat;\n }\n if ( levelWidth < tileWidth && levelHeight < tileHeight ){\n if ( isv1 || levelWidth !== this.width ) {\n iiifSize = levelWidth + \",\";\n } else {\n iiifSize = \"max\";\n }\n iiifRegion = 'full';\n } else {\n iiifTileX = x * iiifTileSizeWidth;\n iiifTileY = y * iiifTileSizeHeight;\n iiifTileW = Math.min( iiifTileSizeWidth, this.width - iiifTileX );\n iiifTileH = Math.min( iiifTileSizeHeight, this.height - iiifTileY );\n if ( x === 0 && y === 0 && iiifTileW === this.width && iiifTileH === this.height ) {\n iiifRegion = \"full\";\n } else {\n iiifRegion = [ iiifTileX, iiifTileY, iiifTileW, iiifTileH ].join( ',' );\n }\n iiifSizeW = Math.ceil( iiifTileW * scale );\n if ( (!isv1) && iiifSizeW === this.width ) {\n iiifSize = \"max\";\n } else {\n iiifSize = iiifSizeW + \",\";\n }\n }\n uri = [ this['@id'], iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );\n\n return uri;\n }\n\n });\n\n /**\n * Determine whether arbitrary tile requests can be made against a service with the given profile\n * @function\n * @param {array} profile - IIIF profile array\n * @throws {Error}\n */\n function canBeTiled ( profile ) {\n var level0Profiles = [\n \"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",\n \"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",\n \"http://iiif.io/api/image/2/level0.json\"\n ];\n var isLevel0 = (level0Profiles.indexOf(profile[0]) !== -1);\n var hasSizeByW = false;\n if ( profile.length > 1 && profile[1].supports ) {\n hasSizeByW = profile[1].supports.indexOf( \"sizeByW\" ) !== -1;\n }\n return !isLevel0 || hasSizeByW;\n }\n\n /**\n * Build the legacy pyramid URLs (one tile per level)\n * @function\n * @param {object} options - infoJson\n * @throws {Error}\n */\n function constructLevels(options) {\n var levels = [];\n for(var i = 0; i < options.sizes.length; i++) {\n levels.push({\n url: options['@id'] + '/full/' + options.sizes[i].width + ',/0/default.' + options.tileFormat,\n width: options.sizes[i].width,\n height: options.sizes[i].height\n });\n }\n return levels.sort(function(a, b) {\n return a.width - b.width;\n });\n }\n\n\n function configureFromXml10(xmlDoc) {\n //parse the xml\n if ( !xmlDoc || !xmlDoc.documentElement ) {\n throw new Error( $.getString( \"Errors.Xml\" ) );\n }\n\n var root = xmlDoc.documentElement,\n rootName = root.tagName,\n configuration = null;\n\n if ( rootName == \"info\" ) {\n try {\n configuration = {};\n parseXML10( root, configuration );\n return configuration;\n\n } catch ( e ) {\n throw (e instanceof Error) ?\n e :\n new Error( $.getString(\"Errors.IIIF\") );\n }\n }\n throw new Error( $.getString( \"Errors.IIIF\" ) );\n }\n\n function parseXML10( node, configuration, property ) {\n var i,\n value;\n if ( node.nodeType == 3 && property ) {//text node\n value = node.nodeValue.trim();\n if( value.match(/^\\d*$/)){\n value = Number( value );\n }\n if( !configuration[ property ] ){\n configuration[ property ] = value;\n }else{\n if( !$.isArray( configuration[ property ] ) ){\n configuration[ property ] = [ configuration[ property ] ];\n }\n configuration[ property ].push( value );\n }\n } else if( node.nodeType == 1 ){\n for( i = 0; i < node.childNodes.length; i++ ){\n parseXML10( node.childNodes[ i ], configuration, node.nodeName );\n }\n }\n }\n\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - OsmTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * Derived from the OSM tile source in Rainer Simon's seajax-utils project\n * <http://github.com/rsimon/seajax-utils>. Rainer Simon has contributed\n * the included code to the OpenSeadragon project under the New BSD license;\n * see <https://github.com/openseadragon/openseadragon/issues/58>.\n */\n\n\n(function( $ ){\n\n/**\n * @class OsmTileSource\n * @classdesc A tilesource implementation for OpenStreetMap.<br><br>\n *\n * Note 1. Zoomlevels. Deep Zoom and OSM define zoom levels differently. In Deep\n * Zoom, level 0 equals an image of 1x1 pixels. In OSM, level 0 equals an image of\n * 256x256 levels (see http://gasi.ch/blog/inside-deep-zoom-2). I.e. there is a\n * difference of log2(256)=8 levels.<br><br>\n *\n * Note 2. Image dimension. According to the OSM Wiki\n * (http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels)\n * the highest Mapnik zoom level has 256.144x256.144 tiles, with a 256x256\n * pixel size. I.e. the Deep Zoom image dimension is 65.572.864x65.572.864\n * pixels.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Number|Object} width - the pixel width of the image or the idiomatic\n * options object which is used instead of positional arguments.\n * @param {Number} height\n * @param {Number} tileSize\n * @param {Number} tileOverlap\n * @param {String} tilesUrl\n */\n$.OsmTileSource = function( width, height, tileSize, tileOverlap, tilesUrl ) {\n var options;\n\n if( $.isPlainObject( width ) ){\n options = width;\n }else{\n options = {\n width: arguments[0],\n height: arguments[1],\n tileSize: arguments[2],\n tileOverlap: arguments[3],\n tilesUrl: arguments[4]\n };\n }\n //apply default setting for standard public OpenStreatMaps service\n //but allow them to be specified so fliks can host there own instance\n //or apply against other services supportting the same standard\n if( !options.width || !options.height ){\n options.width = 65572864;\n options.height = 65572864;\n }\n if( !options.tileSize ){\n options.tileSize = 256;\n options.tileOverlap = 0;\n }\n if( !options.tilesUrl ){\n options.tilesUrl = \"http://tile.openstreetmap.org/\";\n }\n options.minLevel = 8;\n\n $.TileSource.apply( this, [ options ] );\n\n};\n\n$.extend( $.OsmTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.OsmTileSource.prototype */{\n\n\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function( data, url ){\n return (\n data.type &&\n \"openstreetmaps\" == data.type\n );\n },\n\n /**\n *\n * @function\n * @param {Object} data - the raw configuration\n * @param {String} url - the url the data was retrieved from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function( data, url ){\n return data;\n },\n\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n getTileUrl: function( level, x, y ) {\n return this.tilesUrl + (level - 8) + \"/\" + x + \"/\" + y + \".png\";\n }\n});\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - TmsTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * Derived from the TMS tile source in Rainer Simon's seajax-utils project\n * <http://github.com/rsimon/seajax-utils>. Rainer Simon has contributed\n * the included code to the OpenSeadragon project under the New BSD license;\n * see <https://github.com/openseadragon/openseadragon/issues/58>.\n */\n\n\n(function( $ ){\n\n/**\n * @class TmsTileSource\n * @classdesc A tilesource implementation for Tiled Map Services (TMS).\n * TMS tile scheme ( [ as supported by OpenLayers ] is described here\n * ( http://openlayers.org/dev/examples/tms.html ).\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Number|Object} width - the pixel width of the image or the idiomatic\n * options object which is used instead of positional arguments.\n * @param {Number} height\n * @param {Number} tileSize\n * @param {Number} tileOverlap\n * @param {String} tilesUrl\n */\n$.TmsTileSource = function( width, height, tileSize, tileOverlap, tilesUrl ) {\n var options;\n\n if( $.isPlainObject( width ) ){\n options = width;\n }else{\n options = {\n width: arguments[0],\n height: arguments[1],\n tileSize: arguments[2],\n tileOverlap: arguments[3],\n tilesUrl: arguments[4]\n };\n }\n // TMS has integer multiples of 256 for width/height and adds buffer\n // if necessary -> account for this!\n var bufferedWidth = Math.ceil(options.width / 256) * 256,\n bufferedHeight = Math.ceil(options.height / 256) * 256,\n max;\n\n // Compute number of zoomlevels in this tileset\n if (bufferedWidth > bufferedHeight) {\n max = bufferedWidth / 256;\n } else {\n max = bufferedHeight / 256;\n }\n options.maxLevel = Math.ceil(Math.log(max) / Math.log(2)) - 1;\n options.tileSize = 256;\n options.width = bufferedWidth;\n options.height = bufferedHeight;\n\n $.TileSource.apply( this, [ options ] );\n\n};\n\n$.extend( $.TmsTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.TmsTileSource.prototype */{\n\n\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function( data, url ){\n return ( data.type && \"tiledmapservice\" == data.type );\n },\n\n /**\n *\n * @function\n * @param {Object} data - the raw configuration\n * @param {String} url - the url the data was retrieved from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function( data, url ){\n return data;\n },\n\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n getTileUrl: function( level, x, y ) {\n // Convert from Deep Zoom definition to TMS zoom definition\n var yTiles = this.getNumTiles( level ).y - 1;\n\n return this.tilesUrl + level + \"/\" + x + \"/\" + (yTiles - y) + \".png\";\n }\n});\n\n\n}( OpenSeadragon ));\n\n(function($) {\n\n /**\n * @class ZoomifyTileSource\n * @classdesc A tilesource implementation for the zoomify format.\n *\n * A description of the format can be found here:\n * https://ecommons.cornell.edu/bitstream/handle/1813/5410/Introducing_Zoomify_Image.pdf\n *\n * There are two ways of creating a zoomify tilesource for openseadragon\n *\n * 1) Supplying all necessary information in the tilesource object. A minimal example object for this method looks like this:\n *\n * {\n * type: \"zoomifytileservice\",\n * width: 1000,\n * height: 1000,\n * tilesUrl: \"/test/data/zoomify/\"\n * }\n *\n * The tileSize is currently hardcoded to 256 (the usual Zoomify default). The tileUrl must the path to the image _directory_.\n *\n * 2) Loading image metadata from xml file: (CURRENTLY NOT SUPPORTED)\n *\n * When creating zoomify formatted images one \"xml\" like file with name ImageProperties.xml\n * will be created as well. Here is an example of such a file:\n *\n * <IMAGE_PROPERTIES WIDTH=\"1000\" HEIGHT=\"1000\" NUMTILES=\"21\" NUMIMAGES=\"1\" VERSION=\"1.8\" TILESIZE=\"256\" />\n *\n * To use this xml file as metadata source you must supply the path to the ImageProperties.xml file and leave out all other parameters:\n * As stated above, this method of loading a zoomify tilesource is currently not supported\n *\n * {\n * type: \"zoomifytileservice\",\n * tilesUrl: \"/test/data/zoomify/ImageProperties.xml\"\n * }\n\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Number} width - the pixel width of the image.\n * @param {Number} height\n * @param {Number} tileSize\n * @param {String} tilesUrl\n */\n $.ZoomifyTileSource = function(options) {\n options.tileSize = 256;\n\n var currentImageSize = {\n x: options.width,\n y: options.height\n };\n options.imageSizes = [{\n x: options.width,\n y: options.height\n }];\n options.gridSize = [this._getGridSize(options.width, options.height, options.tileSize)];\n\n while (parseInt(currentImageSize.x, 10) > options.tileSize || parseInt(currentImageSize.y, 10) > options.tileSize) {\n currentImageSize.x = Math.floor(currentImageSize.x / 2);\n currentImageSize.y = Math.floor(currentImageSize.y / 2);\n options.imageSizes.push({\n x: currentImageSize.x,\n y: currentImageSize.y\n });\n options.gridSize.push(this._getGridSize(currentImageSize.x, currentImageSize.y, options.tileSize));\n }\n options.imageSizes.reverse();\n options.gridSize.reverse();\n options.minLevel = 0;\n options.maxLevel = options.gridSize.length - 1;\n\n OpenSeadragon.TileSource.apply(this, [options]);\n };\n\n $.extend($.ZoomifyTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.ZoomifyTileSource.prototype */ {\n\n //private\n _getGridSize: function(width, height, tileSize) {\n return {\n x: Math.ceil(width / tileSize),\n y: Math.ceil(height / tileSize)\n };\n },\n\n //private\n _calculateAbsoluteTileNumber: function(level, x, y) {\n var num = 0;\n var size = {};\n\n //Sum up all tiles below the level we want the number of tiles\n for (var z = 0; z < level; z++) {\n size = this.gridSize[z];\n num += size.x * size.y;\n }\n //Add the tiles of the level\n size = this.gridSize[level];\n num += size.x * y + x;\n return num;\n },\n\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function(data, url) {\n return (data.type && \"zoomifytileservice\" == data.type);\n },\n\n /**\n *\n * @function\n * @param {Object} data - the raw configuration\n * @param {String} url - the url the data was retrieved from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function(data, url) {\n return data;\n },\n\n /**\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n */\n getTileUrl: function(level, x, y) {\n //console.log(level);\n var result = 0;\n var num = this._calculateAbsoluteTileNumber(level, x, y);\n result = Math.floor(num / 256);\n return this.tilesUrl + 'TileGroup' + result + '/' + level + '-' + x + '-' + y + '.jpg';\n\n }\n });\n\n}(OpenSeadragon));\n\n\n/*\n * OpenSeadragon - LegacyTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class LegacyTileSource\n * @classdesc The LegacyTileSource allows simple, traditional image pyramids to be loaded\n * into an OpenSeadragon Viewer. Basically, this translates to the historically\n * common practice of starting with a 'master' image, maybe a tiff for example,\n * and generating a set of 'service' images like one or more thumbnails, a medium\n * resolution image and a high resolution image in standard web formats like\n * png or jpg.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Array} levels An array of file descriptions, each is an object with\n * a 'url', a 'width', and a 'height'. Overriding classes can expect more\n * properties but these properties are sufficient for this implementation.\n * Additionally, the levels are required to be listed in order from\n * smallest to largest.\n * @property {Number} aspectRatio\n * @property {Number} dimensions\n * @property {Number} tileSize\n * @property {Number} tileOverlap\n * @property {Number} minLevel\n * @property {Number} maxLevel\n * @property {Array} levels\n */\n$.LegacyTileSource = function( levels ) {\n\n var options,\n width,\n height;\n\n if( $.isArray( levels ) ){\n options = {\n type: 'legacy-image-pyramid',\n levels: levels\n };\n }\n\n //clean up the levels to make sure we support all formats\n options.levels = filterFiles( options.levels );\n\n if ( options.levels.length > 0 ) {\n width = options.levels[ options.levels.length - 1 ].width;\n height = options.levels[ options.levels.length - 1 ].height;\n }\n else {\n width = 0;\n height = 0;\n $.console.error( \"No supported image formats found\" );\n }\n\n $.extend( true, options, {\n width: width,\n height: height,\n tileSize: Math.max( height, width ),\n tileOverlap: 0,\n minLevel: 0,\n maxLevel: options.levels.length > 0 ? options.levels.length - 1 : 0\n } );\n\n $.TileSource.apply( this, [ options ] );\n\n this.levels = options.levels;\n};\n\n$.extend( $.LegacyTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.LegacyTileSource.prototype */{\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function( data, url ){\n return (\n data.type &&\n \"legacy-image-pyramid\" == data.type\n ) || (\n data.documentElement &&\n \"legacy-image-pyramid\" == data.documentElement.getAttribute('type')\n );\n },\n\n\n /**\n *\n * @function\n * @param {Object|XMLDocument} configuration - the raw configuration\n * @param {String} dataUrl - the url the data was retrieved from if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function( configuration, dataUrl ){\n\n var options;\n\n if( !$.isPlainObject(configuration) ){\n\n options = configureFromXML( this, configuration );\n\n }else{\n\n options = configureFromObject( this, configuration );\n }\n\n return options;\n\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getLevelScale: function ( level ) {\n var levelScale = NaN;\n if ( this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel ) {\n levelScale =\n this.levels[ level ].width /\n this.levels[ this.maxLevel ].width;\n }\n return levelScale;\n },\n\n /**\n * @function\n * @param {Number} level\n */\n getNumTiles: function( level ) {\n var scale = this.getLevelScale( level );\n if ( scale ){\n return new $.Point( 1, 1 );\n } else {\n return new $.Point( 0, 0 );\n }\n },\n\n /**\n * This method is not implemented by this class other than to throw an Error\n * announcing you have to implement it. Because of the variety of tile\n * server technologies, and various specifications for building image\n * pyramids, this method is here to allow easy integration.\n * @function\n * @param {Number} level\n * @param {Number} x\n * @param {Number} y\n * @throws {Error}\n */\n getTileUrl: function ( level, x, y ) {\n var url = null;\n if ( this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel ) {\n url = this.levels[ level ].url;\n }\n return url;\n }\n} );\n\n/**\n * This method removes any files from the Array which don't conform to our\n * basic requirements for a 'level' in the LegacyTileSource.\n * @private\n * @inner\n * @function\n */\nfunction filterFiles( files ){\n var filtered = [],\n file,\n i;\n for( i = 0; i < files.length; i++ ){\n file = files[ i ];\n if( file.height &&\n file.width &&\n file.url ){\n //This is sufficient to serve as a level\n filtered.push({\n url: file.url,\n width: Number( file.width ),\n height: Number( file.height )\n });\n }\n else {\n $.console.error( 'Unsupported image format: %s', file.url ? file.url : '<no URL>' );\n }\n }\n\n return filtered.sort(function(a, b) {\n return a.height - b.height;\n });\n\n}\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction configureFromXML( tileSource, xmlDoc ){\n\n if ( !xmlDoc || !xmlDoc.documentElement ) {\n throw new Error( $.getString( \"Errors.Xml\" ) );\n }\n\n var root = xmlDoc.documentElement,\n rootName = root.tagName,\n conf = null,\n levels = [],\n level,\n i;\n\n if ( rootName == \"image\" ) {\n\n try {\n conf = {\n type: root.getAttribute( \"type\" ),\n levels: []\n };\n\n levels = root.getElementsByTagName( \"level\" );\n for ( i = 0; i < levels.length; i++ ) {\n level = levels[ i ];\n\n conf.levels.push({\n url: level.getAttribute( \"url\" ),\n width: parseInt( level.getAttribute( \"width\" ), 10 ),\n height: parseInt( level.getAttribute( \"height\" ), 10 )\n });\n }\n\n return configureFromObject( tileSource, conf );\n\n } catch ( e ) {\n throw (e instanceof Error) ?\n e :\n new Error( 'Unknown error parsing Legacy Image Pyramid XML.' );\n }\n } else if ( rootName == \"collection\" ) {\n throw new Error( 'Legacy Image Pyramid Collections not yet supported.' );\n } else if ( rootName == \"error\" ) {\n throw new Error( 'Error: ' + xmlDoc );\n }\n\n throw new Error( 'Unknown element ' + rootName );\n}\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction configureFromObject( tileSource, configuration ){\n\n return configuration.levels;\n\n}\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - ImageTileSource\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function ($) {\n\n /**\n * @class ImageTileSource\n * @classdesc The ImageTileSource allows a simple image to be loaded\n * into an OpenSeadragon Viewer.\n * There are 2 ways to open an ImageTileSource:\n * 1. viewer.open({type: 'image', url: fooUrl});\n * 2. viewer.open(new OpenSeadragon.ImageTileSource({url: fooUrl}));\n *\n * With the first syntax, the crossOriginPolicy, ajaxWithCredentials and\n * useCanvas options are inherited from the viewer if they are not\n * specified directly in the options object.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.TileSource\n * @param {Object} options Options object.\n * @param {String} options.url URL of the image\n * @param {Boolean} [options.buildPyramid=true] If set to true (default), a\n * pyramid will be built internally to provide a better downsampling.\n * @param {String|Boolean} [options.crossOriginPolicy=false] Valid values are\n * 'Anonymous', 'use-credentials', and false. If false, image requests will\n * not use CORS preventing internal pyramid building for images from other\n * domains.\n * @param {String|Boolean} [options.ajaxWithCredentials=false] Whether to set\n * the withCredentials XHR flag for AJAX requests (when loading tile sources).\n * @param {Boolean} [options.useCanvas=true] Set to false to prevent any use\n * of the canvas API.\n */\n $.ImageTileSource = function (options) {\n\n options = $.extend({\n buildPyramid: true,\n crossOriginPolicy: false,\n ajaxWithCredentials: false,\n useCanvas: true\n }, options);\n $.TileSource.apply(this, [options]);\n\n };\n\n $.extend($.ImageTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.ImageTileSource.prototype */{\n /**\n * Determine if the data and/or url imply the image service is supported by\n * this tile source.\n * @function\n * @param {Object|Array} data\n * @param {String} optional - url\n */\n supports: function (data, url) {\n return data.type && data.type === \"image\";\n },\n /**\n *\n * @function\n * @param {Object} options - the options\n * @param {String} dataUrl - the url the image was retrieved from, if any.\n * @return {Object} options - A dictionary of keyword arguments sufficient\n * to configure this tile sources constructor.\n */\n configure: function (options, dataUrl) {\n return options;\n },\n /**\n * Responsible for retrieving, and caching the\n * image metadata pertinent to this TileSources implementation.\n * @function\n * @param {String} url\n * @throws {Error}\n */\n getImageInfo: function (url) {\n var image = this._image = new Image();\n var _this = this;\n\n if (this.crossOriginPolicy) {\n image.crossOrigin = this.crossOriginPolicy;\n }\n if (this.ajaxWithCredentials) {\n image.useCredentials = this.ajaxWithCredentials;\n }\n\n $.addEvent(image, 'load', function () {\n /* IE8 fix since it has no naturalWidth and naturalHeight */\n _this.width = Object.prototype.hasOwnProperty.call(image, 'naturalWidth') ? image.naturalWidth : image.width;\n _this.height = Object.prototype.hasOwnProperty.call(image, 'naturalHeight') ? image.naturalHeight : image.height;\n _this.aspectRatio = _this.width / _this.height;\n _this.dimensions = new $.Point(_this.width, _this.height);\n _this._tileWidth = _this.width;\n _this._tileHeight = _this.height;\n _this.tileOverlap = 0;\n _this.minLevel = 0;\n _this.levels = _this._buildLevels();\n _this.maxLevel = _this.levels.length - 1;\n\n _this.ready = true;\n\n // Note: this event is documented elsewhere, in TileSource\n _this.raiseEvent('ready', {tileSource: _this});\n });\n\n $.addEvent(image, 'error', function () {\n // Note: this event is documented elsewhere, in TileSource\n _this.raiseEvent('open-failed', {\n message: \"Error loading image at \" + url,\n source: url\n });\n });\n\n image.src = url;\n },\n /**\n * @function\n * @param {Number} level\n */\n getLevelScale: function (level) {\n var levelScale = NaN;\n if (level >= this.minLevel && level <= this.maxLevel) {\n levelScale =\n this.levels[level].width /\n this.levels[this.maxLevel].width;\n }\n return levelScale;\n },\n /**\n * @function\n * @param {Number} level\n */\n getNumTiles: function (level) {\n var scale = this.getLevelScale(level);\n if (scale) {\n return new $.Point(1, 1);\n } else {\n return new $.Point(0, 0);\n }\n },\n /**\n * Retrieves a tile url\n * @function\n * @param {Number} level Level of the tile\n * @param {Number} x x coordinate of the tile\n * @param {Number} y y coordinate of the tile\n */\n getTileUrl: function (level, x, y) {\n var url = null;\n if (level >= this.minLevel && level <= this.maxLevel) {\n url = this.levels[level].url;\n }\n return url;\n },\n /**\n * Retrieves a tile context 2D\n * @function\n * @param {Number} level Level of the tile\n * @param {Number} x x coordinate of the tile\n * @param {Number} y y coordinate of the tile\n */\n getContext2D: function (level, x, y) {\n var context = null;\n if (level >= this.minLevel && level <= this.maxLevel) {\n context = this.levels[level].context2D;\n }\n return context;\n },\n\n // private\n //\n // Builds the different levels of the pyramid if possible\n // (i.e. if canvas API enabled and no canvas tainting issue).\n _buildLevels: function () {\n var levels = [{\n url: this._image.src,\n /* IE8 fix since it has no naturalWidth and naturalHeight */\n width: Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width,\n height: Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height\n }];\n\n if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {\n // We don't need the image anymore. Allows it to be GC.\n delete this._image;\n return levels;\n }\n\n /* IE8 fix since it has no naturalWidth and naturalHeight */\n var currentWidth = Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width;\n var currentHeight = Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height;\n\n\n var bigCanvas = document.createElement(\"canvas\");\n var bigContext = bigCanvas.getContext(\"2d\");\n\n bigCanvas.width = currentWidth;\n bigCanvas.height = currentHeight;\n bigContext.drawImage(this._image, 0, 0, currentWidth, currentHeight);\n // We cache the context of the highest level because the browser\n // is a lot faster at downsampling something it already has\n // downsampled before.\n levels[0].context2D = bigContext;\n // We don't need the image anymore. Allows it to be GC.\n delete this._image;\n\n if ($.isCanvasTainted(bigCanvas)) {\n // If the canvas is tainted, we can't compute the pyramid.\n return levels;\n }\n\n // We build smaller levels until either width or height becomes\n // 1 pixel wide.\n while (currentWidth >= 2 && currentHeight >= 2) {\n currentWidth = Math.floor(currentWidth / 2);\n currentHeight = Math.floor(currentHeight / 2);\n var smallCanvas = document.createElement(\"canvas\");\n var smallContext = smallCanvas.getContext(\"2d\");\n smallCanvas.width = currentWidth;\n smallCanvas.height = currentHeight;\n smallContext.drawImage(bigCanvas, 0, 0, currentWidth, currentHeight);\n\n levels.splice(0, 0, {\n context2D: smallContext,\n width: currentWidth,\n height: currentHeight\n });\n\n bigCanvas = smallCanvas;\n bigContext = smallContext;\n }\n return levels;\n }\n });\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - TileSourceCollection\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($) {\n\n// deprecated\n$.TileSourceCollection = function(tileSize, tileSources, rows, layout) {\n $.console.error('TileSourceCollection is deprecated; use World instead');\n};\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - Button\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * An enumeration of button states\n * @member ButtonState\n * @memberof OpenSeadragon\n * @static\n * @type {Object}\n * @property {Number} REST\n * @property {Number} GROUP\n * @property {Number} HOVER\n * @property {Number} DOWN\n */\n$.ButtonState = {\n REST: 0,\n GROUP: 1,\n HOVER: 2,\n DOWN: 3\n};\n\n/**\n * @class Button\n * @classdesc Manages events, hover states for individual buttons, tool-tips, as well\n * as fading the buttons out when the user has not interacted with them\n * for a specified period.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.EventSource\n * @param {Object} options\n * @param {Element} [options.element=null] Element to use as the button. If not specified, an HTML &lt;div&gt; element is created.\n * @param {String} [options.tooltip=null] Provides context help for the button when the\n * user hovers over it.\n * @param {String} [options.srcRest=null] URL of image to use in 'rest' state.\n * @param {String} [options.srcGroup=null] URL of image to use in 'up' state.\n * @param {String} [options.srcHover=null] URL of image to use in 'hover' state.\n * @param {String} [options.srcDown=null] URL of image to use in 'down' state.\n * @param {Number} [options.fadeDelay=0] How long to wait before fading.\n * @param {Number} [options.fadeLength=2000] How long should it take to fade the button.\n * @param {OpenSeadragon.EventHandler} [options.onPress=null] Event handler callback for {@link OpenSeadragon.Button.event:press}.\n * @param {OpenSeadragon.EventHandler} [options.onRelease=null] Event handler callback for {@link OpenSeadragon.Button.event:release}.\n * @param {OpenSeadragon.EventHandler} [options.onClick=null] Event handler callback for {@link OpenSeadragon.Button.event:click}.\n * @param {OpenSeadragon.EventHandler} [options.onEnter=null] Event handler callback for {@link OpenSeadragon.Button.event:enter}.\n * @param {OpenSeadragon.EventHandler} [options.onExit=null] Event handler callback for {@link OpenSeadragon.Button.event:exit}.\n * @param {OpenSeadragon.EventHandler} [options.onFocus=null] Event handler callback for {@link OpenSeadragon.Button.event:focus}.\n * @param {OpenSeadragon.EventHandler} [options.onBlur=null] Event handler callback for {@link OpenSeadragon.Button.event:blur}.\n */\n$.Button = function( options ) {\n\n var _this = this;\n\n $.EventSource.call( this );\n\n $.extend( true, this, {\n\n tooltip: null,\n srcRest: null,\n srcGroup: null,\n srcHover: null,\n srcDown: null,\n clickTimeThreshold: $.DEFAULT_SETTINGS.clickTimeThreshold,\n clickDistThreshold: $.DEFAULT_SETTINGS.clickDistThreshold,\n /**\n * How long to wait before fading.\n * @member {Number} fadeDelay\n * @memberof OpenSeadragon.Button#\n */\n fadeDelay: 0,\n /**\n * How long should it take to fade the button.\n * @member {Number} fadeLength\n * @memberof OpenSeadragon.Button#\n */\n fadeLength: 2000,\n onPress: null,\n onRelease: null,\n onClick: null,\n onEnter: null,\n onExit: null,\n onFocus: null,\n onBlur: null\n\n }, options );\n\n /**\n * The button element.\n * @member {Element} element\n * @memberof OpenSeadragon.Button#\n */\n this.element = options.element || $.makeNeutralElement(\"div\");\n\n //if the user has specified the element to bind the control to explicitly\n //then do not add the default control images\n if ( !options.element ) {\n this.imgRest = $.makeTransparentImage( this.srcRest );\n this.imgGroup = $.makeTransparentImage( this.srcGroup );\n this.imgHover = $.makeTransparentImage( this.srcHover );\n this.imgDown = $.makeTransparentImage( this.srcDown );\n\n this.imgRest.alt =\n this.imgGroup.alt =\n this.imgHover.alt =\n this.imgDown.alt =\n this.tooltip;\n\n this.element.style.position = \"relative\";\n $.setElementTouchActionNone( this.element );\n\n this.imgGroup.style.position =\n this.imgHover.style.position =\n this.imgDown.style.position =\n \"absolute\";\n\n this.imgGroup.style.top =\n this.imgHover.style.top =\n this.imgDown.style.top =\n \"0px\";\n\n this.imgGroup.style.left =\n this.imgHover.style.left =\n this.imgDown.style.left =\n \"0px\";\n\n this.imgHover.style.visibility =\n this.imgDown.style.visibility =\n \"hidden\";\n\n if ($.Browser.vendor == $.BROWSERS.FIREFOX && $.Browser.version < 3) {\n this.imgGroup.style.top =\n this.imgHover.style.top =\n this.imgDown.style.top =\n \"\";\n }\n\n this.element.appendChild( this.imgRest );\n this.element.appendChild( this.imgGroup );\n this.element.appendChild( this.imgHover );\n this.element.appendChild( this.imgDown );\n }\n\n\n this.addHandler(\"press\", this.onPress);\n this.addHandler(\"release\", this.onRelease);\n this.addHandler(\"click\", this.onClick);\n this.addHandler(\"enter\", this.onEnter);\n this.addHandler(\"exit\", this.onExit);\n this.addHandler(\"focus\", this.onFocus);\n this.addHandler(\"blur\", this.onBlur);\n\n /**\n * The button's current state.\n * @member {OpenSeadragon.ButtonState} currentState\n * @memberof OpenSeadragon.Button#\n */\n this.currentState = $.ButtonState.GROUP;\n\n // When the button last began to fade.\n this.fadeBeginTime = null;\n // Whether this button should fade after user stops interacting with the viewport.\n this.shouldFade = false;\n\n this.element.style.display = \"inline-block\";\n this.element.style.position = \"relative\";\n this.element.title = this.tooltip;\n\n /**\n * Tracks mouse/touch/key events on the button.\n * @member {OpenSeadragon.MouseTracker} tracker\n * @memberof OpenSeadragon.Button#\n */\n this.tracker = new $.MouseTracker({\n\n element: this.element,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n\n enterHandler: function( event ) {\n if ( event.insideElementPressed ) {\n inTo( _this, $.ButtonState.DOWN );\n /**\n * Raised when the cursor enters the Button element.\n *\n * @event enter\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"enter\", { originalEvent: event.originalEvent } );\n } else if ( !event.buttonDownAny ) {\n inTo( _this, $.ButtonState.HOVER );\n }\n },\n\n focusHandler: function ( event ) {\n this.enterHandler( event );\n /**\n * Raised when the Button element receives focus.\n *\n * @event focus\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"focus\", { originalEvent: event.originalEvent } );\n },\n\n exitHandler: function( event ) {\n outTo( _this, $.ButtonState.GROUP );\n if ( event.insideElementPressed ) {\n /**\n * Raised when the cursor leaves the Button element.\n *\n * @event exit\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"exit\", { originalEvent: event.originalEvent } );\n }\n },\n\n blurHandler: function ( event ) {\n this.exitHandler( event );\n /**\n * Raised when the Button element loses focus.\n *\n * @event blur\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"blur\", { originalEvent: event.originalEvent } );\n },\n\n pressHandler: function ( event ) {\n inTo( _this, $.ButtonState.DOWN );\n /**\n * Raised when a mouse button is pressed or touch occurs in the Button element.\n *\n * @event press\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"press\", { originalEvent: event.originalEvent } );\n },\n\n releaseHandler: function( event ) {\n if ( event.insideElementPressed && event.insideElementReleased ) {\n outTo( _this, $.ButtonState.HOVER );\n /**\n * Raised when the mouse button is released or touch ends in the Button element.\n *\n * @event release\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"release\", { originalEvent: event.originalEvent } );\n } else if ( event.insideElementPressed ) {\n outTo( _this, $.ButtonState.GROUP );\n } else {\n inTo( _this, $.ButtonState.HOVER );\n }\n },\n\n clickHandler: function( event ) {\n if ( event.quick ) {\n /**\n * Raised when a mouse button is pressed and released or touch is initiated and ended in the Button element within the time and distance threshold.\n *\n * @event click\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent(\"click\", { originalEvent: event.originalEvent });\n }\n },\n\n keyHandler: function( event ){\n //console.log( \"%s : handling key %s!\", _this.tooltip, event.keyCode);\n if( 13 === event.keyCode ){\n /***\n * Raised when a mouse button is pressed and released or touch is initiated and ended in the Button element within the time and distance threshold.\n *\n * @event click\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"click\", { originalEvent: event.originalEvent } );\n /***\n * Raised when the mouse button is released or touch ends in the Button element.\n *\n * @event release\n * @memberof OpenSeadragon.Button\n * @type {object}\n * @property {OpenSeadragon.Button} eventSource - A reference to the Button which raised the event.\n * @property {Object} originalEvent - The original DOM event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.raiseEvent( \"release\", { originalEvent: event.originalEvent } );\n return false;\n }\n return true;\n }\n\n });\n\n outTo( this, $.ButtonState.REST );\n};\n\n$.extend( $.Button.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.Button.prototype */{\n\n /**\n * TODO: Determine what this function is intended to do and if it's actually\n * useful as an API point.\n * @function\n */\n notifyGroupEnter: function() {\n inTo( this, $.ButtonState.GROUP );\n },\n\n /**\n * TODO: Determine what this function is intended to do and if it's actually\n * useful as an API point.\n * @function\n */\n notifyGroupExit: function() {\n outTo( this, $.ButtonState.REST );\n },\n\n /**\n * @function\n */\n disable: function(){\n this.notifyGroupExit();\n this.element.disabled = true;\n $.setElementOpacity( this.element, 0.2, true );\n },\n\n /**\n * @function\n */\n enable: function(){\n this.element.disabled = false;\n $.setElementOpacity( this.element, 1.0, true );\n this.notifyGroupEnter();\n }\n\n});\n\n\nfunction scheduleFade( button ) {\n $.requestAnimationFrame(function(){\n updateFade( button );\n });\n}\n\nfunction updateFade( button ) {\n var currentTime,\n deltaTime,\n opacity;\n\n if ( button.shouldFade ) {\n currentTime = $.now();\n deltaTime = currentTime - button.fadeBeginTime;\n opacity = 1.0 - deltaTime / button.fadeLength;\n opacity = Math.min( 1.0, opacity );\n opacity = Math.max( 0.0, opacity );\n\n if( button.imgGroup ){\n $.setElementOpacity( button.imgGroup, opacity, true );\n }\n if ( opacity > 0 ) {\n // fade again\n scheduleFade( button );\n }\n }\n}\n\nfunction beginFading( button ) {\n button.shouldFade = true;\n button.fadeBeginTime = $.now() + button.fadeDelay;\n window.setTimeout( function(){\n scheduleFade( button );\n }, button.fadeDelay );\n}\n\nfunction stopFading( button ) {\n button.shouldFade = false;\n if( button.imgGroup ){\n $.setElementOpacity( button.imgGroup, 1.0, true );\n }\n}\n\nfunction inTo( button, newState ) {\n\n if( button.element.disabled ){\n return;\n }\n\n if ( newState >= $.ButtonState.GROUP &&\n button.currentState == $.ButtonState.REST ) {\n stopFading( button );\n button.currentState = $.ButtonState.GROUP;\n }\n\n if ( newState >= $.ButtonState.HOVER &&\n button.currentState == $.ButtonState.GROUP ) {\n if( button.imgHover ){\n button.imgHover.style.visibility = \"\";\n }\n button.currentState = $.ButtonState.HOVER;\n }\n\n if ( newState >= $.ButtonState.DOWN &&\n button.currentState == $.ButtonState.HOVER ) {\n if( button.imgDown ){\n button.imgDown.style.visibility = \"\";\n }\n button.currentState = $.ButtonState.DOWN;\n }\n}\n\n\nfunction outTo( button, newState ) {\n\n if( button.element.disabled ){\n return;\n }\n\n if ( newState <= $.ButtonState.HOVER &&\n button.currentState == $.ButtonState.DOWN ) {\n if( button.imgDown ){\n button.imgDown.style.visibility = \"hidden\";\n }\n button.currentState = $.ButtonState.HOVER;\n }\n\n if ( newState <= $.ButtonState.GROUP &&\n button.currentState == $.ButtonState.HOVER ) {\n if( button.imgHover ){\n button.imgHover.style.visibility = \"hidden\";\n }\n button.currentState = $.ButtonState.GROUP;\n }\n\n if ( newState <= $.ButtonState.REST &&\n button.currentState == $.ButtonState.GROUP ) {\n beginFading( button );\n button.currentState = $.ButtonState.REST;\n }\n}\n\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - ButtonGroup\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n/**\n * @class ButtonGroup\n * @classdesc Manages events on groups of buttons.\n *\n * @memberof OpenSeadragon\n * @param {Object} options - A dictionary of settings applied against the entire group of buttons.\n * @param {Array} options.buttons Array of buttons\n * @param {Element} [options.element] Element to use as the container\n **/\n$.ButtonGroup = function( options ) {\n\n $.extend( true, this, {\n /**\n * An array containing the buttons themselves.\n * @member {Array} buttons\n * @memberof OpenSeadragon.ButtonGroup#\n */\n buttons: [],\n clickTimeThreshold: $.DEFAULT_SETTINGS.clickTimeThreshold,\n clickDistThreshold: $.DEFAULT_SETTINGS.clickDistThreshold,\n labelText: \"\"\n }, options );\n\n // copy the button elements TODO: Why?\n var buttons = this.buttons.concat([]),\n _this = this,\n i;\n\n /**\n * The shared container for the buttons.\n * @member {Element} element\n * @memberof OpenSeadragon.ButtonGroup#\n */\n this.element = options.element || $.makeNeutralElement( \"div\" );\n\n // TODO What if there IS an options.group specified?\n if( !options.group ){\n this.element.style.display = \"inline-block\";\n //this.label = $.makeNeutralElement( \"label\" );\n //TODO: support labels for ButtonGroups\n //this.label.innerHTML = this.labelText;\n //this.element.appendChild( this.label );\n for ( i = 0; i < buttons.length; i++ ) {\n this.element.appendChild( buttons[ i ].element );\n }\n }\n\n $.setElementTouchActionNone( this.element );\n\n /**\n * Tracks mouse/touch/key events across the group of buttons.\n * @member {OpenSeadragon.MouseTracker} tracker\n * @memberof OpenSeadragon.ButtonGroup#\n */\n this.tracker = new $.MouseTracker({\n element: this.element,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n enterHandler: function ( event ) {\n var i;\n for ( i = 0; i < _this.buttons.length; i++ ) {\n _this.buttons[ i ].notifyGroupEnter();\n }\n },\n exitHandler: function ( event ) {\n var i;\n if ( !event.insideElementPressed ) {\n for ( i = 0; i < _this.buttons.length; i++ ) {\n _this.buttons[ i ].notifyGroupExit();\n }\n }\n },\n });\n};\n\n/** @lends OpenSeadragon.ButtonGroup.prototype */\n$.ButtonGroup.prototype = {\n\n /**\n * TODO: Figure out why this is used on the public API and if a more useful\n * api can be created.\n * @function\n * @private\n */\n emulateEnter: function() {\n this.tracker.enterHandler( { eventSource: this.tracker } );\n },\n\n /**\n * TODO: Figure out why this is used on the public API and if a more useful\n * api can be created.\n * @function\n * @private\n */\n emulateExit: function() {\n this.tracker.exitHandler( { eventSource: this.tracker } );\n }\n};\n\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Rect\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($) {\n\n/**\n * @class Rect\n * @classdesc A Rectangle is described by it top left coordinates (x, y), width,\n * height and degrees of rotation around (x, y).\n * Note that the coordinate system used is the one commonly used with images:\n * x increases when going to the right\n * y increases when going to the bottom\n * degrees increases clockwise with 0 being the horizontal\n *\n * The constructor normalizes the rectangle to always have 0 <= degrees < 90\n *\n * @memberof OpenSeadragon\n * @param {Number} [x=0] The vector component 'x'.\n * @param {Number} [y=0] The vector component 'y'.\n * @param {Number} [width=0] The vector component 'width'.\n * @param {Number} [height=0] The vector component 'height'.\n * @param {Number} [degrees=0] Rotation of the rectangle around (x,y) in degrees.\n */\n$.Rect = function(x, y, width, height, degrees) {\n /**\n * The vector component 'x'.\n * @member {Number} x\n * @memberof OpenSeadragon.Rect#\n */\n this.x = typeof (x) === \"number\" ? x : 0;\n /**\n * The vector component 'y'.\n * @member {Number} y\n * @memberof OpenSeadragon.Rect#\n */\n this.y = typeof (y) === \"number\" ? y : 0;\n /**\n * The vector component 'width'.\n * @member {Number} width\n * @memberof OpenSeadragon.Rect#\n */\n this.width = typeof (width) === \"number\" ? width : 0;\n /**\n * The vector component 'height'.\n * @member {Number} height\n * @memberof OpenSeadragon.Rect#\n */\n this.height = typeof (height) === \"number\" ? height : 0;\n\n this.degrees = typeof (degrees) === \"number\" ? degrees : 0;\n\n // Normalizes the rectangle.\n this.degrees = $.positiveModulo(this.degrees, 360);\n var newTopLeft, newWidth;\n if (this.degrees >= 270) {\n newTopLeft = this.getTopRight();\n this.x = newTopLeft.x;\n this.y = newTopLeft.y;\n newWidth = this.height;\n this.height = this.width;\n this.width = newWidth;\n this.degrees -= 270;\n } else if (this.degrees >= 180) {\n newTopLeft = this.getBottomRight();\n this.x = newTopLeft.x;\n this.y = newTopLeft.y;\n this.degrees -= 180;\n } else if (this.degrees >= 90) {\n newTopLeft = this.getBottomLeft();\n this.x = newTopLeft.x;\n this.y = newTopLeft.y;\n newWidth = this.height;\n this.height = this.width;\n this.width = newWidth;\n this.degrees -= 90;\n }\n};\n\n/**\n * Builds a rectangle having the 3 specified points as summits.\n * @static\n * @memberof OpenSeadragon.Rect\n * @param {OpenSeadragon.Point} topLeft\n * @param {OpenSeadragon.Point} topRight\n * @param {OpenSeadragon.Point} bottomLeft\n * @returns {OpenSeadragon.Rect}\n */\n$.Rect.fromSummits = function(topLeft, topRight, bottomLeft) {\n var width = topLeft.distanceTo(topRight);\n var height = topLeft.distanceTo(bottomLeft);\n var diff = topRight.minus(topLeft);\n var radians = Math.atan(diff.y / diff.x);\n if (diff.x < 0) {\n radians += Math.PI;\n } else if (diff.y < 0) {\n radians += 2 * Math.PI;\n }\n return new $.Rect(\n topLeft.x,\n topLeft.y,\n width,\n height,\n radians / Math.PI * 180);\n};\n\n/** @lends OpenSeadragon.Rect.prototype */\n$.Rect.prototype = {\n /**\n * @function\n * @returns {OpenSeadragon.Rect} a duplicate of this Rect\n */\n clone: function() {\n return new $.Rect(\n this.x,\n this.y,\n this.width,\n this.height,\n this.degrees);\n },\n\n /**\n * The aspect ratio is simply the ratio of width to height.\n * @function\n * @returns {Number} The ratio of width to height.\n */\n getAspectRatio: function() {\n return this.width / this.height;\n },\n\n /**\n * Provides the coordinates of the upper-left corner of the rectangle as a\n * point.\n * @function\n * @returns {OpenSeadragon.Point} The coordinate of the upper-left corner of\n * the rectangle.\n */\n getTopLeft: function() {\n return new $.Point(\n this.x,\n this.y\n );\n },\n\n /**\n * Provides the coordinates of the bottom-right corner of the rectangle as a\n * point.\n * @function\n * @returns {OpenSeadragon.Point} The coordinate of the bottom-right corner of\n * the rectangle.\n */\n getBottomRight: function() {\n return new $.Point(this.x + this.width, this.y + this.height)\n .rotate(this.degrees, this.getTopLeft());\n },\n\n /**\n * Provides the coordinates of the top-right corner of the rectangle as a\n * point.\n * @function\n * @returns {OpenSeadragon.Point} The coordinate of the top-right corner of\n * the rectangle.\n */\n getTopRight: function() {\n return new $.Point(this.x + this.width, this.y)\n .rotate(this.degrees, this.getTopLeft());\n },\n\n /**\n * Provides the coordinates of the bottom-left corner of the rectangle as a\n * point.\n * @function\n * @returns {OpenSeadragon.Point} The coordinate of the bottom-left corner of\n * the rectangle.\n */\n getBottomLeft: function() {\n return new $.Point(this.x, this.y + this.height)\n .rotate(this.degrees, this.getTopLeft());\n },\n\n /**\n * Computes the center of the rectangle.\n * @function\n * @returns {OpenSeadragon.Point} The center of the rectangle as represented\n * as represented by a 2-dimensional vector (x,y)\n */\n getCenter: function() {\n return new $.Point(\n this.x + this.width / 2.0,\n this.y + this.height / 2.0\n ).rotate(this.degrees, this.getTopLeft());\n },\n\n /**\n * Returns the width and height component as a vector OpenSeadragon.Point\n * @function\n * @returns {OpenSeadragon.Point} The 2 dimensional vector representing the\n * the width and height of the rectangle.\n */\n getSize: function() {\n return new $.Point(this.width, this.height);\n },\n\n /**\n * Determines if two Rectangles have equivalent components.\n * @function\n * @param {OpenSeadragon.Rect} rectangle The Rectangle to compare to.\n * @return {Boolean} 'true' if all components are equal, otherwise 'false'.\n */\n equals: function(other) {\n return (other instanceof $.Rect) &&\n this.x === other.x &&\n this.y === other.y &&\n this.width === other.width &&\n this.height === other.height &&\n this.degrees === other.degrees;\n },\n\n /**\n * Multiply all dimensions (except degrees) in this Rect by a factor and\n * return a new Rect.\n * @function\n * @param {Number} factor The factor to multiply vector components.\n * @returns {OpenSeadragon.Rect} A new rect representing the multiplication\n * of the vector components by the factor\n */\n times: function(factor) {\n return new $.Rect(\n this.x * factor,\n this.y * factor,\n this.width * factor,\n this.height * factor,\n this.degrees);\n },\n\n /**\n * Translate/move this Rect by a vector and return new Rect.\n * @function\n * @param {OpenSeadragon.Point} delta The translation vector.\n * @returns {OpenSeadragon.Rect} A new rect with altered position\n */\n translate: function(delta) {\n return new $.Rect(\n this.x + delta.x,\n this.y + delta.y,\n this.width,\n this.height,\n this.degrees);\n },\n\n /**\n * Returns the smallest rectangle that will contain this and the given\n * rectangle bounding boxes.\n * @param {OpenSeadragon.Rect} rect\n * @return {OpenSeadragon.Rect} The new rectangle.\n */\n union: function(rect) {\n var thisBoundingBox = this.getBoundingBox();\n var otherBoundingBox = rect.getBoundingBox();\n\n var left = Math.min(thisBoundingBox.x, otherBoundingBox.x);\n var top = Math.min(thisBoundingBox.y, otherBoundingBox.y);\n var right = Math.max(\n thisBoundingBox.x + thisBoundingBox.width,\n otherBoundingBox.x + otherBoundingBox.width);\n var bottom = Math.max(\n thisBoundingBox.y + thisBoundingBox.height,\n otherBoundingBox.y + otherBoundingBox.height);\n\n return new $.Rect(\n left,\n top,\n right - left,\n bottom - top);\n },\n\n /**\n * Returns the bounding box of the intersection of this rectangle with the\n * given rectangle.\n * @param {OpenSeadragon.Rect} rect\n * @return {OpenSeadragon.Rect} the bounding box of the intersection\n * or null if the rectangles don't intersect.\n */\n intersection: function(rect) {\n // Simplified version of Weiler Atherton clipping algorithm\n // https://en.wikipedia.org/wiki/Weiler%E2%80%93Atherton_clipping_algorithm\n // Because we just want the bounding box of the intersection,\n // we can just compute the bounding box of:\n // 1. all the summits of this which are inside rect\n // 2. all the summits of rect which are inside this\n // 3. all the intersections of rect and this\n var EPSILON = 0.0000000001;\n\n var intersectionPoints = [];\n\n var thisTopLeft = this.getTopLeft();\n if (rect.containsPoint(thisTopLeft, EPSILON)) {\n intersectionPoints.push(thisTopLeft);\n }\n var thisTopRight = this.getTopRight();\n if (rect.containsPoint(thisTopRight, EPSILON)) {\n intersectionPoints.push(thisTopRight);\n }\n var thisBottomLeft = this.getBottomLeft();\n if (rect.containsPoint(thisBottomLeft, EPSILON)) {\n intersectionPoints.push(thisBottomLeft);\n }\n var thisBottomRight = this.getBottomRight();\n if (rect.containsPoint(thisBottomRight, EPSILON)) {\n intersectionPoints.push(thisBottomRight);\n }\n\n var rectTopLeft = rect.getTopLeft();\n if (this.containsPoint(rectTopLeft, EPSILON)) {\n intersectionPoints.push(rectTopLeft);\n }\n var rectTopRight = rect.getTopRight();\n if (this.containsPoint(rectTopRight, EPSILON)) {\n intersectionPoints.push(rectTopRight);\n }\n var rectBottomLeft = rect.getBottomLeft();\n if (this.containsPoint(rectBottomLeft, EPSILON)) {\n intersectionPoints.push(rectBottomLeft);\n }\n var rectBottomRight = rect.getBottomRight();\n if (this.containsPoint(rectBottomRight, EPSILON)) {\n intersectionPoints.push(rectBottomRight);\n }\n\n var thisSegments = this._getSegments();\n var rectSegments = rect._getSegments();\n for (var i = 0; i < thisSegments.length; i++) {\n var thisSegment = thisSegments[i];\n for (var j = 0; j < rectSegments.length; j++) {\n var rectSegment = rectSegments[j];\n var intersect = getIntersection(thisSegment[0], thisSegment[1],\n rectSegment[0], rectSegment[1]);\n if (intersect) {\n intersectionPoints.push(intersect);\n }\n }\n }\n\n // Get intersection point of segments [a,b] and [c,d]\n function getIntersection(a, b, c, d) {\n // http://stackoverflow.com/a/1968345/1440403\n var abVector = b.minus(a);\n var cdVector = d.minus(c);\n\n var denom = -cdVector.x * abVector.y + abVector.x * cdVector.y;\n if (denom === 0) {\n return null;\n }\n\n var s = (abVector.x * (a.y - c.y) - abVector.y * (a.x - c.x)) / denom;\n var t = (cdVector.x * (a.y - c.y) - cdVector.y * (a.x - c.x)) / denom;\n\n if (-EPSILON <= s && s <= 1 - EPSILON &&\n -EPSILON <= t && t <= 1 - EPSILON) {\n return new $.Point(a.x + t * abVector.x, a.y + t * abVector.y);\n }\n return null;\n }\n\n if (intersectionPoints.length === 0) {\n return null;\n }\n\n var minX = intersectionPoints[0].x;\n var maxX = intersectionPoints[0].x;\n var minY = intersectionPoints[0].y;\n var maxY = intersectionPoints[0].y;\n for (var k = 1; k < intersectionPoints.length; k++) {\n var point = intersectionPoints[k];\n if (point.x < minX) {\n minX = point.x;\n }\n if (point.x > maxX) {\n maxX = point.x;\n }\n if (point.y < minY) {\n minY = point.y;\n }\n if (point.y > maxY) {\n maxY = point.y;\n }\n }\n return new $.Rect(minX, minY, maxX - minX, maxY - minY);\n },\n\n // private\n _getSegments: function() {\n var topLeft = this.getTopLeft();\n var topRight = this.getTopRight();\n var bottomLeft = this.getBottomLeft();\n var bottomRight = this.getBottomRight();\n return [[topLeft, topRight],\n [topRight, bottomRight],\n [bottomRight, bottomLeft],\n [bottomLeft, topLeft]];\n },\n\n /**\n * Rotates a rectangle around a point.\n * @function\n * @param {Number} degrees The angle in degrees to rotate.\n * @param {OpenSeadragon.Point} [pivot] The point about which to rotate.\n * Defaults to the center of the rectangle.\n * @return {OpenSeadragon.Rect}\n */\n rotate: function(degrees, pivot) {\n degrees = $.positiveModulo(degrees, 360);\n if (degrees === 0) {\n return this.clone();\n }\n\n pivot = pivot || this.getCenter();\n var newTopLeft = this.getTopLeft().rotate(degrees, pivot);\n var newTopRight = this.getTopRight().rotate(degrees, pivot);\n\n var diff = newTopRight.minus(newTopLeft);\n // Handle floating point error\n diff = diff.apply(function(x) {\n var EPSILON = 1e-15;\n return Math.abs(x) < EPSILON ? 0 : x;\n });\n var radians = Math.atan(diff.y / diff.x);\n if (diff.x < 0) {\n radians += Math.PI;\n } else if (diff.y < 0) {\n radians += 2 * Math.PI;\n }\n return new $.Rect(\n newTopLeft.x,\n newTopLeft.y,\n this.width,\n this.height,\n radians / Math.PI * 180);\n },\n\n /**\n * Retrieves the smallest horizontal (degrees=0) rectangle which contains\n * this rectangle.\n * @returns {OpenSeadragon.Rect}\n */\n getBoundingBox: function() {\n if (this.degrees === 0) {\n return this.clone();\n }\n var topLeft = this.getTopLeft();\n var topRight = this.getTopRight();\n var bottomLeft = this.getBottomLeft();\n var bottomRight = this.getBottomRight();\n var minX = Math.min(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);\n var maxX = Math.max(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);\n var minY = Math.min(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);\n var maxY = Math.max(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);\n return new $.Rect(\n minX,\n minY,\n maxX - minX,\n maxY - minY);\n },\n\n /**\n * Retrieves the smallest horizontal (degrees=0) rectangle which contains\n * this rectangle and has integers x, y, width and height\n * @returns {OpenSeadragon.Rect}\n */\n getIntegerBoundingBox: function() {\n var boundingBox = this.getBoundingBox();\n var x = Math.floor(boundingBox.x);\n var y = Math.floor(boundingBox.y);\n var width = Math.ceil(boundingBox.width + boundingBox.x - x);\n var height = Math.ceil(boundingBox.height + boundingBox.y - y);\n return new $.Rect(x, y, width, height);\n },\n\n /**\n * Determines whether a point is inside this rectangle (edge included).\n * @function\n * @param {OpenSeadragon.Point} point\n * @param {Number} [epsilon=0] the margin of error allowed\n * @returns {Boolean} true if the point is inside this rectangle, false\n * otherwise.\n */\n containsPoint: function(point, epsilon) {\n epsilon = epsilon || 0;\n\n // See http://stackoverflow.com/a/2752754/1440403 for explanation\n var topLeft = this.getTopLeft();\n var topRight = this.getTopRight();\n var bottomLeft = this.getBottomLeft();\n var topDiff = topRight.minus(topLeft);\n var leftDiff = bottomLeft.minus(topLeft);\n\n return ((point.x - topLeft.x) * topDiff.x +\n (point.y - topLeft.y) * topDiff.y >= -epsilon) &&\n\n ((point.x - topRight.x) * topDiff.x +\n (point.y - topRight.y) * topDiff.y <= epsilon) &&\n\n ((point.x - topLeft.x) * leftDiff.x +\n (point.y - topLeft.y) * leftDiff.y >= -epsilon) &&\n\n ((point.x - bottomLeft.x) * leftDiff.x +\n (point.y - bottomLeft.y) * leftDiff.y <= epsilon);\n },\n\n /**\n * Provides a string representation of the rectangle which is useful for\n * debugging.\n * @function\n * @returns {String} A string representation of the rectangle.\n */\n toString: function() {\n return \"[\" +\n (Math.round(this.x * 100) / 100) + \", \" +\n (Math.round(this.y * 100) / 100) + \", \" +\n (Math.round(this.width * 100) / 100) + \"x\" +\n (Math.round(this.height * 100) / 100) + \", \" +\n (Math.round(this.degrees * 100) / 100) + \"deg\" +\n \"]\";\n }\n};\n\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - ReferenceStrip\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function ( $ ) {\n\n// dictionary from id to private properties\nvar THIS = {};\n\n/**\n * The CollectionDrawer is a reimplementation if the Drawer API that\n * focuses on allowing a viewport to be redefined as a collection\n * of smaller viewports, defined by a clear number of rows and / or\n * columns of which each item in the matrix of viewports has its own\n * source.\n *\n * This idea is a reexpression of the idea of dzi collections\n * which allows a clearer algorithm to reuse the tile sources already\n * supported by OpenSeadragon, in heterogenious or homogenious\n * sequences just like mixed groups already supported by the viewer\n * for the purpose of image sequnces.\n *\n * TODO: The difficult part of this feature is figuring out how to express\n * this functionality as a combination of the functionality already\n * provided by Drawer, Viewport, TileSource, and Navigator. It may\n * require better abstraction at those points in order to efficiently\n * reuse those paradigms.\n */\n/**\n * @class ReferenceStrip\n * @memberof OpenSeadragon\n * @param {Object} options\n */\n$.ReferenceStrip = function ( options ) {\n\n var _this = this,\n viewer = options.viewer,\n viewerSize = $.getElementSize( viewer.element ),\n element,\n style,\n i;\n\n //We may need to create a new element and id if they did not\n //provide the id for the existing element\n if ( !options.id ) {\n options.id = 'referencestrip-' + $.now();\n this.element = $.makeNeutralElement( \"div\" );\n this.element.id = options.id;\n this.element.className = 'referencestrip';\n }\n\n options = $.extend( true, {\n sizeRatio: $.DEFAULT_SETTINGS.referenceStripSizeRatio,\n position: $.DEFAULT_SETTINGS.referenceStripPosition,\n scroll: $.DEFAULT_SETTINGS.referenceStripScroll,\n clickTimeThreshold: $.DEFAULT_SETTINGS.clickTimeThreshold\n }, options, {\n //required overrides\n element: this.element,\n //These need to be overridden to prevent recursion since\n //the navigator is a viewer and a viewer has a navigator\n showNavigator: false,\n mouseNavEnabled: false,\n showNavigationControl: false,\n showSequenceControl: false\n } );\n\n $.extend( this, options );\n //Private state properties\n THIS[this.id] = {\n \"animating\": false\n };\n\n this.minPixelRatio = this.viewer.minPixelRatio;\n\n style = this.element.style;\n style.marginTop = '0px';\n style.marginRight = '0px';\n style.marginBottom = '0px';\n style.marginLeft = '0px';\n style.left = '0px';\n style.bottom = '0px';\n style.border = '0px';\n style.background = '#000';\n style.position = 'relative';\n\n $.setElementTouchActionNone( this.element );\n\n $.setElementOpacity( this.element, 0.8 );\n\n this.viewer = viewer;\n this.innerTracker = new $.MouseTracker( {\n element: this.element,\n dragHandler: $.delegate( this, onStripDrag ),\n scrollHandler: $.delegate( this, onStripScroll ),\n enterHandler: $.delegate( this, onStripEnter ),\n exitHandler: $.delegate( this, onStripExit ),\n keyDownHandler: $.delegate( this, onKeyDown ),\n keyHandler: $.delegate( this, onKeyPress )\n } );\n\n //Controls the position and orientation of the reference strip and sets the\n //appropriate width and height\n if ( options.width && options.height ) {\n this.element.style.width = options.width + 'px';\n this.element.style.height = options.height + 'px';\n viewer.addControl(\n this.element,\n { anchor: $.ControlAnchor.BOTTOM_LEFT }\n );\n } else {\n if ( \"horizontal\" == options.scroll ) {\n this.element.style.width = (\n viewerSize.x *\n options.sizeRatio *\n viewer.tileSources.length\n ) + ( 12 * viewer.tileSources.length ) + 'px';\n\n this.element.style.height = (\n viewerSize.y *\n options.sizeRatio\n ) + 'px';\n\n viewer.addControl(\n this.element,\n { anchor: $.ControlAnchor.BOTTOM_LEFT }\n );\n } else {\n this.element.style.height = (\n viewerSize.y *\n options.sizeRatio *\n viewer.tileSources.length\n ) + ( 12 * viewer.tileSources.length ) + 'px';\n\n this.element.style.width = (\n viewerSize.x *\n options.sizeRatio\n ) + 'px';\n\n viewer.addControl(\n this.element,\n { anchor: $.ControlAnchor.TOP_LEFT }\n );\n\n }\n }\n\n this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 8;\n this.panelHeight = ( viewerSize.y * this.sizeRatio ) + 8;\n this.panels = [];\n this.miniViewers = {};\n\n /*jshint loopfunc:true*/\n for ( i = 0; i < viewer.tileSources.length; i++ ) {\n\n element = $.makeNeutralElement( 'div' );\n element.id = this.element.id + \"-\" + i;\n\n element.style.width = _this.panelWidth + 'px';\n element.style.height = _this.panelHeight + 'px';\n element.style.display = 'inline';\n element.style.float = 'left'; //Webkit\n element.style.cssFloat = 'left'; //Firefox\n element.style.styleFloat = 'left'; //IE\n element.style.padding = '2px';\n $.setElementTouchActionNone( element );\n\n element.innerTracker = new $.MouseTracker( {\n element: element,\n clickTimeThreshold: this.clickTimeThreshold,\n clickDistThreshold: this.clickDistThreshold,\n pressHandler: function ( event ) {\n event.eventSource.dragging = $.now();\n },\n releaseHandler: function ( event ) {\n var tracker = event.eventSource,\n id = tracker.element.id,\n page = Number( id.split( '-' )[2] ),\n now = $.now();\n\n if ( event.insideElementPressed &&\n event.insideElementReleased &&\n tracker.dragging &&\n ( now - tracker.dragging ) < tracker.clickTimeThreshold ) {\n tracker.dragging = null;\n viewer.goToPage( page );\n }\n }\n } );\n\n this.element.appendChild( element );\n\n element.activePanel = false;\n\n this.panels.push( element );\n\n }\n loadPanels( this, this.scroll == 'vertical' ? viewerSize.y : viewerSize.x, 0 );\n this.setFocus( 0 );\n\n};\n\n$.extend( $.ReferenceStrip.prototype, $.EventSource.prototype, $.Viewer.prototype, /** @lends OpenSeadragon.ReferenceStrip.prototype */{\n\n /**\n * @function\n */\n setFocus: function ( page ) {\n var element = $.getElement( this.element.id + '-' + page ),\n viewerSize = $.getElementSize( this.viewer.canvas ),\n scrollWidth = Number( this.element.style.width.replace( 'px', '' ) ),\n scrollHeight = Number( this.element.style.height.replace( 'px', '' ) ),\n offsetLeft = -Number( this.element.style.marginLeft.replace( 'px', '' ) ),\n offsetTop = -Number( this.element.style.marginTop.replace( 'px', '' ) ),\n offset;\n\n if ( this.currentSelected !== element ) {\n if ( this.currentSelected ) {\n this.currentSelected.style.background = '#000';\n }\n this.currentSelected = element;\n this.currentSelected.style.background = '#999';\n\n if ( 'horizontal' == this.scroll ) {\n //right left\n offset = ( Number( page ) ) * ( this.panelWidth + 3 );\n if ( offset > offsetLeft + viewerSize.x - this.panelWidth ) {\n offset = Math.min( offset, ( scrollWidth - viewerSize.x ) );\n this.element.style.marginLeft = -offset + 'px';\n loadPanels( this, viewerSize.x, -offset );\n } else if ( offset < offsetLeft ) {\n offset = Math.max( 0, offset - viewerSize.x / 2 );\n this.element.style.marginLeft = -offset + 'px';\n loadPanels( this, viewerSize.x, -offset );\n }\n } else {\n offset = ( Number( page ) ) * ( this.panelHeight + 3 );\n if ( offset > offsetTop + viewerSize.y - this.panelHeight ) {\n offset = Math.min( offset, ( scrollHeight - viewerSize.y ) );\n this.element.style.marginTop = -offset + 'px';\n loadPanels( this, viewerSize.y, -offset );\n } else if ( offset < offsetTop ) {\n offset = Math.max( 0, offset - viewerSize.y / 2 );\n this.element.style.marginTop = -offset + 'px';\n loadPanels( this, viewerSize.y, -offset );\n }\n }\n\n this.currentPage = page;\n onStripEnter.call( this, { eventSource: this.innerTracker } );\n }\n },\n\n /**\n * @function\n */\n update: function () {\n if ( THIS[this.id].animating ) {\n $.console.log( 'image reference strip update' );\n return true;\n }\n return false;\n },\n\n // Overrides Viewer.destroy\n destroy: function() {\n if (this.miniViewers) {\n for (var key in this.miniViewers) {\n this.miniViewers[key].destroy();\n }\n }\n\n if (this.element) {\n this.element.parentNode.removeChild(this.element);\n }\n }\n\n} );\n\n\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onStripDrag( event ) {\n\n var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),\n offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),\n scrollWidth = Number( this.element.style.width.replace( 'px', '' ) ),\n scrollHeight = Number( this.element.style.height.replace( 'px', '' ) ),\n viewerSize = $.getElementSize( this.viewer.canvas );\n this.dragging = true;\n if ( this.element ) {\n if ( 'horizontal' == this.scroll ) {\n if ( -event.delta.x > 0 ) {\n //forward\n if ( offsetLeft > -( scrollWidth - viewerSize.x ) ) {\n this.element.style.marginLeft = ( offsetLeft + ( event.delta.x * 2 ) ) + 'px';\n loadPanels( this, viewerSize.x, offsetLeft + ( event.delta.x * 2 ) );\n }\n } else if ( -event.delta.x < 0 ) {\n //reverse\n if ( offsetLeft < 0 ) {\n this.element.style.marginLeft = ( offsetLeft + ( event.delta.x * 2 ) ) + 'px';\n loadPanels( this, viewerSize.x, offsetLeft + ( event.delta.x * 2 ) );\n }\n }\n } else {\n if ( -event.delta.y > 0 ) {\n //forward\n if ( offsetTop > -( scrollHeight - viewerSize.y ) ) {\n this.element.style.marginTop = ( offsetTop + ( event.delta.y * 2 ) ) + 'px';\n loadPanels( this, viewerSize.y, offsetTop + ( event.delta.y * 2 ) );\n }\n } else if ( -event.delta.y < 0 ) {\n //reverse\n if ( offsetTop < 0 ) {\n this.element.style.marginTop = ( offsetTop + ( event.delta.y * 2 ) ) + 'px';\n loadPanels( this, viewerSize.y, offsetTop + ( event.delta.y * 2 ) );\n }\n }\n }\n }\n return false;\n\n}\n\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onStripScroll( event ) {\n var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),\n offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),\n scrollWidth = Number( this.element.style.width.replace( 'px', '' ) ),\n scrollHeight = Number( this.element.style.height.replace( 'px', '' ) ),\n viewerSize = $.getElementSize( this.viewer.canvas );\n if ( this.element ) {\n if ( 'horizontal' == this.scroll ) {\n if ( event.scroll > 0 ) {\n //forward\n if ( offsetLeft > -( scrollWidth - viewerSize.x ) ) {\n this.element.style.marginLeft = ( offsetLeft - ( event.scroll * 60 ) ) + 'px';\n loadPanels( this, viewerSize.x, offsetLeft - ( event.scroll * 60 ) );\n }\n } else if ( event.scroll < 0 ) {\n //reverse\n if ( offsetLeft < 0 ) {\n this.element.style.marginLeft = ( offsetLeft - ( event.scroll * 60 ) ) + 'px';\n loadPanels( this, viewerSize.x, offsetLeft - ( event.scroll * 60 ) );\n }\n }\n } else {\n if ( event.scroll < 0 ) {\n //scroll up\n if ( offsetTop > viewerSize.y - scrollHeight ) {\n this.element.style.marginTop = ( offsetTop + ( event.scroll * 60 ) ) + 'px';\n loadPanels( this, viewerSize.y, offsetTop + ( event.scroll * 60 ) );\n }\n } else if ( event.scroll > 0 ) {\n //scroll dowm\n if ( offsetTop < 0 ) {\n this.element.style.marginTop = ( offsetTop + ( event.scroll * 60 ) ) + 'px';\n loadPanels( this, viewerSize.y, offsetTop + ( event.scroll * 60 ) );\n }\n }\n }\n }\n //cancels event\n return false;\n}\n\n\nfunction loadPanels( strip, viewerSize, scroll ) {\n var panelSize,\n activePanelsStart,\n activePanelsEnd,\n miniViewer,\n style,\n i,\n element;\n if ( 'horizontal' == strip.scroll ) {\n panelSize = strip.panelWidth;\n } else {\n panelSize = strip.panelHeight;\n }\n activePanelsStart = Math.ceil( viewerSize / panelSize ) + 5;\n activePanelsEnd = Math.ceil( ( Math.abs( scroll ) + viewerSize ) / panelSize ) + 1;\n activePanelsStart = activePanelsEnd - activePanelsStart;\n activePanelsStart = activePanelsStart < 0 ? 0 : activePanelsStart;\n\n for ( i = activePanelsStart; i < activePanelsEnd && i < strip.panels.length; i++ ) {\n element = strip.panels[i];\n if ( !element.activePanel ) {\n var miniTileSource;\n var originalTileSource = strip.viewer.tileSources[i];\n if (originalTileSource.referenceStripThumbnailUrl) {\n miniTileSource = {\n type: 'image',\n url: originalTileSource.referenceStripThumbnailUrl\n };\n } else {\n miniTileSource = originalTileSource;\n }\n miniViewer = new $.Viewer( {\n id: element.id,\n tileSources: [miniTileSource],\n element: element,\n navigatorSizeRatio: strip.sizeRatio,\n showNavigator: false,\n mouseNavEnabled: false,\n showNavigationControl: false,\n showSequenceControl: false,\n immediateRender: true,\n blendTime: 0,\n animationTime: 0\n } );\n\n miniViewer.displayRegion = $.makeNeutralElement( \"div\" );\n miniViewer.displayRegion.id = element.id + '-displayregion';\n miniViewer.displayRegion.className = 'displayregion';\n\n style = miniViewer.displayRegion.style;\n style.position = 'relative';\n style.top = '0px';\n style.left = '0px';\n style.fontSize = '0px';\n style.overflow = 'hidden';\n style.float = 'left'; //Webkit\n style.cssFloat = 'left'; //Firefox\n style.styleFloat = 'left'; //IE\n style.zIndex = 999999999;\n style.cursor = 'default';\n style.width = ( strip.panelWidth - 4 ) + 'px';\n style.height = ( strip.panelHeight - 4 ) + 'px';\n\n // TODO: What is this for? Future keyboard navigation support?\n miniViewer.displayRegion.innerTracker = new $.MouseTracker( {\n element: miniViewer.displayRegion,\n startDisabled: true\n } );\n\n element.getElementsByTagName( 'div' )[0].appendChild(\n miniViewer.displayRegion\n );\n\n strip.miniViewers[element.id] = miniViewer;\n\n element.activePanel = true;\n }\n }\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onStripEnter( event ) {\n var element = event.eventSource.element;\n\n //$.setElementOpacity(element, 0.8);\n\n //element.style.border = '1px solid #555';\n //element.style.background = '#000';\n\n if ( 'horizontal' == this.scroll ) {\n\n //element.style.paddingTop = \"0px\";\n element.style.marginBottom = \"0px\";\n\n } else {\n\n //element.style.paddingRight = \"0px\";\n element.style.marginLeft = \"0px\";\n\n }\n return false;\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onStripExit( event ) {\n var element = event.eventSource.element;\n\n if ( 'horizontal' == this.scroll ) {\n\n //element.style.paddingTop = \"10px\";\n element.style.marginBottom = \"-\" + ( $.getElementSize( element ).y / 2 ) + \"px\";\n\n } else {\n\n //element.style.paddingRight = \"10px\";\n element.style.marginLeft = \"-\" + ( $.getElementSize( element ).x / 2 ) + \"px\";\n\n }\n return false;\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onKeyDown( event ) {\n //console.log( event.keyCode );\n\n if ( !event.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {\n switch ( event.keyCode ) {\n case 38: //up arrow\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: 1, shift: null } );\n return false;\n case 40: //down arrow\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: -1, shift: null } );\n return false;\n case 37: //left arrow\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: -1, shift: null } );\n return false;\n case 39: //right arrow\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: 1, shift: null } );\n return false;\n default:\n //console.log( 'navigator keycode %s', event.keyCode );\n return true;\n }\n } else {\n return true;\n }\n}\n\n\n/**\n * @private\n * @inner\n * @function\n */\nfunction onKeyPress( event ) {\n //console.log( event.keyCode );\n\n if ( !event.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {\n switch ( event.keyCode ) {\n case 61: //=|+\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: 1, shift: null } );\n return false;\n case 45: //-|_\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: -1, shift: null } );\n return false;\n case 48: //0|)\n case 119: //w\n case 87: //W\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: 1, shift: null } );\n return false;\n case 115: //s\n case 83: //S\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: -1, shift: null } );\n return false;\n case 97: //a\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: -1, shift: null } );\n return false;\n case 100: //d\n onStripScroll.call( this, { eventSource: this.tracker, position: null, scroll: 1, shift: null } );\n return false;\n default:\n //console.log( 'navigator keycode %s', event.keyCode );\n return true;\n }\n } else {\n return true;\n }\n}\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - DisplayRect\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class DisplayRect\n * @classdesc A display rectangle is very similar to {@link OpenSeadragon.Rect} but adds two\n * fields, 'minLevel' and 'maxLevel' which denote the supported zoom levels\n * for this rectangle.\n *\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.Rect\n * @param {Number} x The vector component 'x'.\n * @param {Number} y The vector component 'y'.\n * @param {Number} width The vector component 'height'.\n * @param {Number} height The vector component 'width'.\n * @param {Number} minLevel The lowest zoom level supported.\n * @param {Number} maxLevel The highest zoom level supported.\n */\n$.DisplayRect = function( x, y, width, height, minLevel, maxLevel ) {\n $.Rect.apply( this, [ x, y, width, height ] );\n\n /**\n * The lowest zoom level supported.\n * @member {Number} minLevel\n * @memberof OpenSeadragon.DisplayRect#\n */\n this.minLevel = minLevel;\n /**\n * The highest zoom level supported.\n * @member {Number} maxLevel\n * @memberof OpenSeadragon.DisplayRect#\n */\n this.maxLevel = maxLevel;\n};\n\n$.extend( $.DisplayRect.prototype, $.Rect.prototype );\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Spring\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class Spring\n * @memberof OpenSeadragon\n * @param {Object} options - Spring configuration settings.\n * @param {Number} options.springStiffness - Spring stiffness. Must be greater than zero.\n * The closer to zero, the closer to linear animation.\n * @param {Number} options.animationTime - Animation duration per spring, in seconds.\n * Must be zero or greater.\n * @param {Number} [options.initial=0] - Initial value of spring.\n * @param {Boolean} [options.exponential=false] - Whether this spring represents\n * an exponential scale (such as zoom) and should be animated accordingly. Note that\n * exponential springs must have non-zero values.\n */\n$.Spring = function( options ) {\n var args = arguments;\n\n if( typeof ( options ) != 'object' ){\n //allows backward compatible use of ( initialValue, config ) as\n //constructor parameters\n options = {\n initial: args.length && typeof ( args[ 0 ] ) == \"number\" ?\n args[ 0 ] :\n undefined,\n /**\n * Spring stiffness.\n * @member {Number} springStiffness\n * @memberof OpenSeadragon.Spring#\n */\n springStiffness: args.length > 1 ?\n args[ 1 ].springStiffness :\n 5.0,\n /**\n * Animation duration per spring.\n * @member {Number} animationTime\n * @memberof OpenSeadragon.Spring#\n */\n animationTime: args.length > 1 ?\n args[ 1 ].animationTime :\n 1.5\n };\n }\n\n $.console.assert(typeof options.springStiffness === \"number\" && options.springStiffness !== 0,\n \"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number\");\n\n $.console.assert(typeof options.animationTime === \"number\" && options.animationTime >= 0,\n \"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0\");\n\n if (options.exponential) {\n this._exponential = true;\n delete options.exponential;\n }\n\n $.extend( true, this, options);\n\n /**\n * @member {Object} current\n * @memberof OpenSeadragon.Spring#\n * @property {Number} value\n * @property {Number} time\n */\n this.current = {\n value: typeof ( this.initial ) == \"number\" ?\n this.initial :\n (this._exponential ? 0 : 1),\n time: $.now() // always work in milliseconds\n };\n\n $.console.assert(!this._exponential || this.current.value !== 0,\n \"[OpenSeadragon.Spring] value must be non-zero for exponential springs\");\n\n /**\n * @member {Object} start\n * @memberof OpenSeadragon.Spring#\n * @property {Number} value\n * @property {Number} time\n */\n this.start = {\n value: this.current.value,\n time: this.current.time\n };\n\n /**\n * @member {Object} target\n * @memberof OpenSeadragon.Spring#\n * @property {Number} value\n * @property {Number} time\n */\n this.target = {\n value: this.current.value,\n time: this.current.time\n };\n\n if (this._exponential) {\n this.start._logValue = Math.log(this.start.value);\n this.target._logValue = Math.log(this.target.value);\n this.current._logValue = Math.log(this.current.value);\n }\n};\n\n/** @lends OpenSeadragon.Spring.prototype */\n$.Spring.prototype = {\n\n /**\n * @function\n * @param {Number} target\n */\n resetTo: function( target ) {\n $.console.assert(!this._exponential || target !== 0,\n \"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs\");\n\n this.start.value = this.target.value = this.current.value = target;\n this.start.time = this.target.time = this.current.time = $.now();\n\n if (this._exponential) {\n this.start._logValue = Math.log(this.start.value);\n this.target._logValue = Math.log(this.target.value);\n this.current._logValue = Math.log(this.current.value);\n }\n },\n\n /**\n * @function\n * @param {Number} target\n */\n springTo: function( target ) {\n $.console.assert(!this._exponential || target !== 0,\n \"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs\");\n\n this.start.value = this.current.value;\n this.start.time = this.current.time;\n this.target.value = target;\n this.target.time = this.start.time + 1000 * this.animationTime;\n\n if (this._exponential) {\n this.start._logValue = Math.log(this.start.value);\n this.target._logValue = Math.log(this.target.value);\n }\n },\n\n /**\n * @function\n * @param {Number} delta\n */\n shiftBy: function( delta ) {\n this.start.value += delta;\n this.target.value += delta;\n\n if (this._exponential) {\n $.console.assert(this.target.value !== 0 && this.start.value !== 0,\n \"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs\");\n\n this.start._logValue = Math.log(this.start.value);\n this.target._logValue = Math.log(this.target.value);\n }\n },\n\n setExponential: function(value) {\n this._exponential = value;\n\n if (this._exponential) {\n $.console.assert(this.current.value !== 0 && this.target.value !== 0 && this.start.value !== 0,\n \"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs\");\n\n this.start._logValue = Math.log(this.start.value);\n this.target._logValue = Math.log(this.target.value);\n this.current._logValue = Math.log(this.current.value);\n }\n },\n\n /**\n * @function\n * @returns true if the value got updated, false otherwise\n */\n update: function() {\n this.current.time = $.now();\n\n var startValue, targetValue;\n if (this._exponential) {\n startValue = this.start._logValue;\n targetValue = this.target._logValue;\n } else {\n startValue = this.start.value;\n targetValue = this.target.value;\n }\n\n var currentValue = (this.current.time >= this.target.time) ?\n targetValue :\n startValue +\n ( targetValue - startValue ) *\n transform(\n this.springStiffness,\n ( this.current.time - this.start.time ) /\n ( this.target.time - this.start.time )\n );\n\n var oldValue = this.current.value;\n if (this._exponential) {\n this.current.value = Math.exp(currentValue);\n } else {\n this.current.value = currentValue;\n }\n\n return oldValue != this.current.value;\n },\n\n /**\n * Returns whether the spring is at the target value\n * @function\n * @returns {Boolean} True if at target value, false otherwise\n */\n isAtTargetValue: function() {\n return this.current.value === this.target.value;\n }\n};\n\n/**\n * @private\n */\nfunction transform( stiffness, x ) {\n return ( 1.0 - Math.exp( stiffness * -x ) ) /\n ( 1.0 - Math.exp( -stiffness ) );\n}\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - ImageLoader\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($){\n\n/**\n * @private\n * @class ImageJob\n * @classdesc Handles downloading of a single image.\n * @param {Object} options - Options for this ImageJob.\n * @param {String} [options.src] - URL of image to download.\n * @param {String} [options.loadWithAjax] - Whether to load this image with AJAX.\n * @param {String} [options.ajaxHeaders] - Headers to add to the image request if using AJAX.\n * @param {String} [options.crossOriginPolicy] - CORS policy to use for downloads\n * @param {Function} [options.callback] - Called once image has been downloaded.\n * @param {Function} [options.abort] - Called when this image job is aborted.\n * @param {Number} [options.timeout] - The max number of milliseconds that this image job may take to complete.\n */\nfunction ImageJob (options) {\n\n $.extend(true, this, {\n timeout: $.DEFAULT_SETTINGS.timeout,\n jobId: null\n }, options);\n\n /**\n * Image object which will contain downloaded image.\n * @member {Image} image\n * @memberof OpenSeadragon.ImageJob#\n */\n this.image = null;\n}\n\nImageJob.prototype = {\n errorMsg: null,\n\n /**\n * Starts the image job.\n * @method\n */\n start: function(){\n var self = this;\n var selfAbort = this.abort;\n\n this.image = new Image();\n\n this.image.onload = function(){\n self.finish(true);\n };\n this.image.onabort = this.image.onerror = function() {\n self.errorMsg = \"Image load aborted\";\n self.finish(false);\n };\n\n this.jobId = window.setTimeout(function(){\n self.errorMsg = \"Image load exceeded timeout (\" + self.timeout + \" ms)\";\n self.finish(false);\n }, this.timeout);\n\n // Load the tile with an AJAX request if the loadWithAjax option is\n // set. Otherwise load the image by setting the source proprety of the image object.\n if (this.loadWithAjax) {\n this.request = $.makeAjaxRequest({\n url: this.src,\n withCredentials: this.ajaxWithCredentials,\n headers: this.ajaxHeaders,\n responseType: \"arraybuffer\",\n success: function(request) {\n var blb;\n // Make the raw data into a blob.\n // BlobBuilder fallback adapted from\n // http://stackoverflow.com/questions/15293694/blob-constructor-browser-compatibility\n try {\n blb = new window.Blob([request.response]);\n } catch (e) {\n var BlobBuilder = (\n window.BlobBuilder ||\n window.WebKitBlobBuilder ||\n window.MozBlobBuilder ||\n window.MSBlobBuilder\n );\n if (e.name === 'TypeError' && BlobBuilder) {\n var bb = new BlobBuilder();\n bb.append(request.response);\n blb = bb.getBlob();\n }\n }\n // If the blob is empty for some reason consider the image load a failure.\n if (blb.size === 0) {\n self.errorMsg = \"Empty image response.\";\n self.finish(false);\n }\n // Create a URL for the blob data and make it the source of the image object.\n // This will still trigger Image.onload to indicate a successful tile load.\n var url = (window.URL || window.webkitURL).createObjectURL(blb);\n self.image.src = url;\n },\n error: function(request) {\n self.errorMsg = \"Image load aborted - XHR error\";\n self.finish(false);\n }\n });\n\n // Provide a function to properly abort the request.\n this.abort = function() {\n self.request.abort();\n\n // Call the existing abort function if available\n if (typeof selfAbort === \"function\") {\n selfAbort();\n }\n };\n } else {\n if (this.crossOriginPolicy !== false) {\n this.image.crossOrigin = this.crossOriginPolicy;\n }\n\n this.image.src = this.src;\n }\n },\n\n finish: function(successful) {\n this.image.onload = this.image.onerror = this.image.onabort = null;\n if (!successful) {\n this.image = null;\n }\n\n if (this.jobId) {\n window.clearTimeout(this.jobId);\n }\n\n this.callback(this);\n }\n\n};\n\n/**\n * @class ImageLoader\n * @memberof OpenSeadragon\n * @classdesc Handles downloading of a set of images using asynchronous queue pattern.\n * You generally won't have to interact with the ImageLoader directly.\n * @param {Object} options - Options for this ImageLoader.\n * @param {Number} [options.jobLimit] - The number of concurrent image requests. See imageLoaderLimit in {@link OpenSeadragon.Options} for details.\n * @param {Number} [options.timeout] - The max number of milliseconds that an image job may take to complete.\n */\n$.ImageLoader = function(options) {\n\n $.extend(true, this, {\n jobLimit: $.DEFAULT_SETTINGS.imageLoaderLimit,\n timeout: $.DEFAULT_SETTINGS.timeout,\n jobQueue: [],\n jobsInProgress: 0\n }, options);\n\n};\n\n/** @lends OpenSeadragon.ImageLoader.prototype */\n$.ImageLoader.prototype = {\n\n /**\n * Add an unloaded image to the loader queue.\n * @method\n * @param {Object} options - Options for this job.\n * @param {String} [options.src] - URL of image to download.\n * @param {String} [options.loadWithAjax] - Whether to load this image with AJAX.\n * @param {String} [options.ajaxHeaders] - Headers to add to the image request if using AJAX.\n * @param {String|Boolean} [options.crossOriginPolicy] - CORS policy to use for downloads\n * @param {Boolean} [options.ajaxWithCredentials] - Whether to set withCredentials on AJAX\n * requests.\n * @param {Function} [options.callback] - Called once image has been downloaded.\n * @param {Function} [options.abort] - Called when this image job is aborted.\n */\n addJob: function(options) {\n var _this = this,\n complete = function(job) {\n completeJob(_this, job, options.callback);\n },\n jobOptions = {\n src: options.src,\n loadWithAjax: options.loadWithAjax,\n ajaxHeaders: options.loadWithAjax ? options.ajaxHeaders : null,\n crossOriginPolicy: options.crossOriginPolicy,\n ajaxWithCredentials: options.ajaxWithCredentials,\n callback: complete,\n abort: options.abort,\n timeout: this.timeout\n },\n newJob = new ImageJob(jobOptions);\n\n if ( !this.jobLimit || this.jobsInProgress < this.jobLimit ) {\n newJob.start();\n this.jobsInProgress++;\n }\n else {\n this.jobQueue.push( newJob );\n }\n },\n\n /**\n * Clear any unstarted image loading jobs from the queue.\n * @method\n */\n clear: function() {\n for( var i = 0; i < this.jobQueue.length; i++ ) {\n var job = this.jobQueue[i];\n if ( typeof job.abort === \"function\" ) {\n job.abort();\n }\n }\n\n this.jobQueue = [];\n }\n};\n\n/**\n * Cleans up ImageJob once completed.\n * @method\n * @private\n * @param loader - ImageLoader used to start job.\n * @param job - The ImageJob that has completed.\n * @param callback - Called once cleanup is finished.\n */\nfunction completeJob(loader, job, callback) {\n var nextJob;\n\n loader.jobsInProgress--;\n\n if ((!loader.jobLimit || loader.jobsInProgress < loader.jobLimit) && loader.jobQueue.length > 0) {\n nextJob = loader.jobQueue.shift();\n nextJob.start();\n loader.jobsInProgress++;\n }\n\n callback(job.image, job.errorMsg, job.request);\n}\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - Tile\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class Tile\n * @memberof OpenSeadragon\n * @param {Number} level The zoom level this tile belongs to.\n * @param {Number} x The vector component 'x'.\n * @param {Number} y The vector component 'y'.\n * @param {OpenSeadragon.Rect} bounds Where this tile fits, in normalized\n * coordinates.\n * @param {Boolean} exists Is this tile a part of a sparse image? ( Also has\n * this tile failed to load? )\n * @param {String} url The URL of this tile's image.\n * @param {CanvasRenderingContext2D} context2D The context2D of this tile if it\n * is provided directly by the tile source.\n * @param {Boolean} loadWithAjax Whether this tile image should be loaded with an AJAX request .\n * @param {Object} ajaxHeaders The headers to send with this tile's AJAX request (if applicable).\n * @param {OpenSeadragon.Rect} sourceBounds The portion of the tile to use as the source of the\n * drawing operation, in pixels. Note that this only works when drawing with canvas; when drawing\n * with HTML the entire tile is always used.\n */\n$.Tile = function(level, x, y, bounds, exists, url, context2D, loadWithAjax, ajaxHeaders, sourceBounds) {\n /**\n * The zoom level this tile belongs to.\n * @member {Number} level\n * @memberof OpenSeadragon.Tile#\n */\n this.level = level;\n /**\n * The vector component 'x'.\n * @member {Number} x\n * @memberof OpenSeadragon.Tile#\n */\n this.x = x;\n /**\n * The vector component 'y'.\n * @member {Number} y\n * @memberof OpenSeadragon.Tile#\n */\n this.y = y;\n /**\n * Where this tile fits, in normalized coordinates\n * @member {OpenSeadragon.Rect} bounds\n * @memberof OpenSeadragon.Tile#\n */\n this.bounds = bounds;\n /**\n * The portion of the tile to use as the source of the drawing operation, in pixels. Note that\n * this only works when drawing with canvas; when drawing with HTML the entire tile is always used.\n * @member {OpenSeadragon.Rect} sourceBounds\n * @memberof OpenSeadragon.Tile#\n */\n this.sourceBounds = sourceBounds;\n /**\n * Is this tile a part of a sparse image? Also has this tile failed to load?\n * @member {Boolean} exists\n * @memberof OpenSeadragon.Tile#\n */\n this.exists = exists;\n /**\n * The URL of this tile's image.\n * @member {String} url\n * @memberof OpenSeadragon.Tile#\n */\n this.url = url;\n /**\n * The context2D of this tile if it is provided directly by the tile source.\n * @member {CanvasRenderingContext2D} context2D\n * @memberOf OpenSeadragon.Tile#\n */\n this.context2D = context2D;\n /**\n * Whether to load this tile's image with an AJAX request.\n * @member {Boolean} loadWithAjax\n * @memberof OpenSeadragon.Tile#\n */\n this.loadWithAjax = loadWithAjax;\n /**\n * The headers to be used in requesting this tile's image.\n * Only used if loadWithAjax is set to true.\n * @member {Object} ajaxHeaders\n * @memberof OpenSeadragon.Tile#\n */\n this.ajaxHeaders = ajaxHeaders;\n /**\n * The unique cache key for this tile.\n * @member {String} cacheKey\n * @memberof OpenSeadragon.Tile#\n */\n if (this.ajaxHeaders) {\n this.cacheKey = this.url + \"+\" + JSON.stringify(this.ajaxHeaders);\n } else {\n this.cacheKey = this.url;\n }\n /**\n * Is this tile loaded?\n * @member {Boolean} loaded\n * @memberof OpenSeadragon.Tile#\n */\n this.loaded = false;\n /**\n * Is this tile loading?\n * @member {Boolean} loading\n * @memberof OpenSeadragon.Tile#\n */\n this.loading = false;\n\n /**\n * The HTML div element for this tile\n * @member {Element} element\n * @memberof OpenSeadragon.Tile#\n */\n this.element = null;\n /**\n * The HTML img element for this tile.\n * @member {Element} imgElement\n * @memberof OpenSeadragon.Tile#\n */\n this.imgElement = null;\n /**\n * The Image object for this tile.\n * @member {Object} image\n * @memberof OpenSeadragon.Tile#\n */\n this.image = null;\n\n /**\n * The alias of this.element.style.\n * @member {String} style\n * @memberof OpenSeadragon.Tile#\n */\n this.style = null;\n /**\n * This tile's position on screen, in pixels.\n * @member {OpenSeadragon.Point} position\n * @memberof OpenSeadragon.Tile#\n */\n this.position = null;\n /**\n * This tile's size on screen, in pixels.\n * @member {OpenSeadragon.Point} size\n * @memberof OpenSeadragon.Tile#\n */\n this.size = null;\n /**\n * The start time of this tile's blending.\n * @member {Number} blendStart\n * @memberof OpenSeadragon.Tile#\n */\n this.blendStart = null;\n /**\n * The current opacity this tile should be.\n * @member {Number} opacity\n * @memberof OpenSeadragon.Tile#\n */\n this.opacity = null;\n /**\n * The squared distance of this tile to the viewport center.\n * Use for comparing tiles.\n * @private\n * @member {Number} squaredDistance\n * @memberof OpenSeadragon.Tile#\n */\n this.squaredDistance = null;\n /**\n * The visibility score of this tile.\n * @member {Number} visibility\n * @memberof OpenSeadragon.Tile#\n */\n this.visibility = null;\n\n /**\n * Whether this tile is currently being drawn.\n * @member {Boolean} beingDrawn\n * @memberof OpenSeadragon.Tile#\n */\n this.beingDrawn = false;\n\n /**\n * Timestamp the tile was last touched.\n * @member {Number} lastTouchTime\n * @memberof OpenSeadragon.Tile#\n */\n this.lastTouchTime = 0;\n\n /**\n * Whether this tile is in the right-most column for its level.\n * @member {Boolean} isRightMost\n * @memberof OpenSeadragon.Tile#\n */\n this.isRightMost = false;\n\n /**\n * Whether this tile is in the bottom-most row for its level.\n * @member {Boolean} isBottomMost\n * @memberof OpenSeadragon.Tile#\n */\n this.isBottomMost = false;\n};\n\n/** @lends OpenSeadragon.Tile.prototype */\n$.Tile.prototype = {\n\n /**\n * Provides a string representation of this tiles level and (x,y)\n * components.\n * @function\n * @returns {String}\n */\n toString: function() {\n return this.level + \"/\" + this.x + \"_\" + this.y;\n },\n\n // private\n _hasTransparencyChannel: function() {\n return !!this.context2D || this.url.match('.png');\n },\n\n /**\n * Renders the tile in an html container.\n * @function\n * @param {Element} container\n */\n drawHTML: function( container ) {\n if (!this.cacheImageRecord) {\n $.console.warn(\n '[Tile.drawHTML] attempting to draw tile %s when it\\'s not cached',\n this.toString());\n return;\n }\n\n if ( !this.loaded ) {\n $.console.warn(\n \"Attempting to draw tile %s when it's not yet loaded.\",\n this.toString()\n );\n return;\n }\n\n //EXPERIMENTAL - trying to figure out how to scale the container\n // content during animation of the container size.\n\n if ( !this.element ) {\n this.element = $.makeNeutralElement( \"div\" );\n this.imgElement = this.cacheImageRecord.getImage().cloneNode();\n this.imgElement.style.msInterpolationMode = \"nearest-neighbor\";\n this.imgElement.style.width = \"100%\";\n this.imgElement.style.height = \"100%\";\n\n this.style = this.element.style;\n this.style.position = \"absolute\";\n }\n if ( this.element.parentNode != container ) {\n container.appendChild( this.element );\n }\n if ( this.imgElement.parentNode != this.element ) {\n this.element.appendChild( this.imgElement );\n }\n\n this.style.top = this.position.y + \"px\";\n this.style.left = this.position.x + \"px\";\n this.style.height = this.size.y + \"px\";\n this.style.width = this.size.x + \"px\";\n\n $.setElementOpacity( this.element, this.opacity );\n },\n\n /**\n * Renders the tile in a canvas-based context.\n * @function\n * @param {Canvas} context\n * @param {Function} drawingHandler - Method for firing the drawing event.\n * drawingHandler({context, tile, rendered})\n * where <code>rendered</code> is the context with the pre-drawn image.\n * @param {Number} [scale=1] - Apply a scale to position and size\n * @param {OpenSeadragon.Point} [translate] - A translation vector\n */\n drawCanvas: function( context, drawingHandler, scale, translate ) {\n\n var position = this.position.times($.pixelDensityRatio),\n size = this.size.times($.pixelDensityRatio),\n rendered;\n\n if (!this.context2D && !this.cacheImageRecord) {\n $.console.warn(\n '[Tile.drawCanvas] attempting to draw tile %s when it\\'s not cached',\n this.toString());\n return;\n }\n\n rendered = this.context2D || this.cacheImageRecord.getRenderedContext();\n\n if ( !this.loaded || !rendered ){\n $.console.warn(\n \"Attempting to draw tile %s when it's not yet loaded.\",\n this.toString()\n );\n\n return;\n }\n\n context.save();\n\n context.globalAlpha = this.opacity;\n\n if (typeof scale === 'number' && scale !== 1) {\n // draw tile at a different scale\n position = position.times(scale);\n size = size.times(scale);\n }\n\n if (translate instanceof $.Point) {\n // shift tile position slightly\n position = position.plus(translate);\n }\n\n //if we are supposed to be rendering fully opaque rectangle,\n //ie its done fading or fading is turned off, and if we are drawing\n //an image with an alpha channel, then the only way\n //to avoid seeing the tile underneath is to clear the rectangle\n if (context.globalAlpha === 1 && this._hasTransparencyChannel()) {\n //clearing only the inside of the rectangle occupied\n //by the png prevents edge flikering\n context.clearRect(\n position.x,\n position.y,\n size.x,\n size.y\n );\n }\n\n // This gives the application a chance to make image manipulation\n // changes as we are rendering the image\n drawingHandler({context: context, tile: this, rendered: rendered});\n\n var sourceWidth, sourceHeight;\n if (this.sourceBounds) {\n sourceWidth = Math.min(this.sourceBounds.width, rendered.canvas.width);\n sourceHeight = Math.min(this.sourceBounds.height, rendered.canvas.height);\n } else {\n sourceWidth = rendered.canvas.width;\n sourceHeight = rendered.canvas.height;\n }\n\n context.drawImage(\n rendered.canvas,\n 0,\n 0,\n sourceWidth,\n sourceHeight,\n position.x,\n position.y,\n size.x,\n size.y\n );\n\n context.restore();\n },\n\n /**\n * Get the ratio between current and original size.\n * @function\n * @return {Float}\n */\n getScaleForEdgeSmoothing: function() {\n var context;\n if (this.cacheImageRecord) {\n context = this.cacheImageRecord.getRenderedContext();\n } else if (this.context2D) {\n context = this.context2D;\n } else {\n $.console.warn(\n '[Tile.drawCanvas] attempting to get tile scale %s when tile\\'s not cached',\n this.toString());\n return 1;\n }\n return context.canvas.width / (this.size.x * $.pixelDensityRatio);\n },\n\n /**\n * Get a translation vector that when applied to the tile position produces integer coordinates.\n * Needed to avoid swimming and twitching.\n * @function\n * @param {Number} [scale=1] - Scale to be applied to position.\n * @return {OpenSeadragon.Point}\n */\n getTranslationForEdgeSmoothing: function(scale, canvasSize, sketchCanvasSize) {\n // The translation vector must have positive values, otherwise the image goes a bit off\n // the sketch canvas to the top and left and we must use negative coordinates to repaint it\n // to the main canvas. In that case, some browsers throw:\n // INDEX_SIZE_ERR: DOM Exception 1: Index or size was negative, or greater than the allowed value.\n var x = Math.max(1, Math.ceil((sketchCanvasSize.x - canvasSize.x) / 2));\n var y = Math.max(1, Math.ceil((sketchCanvasSize.y - canvasSize.y) / 2));\n return new $.Point(x, y).minus(\n this.position\n .times($.pixelDensityRatio)\n .times(scale || 1)\n .apply(function(x) {\n return x % 1;\n })\n );\n },\n\n /**\n * Removes tile from its container.\n * @function\n */\n unload: function() {\n if ( this.imgElement && this.imgElement.parentNode ) {\n this.imgElement.parentNode.removeChild( this.imgElement );\n }\n if ( this.element && this.element.parentNode ) {\n this.element.parentNode.removeChild( this.element );\n }\n\n this.element = null;\n this.imgElement = null;\n this.loaded = false;\n this.loading = false;\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Overlay\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function($) {\n\n /**\n * An enumeration of positions that an overlay may be assigned relative to\n * the viewport.\n * It is identical to OpenSeadragon.Placement but is kept for backward\n * compatibility.\n * @member OverlayPlacement\n * @memberof OpenSeadragon\n * @see OpenSeadragon.Placement\n * @static\n * @readonly\n * @type {Object}\n * @property {Number} CENTER\n * @property {Number} TOP_LEFT\n * @property {Number} TOP\n * @property {Number} TOP_RIGHT\n * @property {Number} RIGHT\n * @property {Number} BOTTOM_RIGHT\n * @property {Number} BOTTOM\n * @property {Number} BOTTOM_LEFT\n * @property {Number} LEFT\n */\n $.OverlayPlacement = $.Placement;\n\n /**\n * An enumeration of possible ways to handle overlays rotation\n * @member OverlayRotationMode\n * @memberOf OpenSeadragon\n * @static\n * @readonly\n * @property {Number} NO_ROTATION The overlay ignore the viewport rotation.\n * @property {Number} EXACT The overlay use CSS 3 transforms to rotate with\n * the viewport. If the overlay contains text, it will get rotated as well.\n * @property {Number} BOUNDING_BOX The overlay adjusts for rotation by\n * taking the size of the bounding box of the rotated bounds.\n * Only valid for overlays with Rect location and scalable in both directions.\n */\n $.OverlayRotationMode = $.freezeObject({\n NO_ROTATION: 1,\n EXACT: 2,\n BOUNDING_BOX: 3\n });\n\n /**\n * @class Overlay\n * @classdesc Provides a way to float an HTML element on top of the viewer element.\n *\n * @memberof OpenSeadragon\n * @param {Object} options\n * @param {Element} options.element\n * @param {OpenSeadragon.Point|OpenSeadragon.Rect} options.location - The\n * location of the overlay on the image. If a {@link OpenSeadragon.Point}\n * is specified, the overlay will be located at this location with respect\n * to the placement option. If a {@link OpenSeadragon.Rect} is specified,\n * the overlay will be placed at this location with the corresponding width\n * and height and placement TOP_LEFT.\n * @param {OpenSeadragon.Placement} [options.placement=OpenSeadragon.Placement.TOP_LEFT]\n * Defines what part of the overlay should be at the specified options.location\n * @param {OpenSeadragon.Overlay.OnDrawCallback} [options.onDraw]\n * @param {Boolean} [options.checkResize=true] Set to false to avoid to\n * check the size of the overlay every time it is drawn in the directions\n * which are not scaled. It will improve performances but will cause a\n * misalignment if the overlay size changes.\n * @param {Number} [options.width] The width of the overlay in viewport\n * coordinates. If specified, the width of the overlay will be adjusted when\n * the zoom changes.\n * @param {Number} [options.height] The height of the overlay in viewport\n * coordinates. If specified, the height of the overlay will be adjusted when\n * the zoom changes.\n * @param {Boolean} [options.rotationMode=OpenSeadragon.OverlayRotationMode.EXACT]\n * How to handle the rotation of the viewport.\n */\n $.Overlay = function(element, location, placement) {\n\n /**\n * onDraw callback signature used by {@link OpenSeadragon.Overlay}.\n *\n * @callback OnDrawCallback\n * @memberof OpenSeadragon.Overlay\n * @param {OpenSeadragon.Point} position\n * @param {OpenSeadragon.Point} size\n * @param {Element} element\n */\n\n var options;\n if ($.isPlainObject(element)) {\n options = element;\n } else {\n options = {\n element: element,\n location: location,\n placement: placement\n };\n }\n\n this.element = options.element;\n this.style = options.element.style;\n this._init(options);\n };\n\n /** @lends OpenSeadragon.Overlay.prototype */\n $.Overlay.prototype = {\n\n // private\n _init: function(options) {\n this.location = options.location;\n this.placement = options.placement === undefined ?\n $.Placement.TOP_LEFT : options.placement;\n this.onDraw = options.onDraw;\n this.checkResize = options.checkResize === undefined ?\n true : options.checkResize;\n\n // When this.width is not null, the overlay get scaled horizontally\n this.width = options.width === undefined ? null : options.width;\n\n // When this.height is not null, the overlay get scaled vertically\n this.height = options.height === undefined ? null : options.height;\n\n this.rotationMode = options.rotationMode || $.OverlayRotationMode.EXACT;\n\n // Having a rect as location is a syntactic sugar\n if (this.location instanceof $.Rect) {\n this.width = this.location.width;\n this.height = this.location.height;\n this.location = this.location.getTopLeft();\n this.placement = $.Placement.TOP_LEFT;\n }\n\n // Deprecated properties kept for backward compatibility.\n this.scales = this.width !== null && this.height !== null;\n this.bounds = new $.Rect(\n this.location.x, this.location.y, this.width, this.height);\n this.position = this.location;\n },\n\n /**\n * Internal function to adjust the position of an overlay\n * depending on it size and placement.\n * @function\n * @param {OpenSeadragon.Point} position\n * @param {OpenSeadragon.Point} size\n */\n adjust: function(position, size) {\n var properties = $.Placement.properties[this.placement];\n if (!properties) {\n return;\n }\n if (properties.isHorizontallyCentered) {\n position.x -= size.x / 2;\n } else if (properties.isRight) {\n position.x -= size.x;\n }\n if (properties.isVerticallyCentered) {\n position.y -= size.y / 2;\n } else if (properties.isBottom) {\n position.y -= size.y;\n }\n },\n\n /**\n * @function\n */\n destroy: function() {\n var element = this.element;\n var style = this.style;\n\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n //this should allow us to preserve overlays when required between\n //pages\n if (element.prevElementParent) {\n style.display = 'none';\n //element.prevElementParent.insertBefore(\n // element,\n // element.prevNextSibling\n //);\n document.body.appendChild(element);\n }\n }\n\n // clear the onDraw callback\n this.onDraw = null;\n\n style.top = \"\";\n style.left = \"\";\n style.position = \"\";\n\n if (this.width !== null) {\n style.width = \"\";\n }\n if (this.height !== null) {\n style.height = \"\";\n }\n var transformOriginProp = $.getCssPropertyWithVendorPrefix(\n 'transformOrigin');\n var transformProp = $.getCssPropertyWithVendorPrefix(\n 'transform');\n if (transformOriginProp && transformProp) {\n style[transformOriginProp] = \"\";\n style[transformProp] = \"\";\n }\n },\n\n /**\n * @function\n * @param {Element} container\n */\n drawHTML: function(container, viewport) {\n var element = this.element;\n if (element.parentNode !== container) {\n //save the source parent for later if we need it\n element.prevElementParent = element.parentNode;\n element.prevNextSibling = element.nextSibling;\n container.appendChild(element);\n\n // have to set position before calculating size, fix #1116\n this.style.position = \"absolute\";\n // this.size is used by overlays which don't get scaled in at\n // least one direction when this.checkResize is set to false.\n this.size = $.getElementSize(element);\n }\n\n var positionAndSize = this._getOverlayPositionAndSize(viewport);\n\n var position = positionAndSize.position;\n var size = this.size = positionAndSize.size;\n var rotate = positionAndSize.rotate;\n\n // call the onDraw callback if it exists to allow one to overwrite\n // the drawing/positioning/sizing of the overlay\n if (this.onDraw) {\n this.onDraw(position, size, this.element);\n } else {\n var style = this.style;\n style.left = position.x + \"px\";\n style.top = position.y + \"px\";\n if (this.width !== null) {\n style.width = size.x + \"px\";\n }\n if (this.height !== null) {\n style.height = size.y + \"px\";\n }\n var transformOriginProp = $.getCssPropertyWithVendorPrefix(\n 'transformOrigin');\n var transformProp = $.getCssPropertyWithVendorPrefix(\n 'transform');\n if (transformOriginProp && transformProp) {\n if (rotate) {\n style[transformOriginProp] = this._getTransformOrigin();\n style[transformProp] = \"rotate(\" + rotate + \"deg)\";\n } else {\n style[transformOriginProp] = \"\";\n style[transformProp] = \"\";\n }\n }\n\n if (style.display !== 'none') {\n style.display = 'block';\n }\n }\n },\n\n // private\n _getOverlayPositionAndSize: function(viewport) {\n var position = viewport.pixelFromPoint(this.location, true);\n var size = this._getSizeInPixels(viewport);\n this.adjust(position, size);\n\n var rotate = 0;\n if (viewport.degrees &&\n this.rotationMode !== $.OverlayRotationMode.NO_ROTATION) {\n // BOUNDING_BOX is only valid if both directions get scaled.\n // Get replaced by EXACT otherwise.\n if (this.rotationMode === $.OverlayRotationMode.BOUNDING_BOX &&\n this.width !== null && this.height !== null) {\n var rect = new $.Rect(position.x, position.y, size.x, size.y);\n var boundingBox = this._getBoundingBox(rect, viewport.degrees);\n position = boundingBox.getTopLeft();\n size = boundingBox.getSize();\n } else {\n rotate = viewport.degrees;\n }\n }\n\n return {\n position: position,\n size: size,\n rotate: rotate\n };\n },\n\n // private\n _getSizeInPixels: function(viewport) {\n var width = this.size.x;\n var height = this.size.y;\n if (this.width !== null || this.height !== null) {\n var scaledSize = viewport.deltaPixelsFromPointsNoRotate(\n new $.Point(this.width || 0, this.height || 0), true);\n if (this.width !== null) {\n width = scaledSize.x;\n }\n if (this.height !== null) {\n height = scaledSize.y;\n }\n }\n if (this.checkResize &&\n (this.width === null || this.height === null)) {\n var eltSize = this.size = $.getElementSize(this.element);\n if (this.width === null) {\n width = eltSize.x;\n }\n if (this.height === null) {\n height = eltSize.y;\n }\n }\n return new $.Point(width, height);\n },\n\n // private\n _getBoundingBox: function(rect, degrees) {\n var refPoint = this._getPlacementPoint(rect);\n return rect.rotate(degrees, refPoint).getBoundingBox();\n },\n\n // private\n _getPlacementPoint: function(rect) {\n var result = new $.Point(rect.x, rect.y);\n var properties = $.Placement.properties[this.placement];\n if (properties) {\n if (properties.isHorizontallyCentered) {\n result.x += rect.width / 2;\n } else if (properties.isRight) {\n result.x += rect.width;\n }\n if (properties.isVerticallyCentered) {\n result.y += rect.height / 2;\n } else if (properties.isBottom) {\n result.y += rect.height;\n }\n }\n return result;\n },\n\n // private\n _getTransformOrigin: function() {\n var result = \"\";\n var properties = $.Placement.properties[this.placement];\n if (!properties) {\n return result;\n }\n if (properties.isLeft) {\n result = \"left\";\n } else if (properties.isRight) {\n result = \"right\";\n }\n if (properties.isTop) {\n result += \" top\";\n } else if (properties.isBottom) {\n result += \" bottom\";\n }\n return result;\n },\n\n /**\n * Changes the overlay settings.\n * @function\n * @param {OpenSeadragon.Point|OpenSeadragon.Rect|Object} location\n * If an object is specified, the options are the same than the constructor\n * except for the element which can not be changed.\n * @param {OpenSeadragon.Placement} placement\n */\n update: function(location, placement) {\n var options = $.isPlainObject(location) ? location : {\n location: location,\n placement: placement\n };\n this._init({\n location: options.location || this.location,\n placement: options.placement !== undefined ?\n options.placement : this.placement,\n onDraw: options.onDraw || this.onDraw,\n checkResize: options.checkResize || this.checkResize,\n width: options.width !== undefined ? options.width : this.width,\n height: options.height !== undefined ? options.height : this.height,\n rotationMode: options.rotationMode || this.rotationMode\n });\n },\n\n /**\n * Returns the current bounds of the overlay in viewport coordinates\n * @function\n * @param {OpenSeadragon.Viewport} viewport the viewport\n * @returns {OpenSeadragon.Rect} overlay bounds\n */\n getBounds: function(viewport) {\n $.console.assert(viewport,\n 'A viewport must now be passed to Overlay.getBounds.');\n var width = this.width;\n var height = this.height;\n if (width === null || height === null) {\n var size = viewport.deltaPointsFromPixelsNoRotate(this.size, true);\n if (width === null) {\n width = size.x;\n }\n if (height === null) {\n height = size.y;\n }\n }\n var location = this.location.clone();\n this.adjust(location, new $.Point(width, height));\n return this._adjustBoundsForRotation(\n viewport, new $.Rect(location.x, location.y, width, height));\n },\n\n // private\n _adjustBoundsForRotation: function(viewport, bounds) {\n if (!viewport ||\n viewport.degrees === 0 ||\n this.rotationMode === $.OverlayRotationMode.EXACT) {\n return bounds;\n }\n if (this.rotationMode === $.OverlayRotationMode.BOUNDING_BOX) {\n // If overlay not fully scalable, BOUNDING_BOX falls back to EXACT\n if (this.width === null || this.height === null) {\n return bounds;\n }\n // It is easier to just compute the position and size and\n // convert to viewport coordinates.\n var positionAndSize = this._getOverlayPositionAndSize(viewport);\n return viewport.viewerElementToViewportRectangle(new $.Rect(\n positionAndSize.position.x,\n positionAndSize.position.y,\n positionAndSize.size.x,\n positionAndSize.size.y));\n }\n\n // NO_ROTATION case\n return bounds.rotate(-viewport.degrees,\n this._getPlacementPoint(bounds));\n }\n };\n\n}(OpenSeadragon));\n\n/*\n * OpenSeadragon - Drawer\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class Drawer\n * @memberof OpenSeadragon\n * @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.\n * @param {Object} options - Options for this Drawer.\n * @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this Drawer.\n * @param {OpenSeadragon.Viewport} options.viewport - Reference to Viewer viewport.\n * @param {Element} options.element - Parent element.\n * @param {Number} [options.debugGridColor] - See debugGridColor in {@link OpenSeadragon.Options} for details.\n */\n$.Drawer = function( options ) {\n\n $.console.assert( options.viewer, \"[Drawer] options.viewer is required\" );\n\n //backward compatibility for positional args while preferring more\n //idiomatic javascript options object as the only argument\n var args = arguments;\n\n if( !$.isPlainObject( options ) ){\n options = {\n source: args[ 0 ], // Reference to Viewer tile source.\n viewport: args[ 1 ], // Reference to Viewer viewport.\n element: args[ 2 ] // Parent element.\n };\n }\n\n $.console.assert( options.viewport, \"[Drawer] options.viewport is required\" );\n $.console.assert( options.element, \"[Drawer] options.element is required\" );\n\n if ( options.source ) {\n $.console.error( \"[Drawer] options.source is no longer accepted; use TiledImage instead\" );\n }\n\n this.viewer = options.viewer;\n this.viewport = options.viewport;\n this.debugGridColor = typeof options.debugGridColor === 'string' ? [options.debugGridColor] : options.debugGridColor || $.DEFAULT_SETTINGS.debugGridColor;\n if (options.opacity) {\n $.console.error( \"[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead\" );\n }\n\n this.useCanvas = $.supportsCanvas && ( this.viewer ? this.viewer.useCanvas : true );\n /**\n * The parent element of this Drawer instance, passed in when the Drawer was created.\n * The parent of {@link OpenSeadragon.Drawer#canvas}.\n * @member {Element} container\n * @memberof OpenSeadragon.Drawer#\n */\n this.container = $.getElement( options.element );\n /**\n * A &lt;canvas&gt; element if the browser supports them, otherwise a &lt;div&gt; element.\n * Child element of {@link OpenSeadragon.Drawer#container}.\n * @member {Element} canvas\n * @memberof OpenSeadragon.Drawer#\n */\n this.canvas = $.makeNeutralElement( this.useCanvas ? \"canvas\" : \"div\" );\n /**\n * 2d drawing context for {@link OpenSeadragon.Drawer#canvas} if it's a &lt;canvas&gt; element, otherwise null.\n * @member {Object} context\n * @memberof OpenSeadragon.Drawer#\n */\n this.context = this.useCanvas ? this.canvas.getContext( \"2d\" ) : null;\n\n /**\n * Sketch canvas used to temporarily draw tiles which cannot be drawn directly\n * to the main canvas due to opacity. Lazily initialized.\n */\n this.sketchCanvas = null;\n this.sketchContext = null;\n\n /**\n * @member {Element} element\n * @memberof OpenSeadragon.Drawer#\n * @deprecated Alias for {@link OpenSeadragon.Drawer#container}.\n */\n this.element = this.container;\n\n // We force our container to ltr because our drawing math doesn't work in rtl.\n // This issue only affects our canvas renderer, but we do it always for consistency.\n // Note that this means overlays you want to be rtl need to be explicitly set to rtl.\n this.container.dir = 'ltr';\n\n // check canvas available width and height, set canvas width and height such that the canvas backing store is set to the proper pixel density\n if (this.useCanvas) {\n var viewportSize = this._calculateCanvasSize();\n this.canvas.width = viewportSize.x;\n this.canvas.height = viewportSize.y;\n }\n\n this.canvas.style.width = \"100%\";\n this.canvas.style.height = \"100%\";\n this.canvas.style.position = \"absolute\";\n $.setElementOpacity( this.canvas, this.opacity, true );\n\n // explicit left-align\n this.container.style.textAlign = \"left\";\n this.container.appendChild( this.canvas );\n\n // Image smoothing for canvas rendering (only if canvas is used).\n // Canvas default is \"true\", so this will only be changed if user specified \"false\".\n this._imageSmoothingEnabled = true;\n};\n\n/** @lends OpenSeadragon.Drawer.prototype */\n$.Drawer.prototype = {\n // deprecated\n addOverlay: function( element, location, placement, onDraw ) {\n $.console.error(\"drawer.addOverlay is deprecated. Use viewer.addOverlay instead.\");\n this.viewer.addOverlay( element, location, placement, onDraw );\n return this;\n },\n\n // deprecated\n updateOverlay: function( element, location, placement ) {\n $.console.error(\"drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead.\");\n this.viewer.updateOverlay( element, location, placement );\n return this;\n },\n\n // deprecated\n removeOverlay: function( element ) {\n $.console.error(\"drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead.\");\n this.viewer.removeOverlay( element );\n return this;\n },\n\n // deprecated\n clearOverlays: function() {\n $.console.error(\"drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead.\");\n this.viewer.clearOverlays();\n return this;\n },\n\n /**\n * Set the opacity of the drawer.\n * @param {Number} opacity\n * @return {OpenSeadragon.Drawer} Chainable.\n */\n setOpacity: function( opacity ) {\n $.console.error(\"drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.\");\n var world = this.viewer.world;\n for (var i = 0; i < world.getItemCount(); i++) {\n world.getItemAt( i ).setOpacity( opacity );\n }\n return this;\n },\n\n /**\n * Get the opacity of the drawer.\n * @returns {Number}\n */\n getOpacity: function() {\n $.console.error(\"drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.\");\n var world = this.viewer.world;\n var maxOpacity = 0;\n for (var i = 0; i < world.getItemCount(); i++) {\n var opacity = world.getItemAt( i ).getOpacity();\n if ( opacity > maxOpacity ) {\n maxOpacity = opacity;\n }\n }\n return maxOpacity;\n },\n\n // deprecated\n needsUpdate: function() {\n $.console.error( \"[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead.\" );\n return this.viewer.world.needsDraw();\n },\n\n // deprecated\n numTilesLoaded: function() {\n $.console.error( \"[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead.\" );\n return this.viewer.tileCache.numTilesLoaded();\n },\n\n // deprecated\n reset: function() {\n $.console.error( \"[Drawer.reset] this function is deprecated. Use World.resetItems instead.\" );\n this.viewer.world.resetItems();\n return this;\n },\n\n // deprecated\n update: function() {\n $.console.error( \"[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead.\" );\n this.clear();\n this.viewer.world.draw();\n return this;\n },\n\n /**\n * @return {Boolean} True if rotation is supported.\n */\n canRotate: function() {\n return this.useCanvas;\n },\n\n /**\n * Destroy the drawer (unload current loaded tiles)\n */\n destroy: function() {\n //force unloading of current canvas (1x1 will be gc later, trick not necessarily needed)\n this.canvas.width = 1;\n this.canvas.height = 1;\n this.sketchCanvas = null;\n this.sketchContext = null;\n },\n\n /**\n * Clears the Drawer so it's ready to draw another frame.\n */\n clear: function() {\n this.canvas.innerHTML = \"\";\n if ( this.useCanvas ) {\n var viewportSize = this._calculateCanvasSize();\n if( this.canvas.width != viewportSize.x ||\n this.canvas.height != viewportSize.y ) {\n this.canvas.width = viewportSize.x;\n this.canvas.height = viewportSize.y;\n this._updateImageSmoothingEnabled(this.context);\n if ( this.sketchCanvas !== null ) {\n var sketchCanvasSize = this._calculateSketchCanvasSize();\n this.sketchCanvas.width = sketchCanvasSize.x;\n this.sketchCanvas.height = sketchCanvasSize.y;\n this._updateImageSmoothingEnabled(this.sketchContext);\n }\n }\n this._clear();\n }\n },\n\n _clear: function (useSketch, bounds) {\n if (!this.useCanvas) {\n return;\n }\n var context = this._getContext(useSketch);\n if (bounds) {\n context.clearRect(bounds.x, bounds.y, bounds.width, bounds.height);\n } else {\n var canvas = context.canvas;\n context.clearRect(0, 0, canvas.width, canvas.height);\n }\n },\n\n /**\n * Scale from OpenSeadragon viewer rectangle to drawer rectangle\n * (ignoring rotation)\n * @param {OpenSeadragon.Rect} rectangle - The rectangle in viewport coordinate system.\n * @return {OpenSeadragon.Rect} Rectangle in drawer coordinate system.\n */\n viewportToDrawerRectangle: function(rectangle) {\n var topLeft = this.viewport.pixelFromPointNoRotate(rectangle.getTopLeft(), true);\n var size = this.viewport.deltaPixelsFromPointsNoRotate(rectangle.getSize(), true);\n\n return new $.Rect(\n topLeft.x * $.pixelDensityRatio,\n topLeft.y * $.pixelDensityRatio,\n size.x * $.pixelDensityRatio,\n size.y * $.pixelDensityRatio\n );\n },\n\n /**\n * Draws the given tile.\n * @param {OpenSeadragon.Tile} tile - The tile to draw.\n * @param {Function} drawingHandler - Method for firing the drawing event if using canvas.\n * drawingHandler({context, tile, rendered})\n * @param {Boolean} useSketch - Whether to use the sketch canvas or not.\n * where <code>rendered</code> is the context with the pre-drawn image.\n * @param {Float} [scale=1] - Apply a scale to tile position and size. Defaults to 1.\n * @param {OpenSeadragon.Point} [translate] A translation vector to offset tile position\n */\n drawTile: function(tile, drawingHandler, useSketch, scale, translate) {\n $.console.assert(tile, '[Drawer.drawTile] tile is required');\n $.console.assert(drawingHandler, '[Drawer.drawTile] drawingHandler is required');\n\n if (this.useCanvas) {\n var context = this._getContext(useSketch);\n scale = scale || 1;\n tile.drawCanvas(context, drawingHandler, scale, translate);\n } else {\n tile.drawHTML( this.canvas );\n }\n },\n\n _getContext: function( useSketch ) {\n var context = this.context;\n if ( useSketch ) {\n if (this.sketchCanvas === null) {\n this.sketchCanvas = document.createElement( \"canvas\" );\n var sketchCanvasSize = this._calculateSketchCanvasSize();\n this.sketchCanvas.width = sketchCanvasSize.x;\n this.sketchCanvas.height = sketchCanvasSize.y;\n this.sketchContext = this.sketchCanvas.getContext( \"2d\" );\n\n // If the viewport is not currently rotated, the sketchCanvas\n // will have the same size as the main canvas. However, if\n // the viewport get rotated later on, we will need to resize it.\n if (this.viewport.getRotation() === 0) {\n var self = this;\n this.viewer.addHandler('rotate', function resizeSketchCanvas() {\n if (self.viewport.getRotation() === 0) {\n return;\n }\n self.viewer.removeHandler('rotate', resizeSketchCanvas);\n var sketchCanvasSize = self._calculateSketchCanvasSize();\n self.sketchCanvas.width = sketchCanvasSize.x;\n self.sketchCanvas.height = sketchCanvasSize.y;\n });\n }\n this._updateImageSmoothingEnabled(this.sketchContext);\n }\n context = this.sketchContext;\n }\n return context;\n },\n\n // private\n saveContext: function( useSketch ) {\n if (!this.useCanvas) {\n return;\n }\n\n this._getContext( useSketch ).save();\n },\n\n // private\n restoreContext: function( useSketch ) {\n if (!this.useCanvas) {\n return;\n }\n\n this._getContext( useSketch ).restore();\n },\n\n // private\n setClip: function(rect, useSketch) {\n if (!this.useCanvas) {\n return;\n }\n\n var context = this._getContext( useSketch );\n context.beginPath();\n context.rect(rect.x, rect.y, rect.width, rect.height);\n context.clip();\n },\n\n // private\n drawRectangle: function(rect, fillStyle, useSketch) {\n if (!this.useCanvas) {\n return;\n }\n\n var context = this._getContext( useSketch );\n context.save();\n context.fillStyle = fillStyle;\n context.fillRect(rect.x, rect.y, rect.width, rect.height);\n context.restore();\n },\n\n /**\n * Blends the sketch canvas in the main canvas.\n * @param {Object} options The options\n * @param {Float} options.opacity The opacity of the blending.\n * @param {Float} [options.scale=1] The scale at which tiles were drawn on\n * the sketch. Default is 1.\n * Use scale to draw at a lower scale and then enlarge onto the main canvas.\n * @param {OpenSeadragon.Point} [options.translate] A translation vector\n * that was used to draw the tiles\n * @param {String} [options.compositeOperation] - How the image is\n * composited onto other images; see compositeOperation in\n * {@link OpenSeadragon.Options} for possible values.\n * @param {OpenSeadragon.Rect} [options.bounds] The part of the sketch\n * canvas to blend in the main canvas. If specified, options.scale and\n * options.translate get ignored.\n */\n blendSketch: function(opacity, scale, translate, compositeOperation) {\n var options = opacity;\n if (!$.isPlainObject(options)) {\n options = {\n opacity: opacity,\n scale: scale,\n translate: translate,\n compositeOperation: compositeOperation\n };\n }\n if (!this.useCanvas || !this.sketchCanvas) {\n return;\n }\n opacity = options.opacity;\n compositeOperation = options.compositeOperation;\n var bounds = options.bounds;\n\n this.context.save();\n this.context.globalAlpha = opacity;\n if (compositeOperation) {\n this.context.globalCompositeOperation = compositeOperation;\n }\n if (bounds) {\n // Internet Explorer, Microsoft Edge, and Safari have problems\n // when you call context.drawImage with negative x or y\n // or x + width or y + height greater than the canvas width or height respectively.\n if (bounds.x < 0) {\n bounds.width += bounds.x;\n bounds.x = 0;\n }\n if (bounds.x + bounds.width > this.canvas.width) {\n bounds.width = this.canvas.width - bounds.x;\n }\n if (bounds.y < 0) {\n bounds.height += bounds.y;\n bounds.y = 0;\n }\n if (bounds.y + bounds.height > this.canvas.height) {\n bounds.height = this.canvas.height - bounds.y;\n }\n\n this.context.drawImage(\n this.sketchCanvas,\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height,\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height\n );\n } else {\n scale = options.scale || 1;\n translate = options.translate;\n var position = translate instanceof $.Point ?\n translate : new $.Point(0, 0);\n\n var widthExt = 0;\n var heightExt = 0;\n if (translate) {\n var widthDiff = this.sketchCanvas.width - this.canvas.width;\n var heightDiff = this.sketchCanvas.height - this.canvas.height;\n widthExt = Math.round(widthDiff / 2);\n heightExt = Math.round(heightDiff / 2);\n }\n this.context.drawImage(\n this.sketchCanvas,\n position.x - widthExt * scale,\n position.y - heightExt * scale,\n (this.canvas.width + 2 * widthExt) * scale,\n (this.canvas.height + 2 * heightExt) * scale,\n -widthExt,\n -heightExt,\n this.canvas.width + 2 * widthExt,\n this.canvas.height + 2 * heightExt\n );\n }\n this.context.restore();\n },\n\n // private\n drawDebugInfo: function(tile, count, i, tiledImage) {\n if ( !this.useCanvas ) {\n return;\n }\n\n var colorIndex = this.viewer.world.getIndexOfItem(tiledImage) % this.debugGridColor.length;\n var context = this.context;\n context.save();\n context.lineWidth = 2 * $.pixelDensityRatio;\n context.font = 'small-caps bold ' + (13 * $.pixelDensityRatio) + 'px arial';\n context.strokeStyle = this.debugGridColor[colorIndex];\n context.fillStyle = this.debugGridColor[colorIndex];\n\n if ( this.viewport.degrees !== 0 ) {\n this._offsetForRotation({degrees: this.viewport.degrees});\n }\n if (tiledImage.getRotation(true) % 360 !== 0) {\n this._offsetForRotation({\n degrees: tiledImage.getRotation(true),\n point: tiledImage.viewport.pixelFromPointNoRotate(\n tiledImage._getRotationPoint(true), true)\n });\n }\n if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){\n if(tiledImage._drawer.viewer.viewport.getFlip()) {\n tiledImage._drawer._flip();\n }\n }\n\n context.strokeRect(\n tile.position.x * $.pixelDensityRatio,\n tile.position.y * $.pixelDensityRatio,\n tile.size.x * $.pixelDensityRatio,\n tile.size.y * $.pixelDensityRatio\n );\n\n var tileCenterX = (tile.position.x + (tile.size.x / 2)) * $.pixelDensityRatio;\n var tileCenterY = (tile.position.y + (tile.size.y / 2)) * $.pixelDensityRatio;\n\n // Rotate the text the right way around.\n context.translate( tileCenterX, tileCenterY );\n context.rotate( Math.PI / 180 * -this.viewport.degrees );\n context.translate( -tileCenterX, -tileCenterY );\n\n if( tile.x === 0 && tile.y === 0 ){\n context.fillText(\n \"Zoom: \" + this.viewport.getZoom(),\n tile.position.x * $.pixelDensityRatio,\n (tile.position.y - 30) * $.pixelDensityRatio\n );\n context.fillText(\n \"Pan: \" + this.viewport.getBounds().toString(),\n tile.position.x * $.pixelDensityRatio,\n (tile.position.y - 20) * $.pixelDensityRatio\n );\n }\n context.fillText(\n \"Level: \" + tile.level,\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 20) * $.pixelDensityRatio\n );\n context.fillText(\n \"Column: \" + tile.x,\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 30) * $.pixelDensityRatio\n );\n context.fillText(\n \"Row: \" + tile.y,\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 40) * $.pixelDensityRatio\n );\n context.fillText(\n \"Order: \" + i + \" of \" + count,\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 50) * $.pixelDensityRatio\n );\n context.fillText(\n \"Size: \" + tile.size.toString(),\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 60) * $.pixelDensityRatio\n );\n context.fillText(\n \"Position: \" + tile.position.toString(),\n (tile.position.x + 10) * $.pixelDensityRatio,\n (tile.position.y + 70) * $.pixelDensityRatio\n );\n\n if ( this.viewport.degrees !== 0 ) {\n this._restoreRotationChanges();\n }\n if (tiledImage.getRotation(true) % 360 !== 0) {\n this._restoreRotationChanges();\n }\n\n if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){\n if(tiledImage._drawer.viewer.viewport.getFlip()) {\n tiledImage._drawer._flip();\n }\n }\n\n context.restore();\n },\n\n // private\n debugRect: function(rect) {\n if ( this.useCanvas ) {\n var context = this.context;\n context.save();\n context.lineWidth = 2 * $.pixelDensityRatio;\n context.strokeStyle = this.debugGridColor[0];\n context.fillStyle = this.debugGridColor[0];\n\n context.strokeRect(\n rect.x * $.pixelDensityRatio,\n rect.y * $.pixelDensityRatio,\n rect.width * $.pixelDensityRatio,\n rect.height * $.pixelDensityRatio\n );\n\n context.restore();\n }\n },\n\n /**\n * Turns image smoothing on or off for this viewer. Note: Ignored in some (especially older) browsers that do not support this property.\n *\n * @function\n * @param {Boolean} [imageSmoothingEnabled] - Whether or not the image is\n * drawn smoothly on the canvas; see imageSmoothingEnabled in\n * {@link OpenSeadragon.Options} for more explanation.\n */\n setImageSmoothingEnabled: function(imageSmoothingEnabled){\n if ( this.useCanvas ) {\n this._imageSmoothingEnabled = imageSmoothingEnabled;\n this._updateImageSmoothingEnabled(this.context);\n this.viewer.forceRedraw();\n }\n },\n\n // private\n _updateImageSmoothingEnabled: function(context){\n context.mozImageSmoothingEnabled = this._imageSmoothingEnabled;\n context.webkitImageSmoothingEnabled = this._imageSmoothingEnabled;\n context.msImageSmoothingEnabled = this._imageSmoothingEnabled;\n context.imageSmoothingEnabled = this._imageSmoothingEnabled;\n },\n\n /**\n * Get the canvas size\n * @param {Boolean} sketch If set to true return the size of the sketch canvas\n * @returns {OpenSeadragon.Point} The size of the canvas\n */\n getCanvasSize: function(sketch) {\n var canvas = this._getContext(sketch).canvas;\n return new $.Point(canvas.width, canvas.height);\n },\n\n getCanvasCenter: function() {\n return new $.Point(this.canvas.width / 2, this.canvas.height / 2);\n },\n\n // private\n _offsetForRotation: function(options) {\n var point = options.point ?\n options.point.times($.pixelDensityRatio) :\n this.getCanvasCenter();\n\n var context = this._getContext(options.useSketch);\n context.save();\n\n context.translate(point.x, point.y);\n if(this.viewer.viewport.flipped){\n context.rotate(Math.PI / 180 * -options.degrees);\n context.scale(-1, 1);\n } else{\n context.rotate(Math.PI / 180 * options.degrees);\n }\n context.translate(-point.x, -point.y);\n },\n\n // private\n _flip: function(options) {\n options = options || {};\n var point = options.point ?\n options.point.times($.pixelDensityRatio) :\n this.getCanvasCenter();\n var context = this._getContext(options.useSketch);\n\n context.translate(point.x, 0);\n context.scale(-1, 1);\n context.translate(-point.x, 0);\n },\n\n // private\n _restoreRotationChanges: function(useSketch) {\n var context = this._getContext(useSketch);\n context.restore();\n },\n\n // private\n _calculateCanvasSize: function() {\n var pixelDensityRatio = $.pixelDensityRatio;\n var viewportSize = this.viewport.getContainerSize();\n return {\n // canvas width and height are integers\n x: Math.round(viewportSize.x * pixelDensityRatio),\n y: Math.round(viewportSize.y * pixelDensityRatio)\n };\n },\n\n // private\n _calculateSketchCanvasSize: function() {\n var canvasSize = this._calculateCanvasSize();\n if (this.viewport.getRotation() === 0) {\n return canvasSize;\n }\n // If the viewport is rotated, we need a larger sketch canvas in order\n // to support edge smoothing.\n var sketchCanvasSize = Math.ceil(Math.sqrt(\n canvasSize.x * canvasSize.x +\n canvasSize.y * canvasSize.y));\n return {\n x: sketchCanvasSize,\n y: sketchCanvasSize\n };\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - Viewport\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n\n/**\n * @class Viewport\n * @memberof OpenSeadragon\n * @classdesc Handles coordinate-related functionality (zoom, pan, rotation, etc.)\n * for an {@link OpenSeadragon.Viewer}.\n * @param {Object} options - Options for this Viewport.\n * @param {Object} [options.margins] - See viewportMargins in {@link OpenSeadragon.Options}.\n * @param {Number} [options.springStiffness] - See springStiffness in {@link OpenSeadragon.Options}.\n * @param {Number} [options.animationTime] - See animationTime in {@link OpenSeadragon.Options}.\n * @param {Number} [options.minZoomImageRatio] - See minZoomImageRatio in {@link OpenSeadragon.Options}.\n * @param {Number} [options.maxZoomPixelRatio] - See maxZoomPixelRatio in {@link OpenSeadragon.Options}.\n * @param {Number} [options.visibilityRatio] - See visibilityRatio in {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.wrapHorizontal] - See wrapHorizontal in {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.wrapVertical] - See wrapVertical in {@link OpenSeadragon.Options}.\n * @param {Number} [options.defaultZoomLevel] - See defaultZoomLevel in {@link OpenSeadragon.Options}.\n * @param {Number} [options.minZoomLevel] - See minZoomLevel in {@link OpenSeadragon.Options}.\n * @param {Number} [options.maxZoomLevel] - See maxZoomLevel in {@link OpenSeadragon.Options}.\n * @param {Number} [options.degrees] - See degrees in {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.homeFillsViewer] - See homeFillsViewer in {@link OpenSeadragon.Options}.\n */\n$.Viewport = function( options ) {\n\n //backward compatibility for positional args while preferring more\n //idiomatic javascript options object as the only argument\n var args = arguments;\n if (args.length && args[0] instanceof $.Point) {\n options = {\n containerSize: args[0],\n contentSize: args[1],\n config: args[2]\n };\n }\n\n //options.config and the general config argument are deprecated\n //in favor of the more direct specification of optional settings\n //being passed directly on the options object\n if ( options.config ){\n $.extend( true, options, options.config );\n delete options.config;\n }\n\n this._margins = $.extend({\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n }, options.margins || {});\n\n delete options.margins;\n\n $.extend( true, this, {\n\n //required settings\n containerSize: null,\n contentSize: null,\n\n //internal state properties\n zoomPoint: null,\n viewer: null,\n\n //configurable options\n springStiffness: $.DEFAULT_SETTINGS.springStiffness,\n animationTime: $.DEFAULT_SETTINGS.animationTime,\n minZoomImageRatio: $.DEFAULT_SETTINGS.minZoomImageRatio,\n maxZoomPixelRatio: $.DEFAULT_SETTINGS.maxZoomPixelRatio,\n visibilityRatio: $.DEFAULT_SETTINGS.visibilityRatio,\n wrapHorizontal: $.DEFAULT_SETTINGS.wrapHorizontal,\n wrapVertical: $.DEFAULT_SETTINGS.wrapVertical,\n defaultZoomLevel: $.DEFAULT_SETTINGS.defaultZoomLevel,\n minZoomLevel: $.DEFAULT_SETTINGS.minZoomLevel,\n maxZoomLevel: $.DEFAULT_SETTINGS.maxZoomLevel,\n degrees: $.DEFAULT_SETTINGS.degrees,\n flipped: $.DEFAULT_SETTINGS.flipped,\n homeFillsViewer: $.DEFAULT_SETTINGS.homeFillsViewer\n\n }, options );\n\n this._updateContainerInnerSize();\n\n this.centerSpringX = new $.Spring({\n initial: 0,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n this.centerSpringY = new $.Spring({\n initial: 0,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n this.zoomSpring = new $.Spring({\n exponential: true,\n initial: 1,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n\n this._oldCenterX = this.centerSpringX.current.value;\n this._oldCenterY = this.centerSpringY.current.value;\n this._oldZoom = this.zoomSpring.current.value;\n\n this._setContentBounds(new $.Rect(0, 0, 1, 1), 1);\n\n this.goHome(true);\n this.update();\n};\n\n/** @lends OpenSeadragon.Viewport.prototype */\n$.Viewport.prototype = {\n /**\n * Updates the viewport's home bounds and constraints for the given content size.\n * @function\n * @param {OpenSeadragon.Point} contentSize - size of the content in content units\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:reset-size\n */\n resetContentSize: function(contentSize) {\n $.console.assert(contentSize, \"[Viewport.resetContentSize] contentSize is required\");\n $.console.assert(contentSize instanceof $.Point, \"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point\");\n $.console.assert(contentSize.x > 0, \"[Viewport.resetContentSize] contentSize.x must be greater than 0\");\n $.console.assert(contentSize.y > 0, \"[Viewport.resetContentSize] contentSize.y must be greater than 0\");\n\n this._setContentBounds(new $.Rect(0, 0, 1, contentSize.y / contentSize.x), contentSize.x);\n return this;\n },\n\n // deprecated\n setHomeBounds: function(bounds, contentFactor) {\n $.console.error(\"[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually.\");\n this._setContentBounds(bounds, contentFactor);\n },\n\n // Set the viewport's content bounds\n // @param {OpenSeadragon.Rect} bounds - the new bounds in viewport coordinates\n // without rotation\n // @param {Number} contentFactor - how many content units per viewport unit\n // @fires OpenSeadragon.Viewer.event:reset-size\n // @private\n _setContentBounds: function(bounds, contentFactor) {\n $.console.assert(bounds, \"[Viewport._setContentBounds] bounds is required\");\n $.console.assert(bounds instanceof $.Rect, \"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect\");\n $.console.assert(bounds.width > 0, \"[Viewport._setContentBounds] bounds.width must be greater than 0\");\n $.console.assert(bounds.height > 0, \"[Viewport._setContentBounds] bounds.height must be greater than 0\");\n\n this._contentBoundsNoRotate = bounds.clone();\n this._contentSizeNoRotate = this._contentBoundsNoRotate.getSize().times(\n contentFactor);\n\n this._contentBounds = bounds.rotate(this.degrees).getBoundingBox();\n this._contentSize = this._contentBounds.getSize().times(contentFactor);\n this._contentAspectRatio = this._contentSize.x / this._contentSize.y;\n\n if (this.viewer) {\n /**\n * Raised when the viewer's content size or home bounds are reset\n * (see {@link OpenSeadragon.Viewport#resetContentSize}).\n *\n * @event reset-size\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.Point} contentSize\n * @property {OpenSeadragon.Rect} contentBounds - Content bounds.\n * @property {OpenSeadragon.Rect} homeBounds - Content bounds.\n * Deprecated use contentBounds instead.\n * @property {Number} contentFactor\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent('reset-size', {\n contentSize: this._contentSizeNoRotate.clone(),\n contentFactor: contentFactor,\n homeBounds: this._contentBoundsNoRotate.clone(),\n contentBounds: this._contentBounds.clone()\n });\n }\n },\n\n /**\n * Returns the home zoom in \"viewport zoom\" value.\n * @function\n * @returns {Number} The home zoom in \"viewport zoom\".\n */\n getHomeZoom: function() {\n if (this.defaultZoomLevel) {\n return this.defaultZoomLevel;\n }\n\n var aspectFactor = this._contentAspectRatio / this.getAspectRatio();\n var output;\n if (this.homeFillsViewer) { // fill the viewer and clip the image\n output = aspectFactor >= 1 ? aspectFactor : 1;\n } else {\n output = aspectFactor >= 1 ? 1 : aspectFactor;\n }\n\n return output / this._contentBounds.width;\n },\n\n /**\n * Returns the home bounds in viewport coordinates.\n * @function\n * @returns {OpenSeadragon.Rect} The home bounds in vewport coordinates.\n */\n getHomeBounds: function() {\n return this.getHomeBoundsNoRotate().rotate(-this.getRotation());\n },\n\n /**\n * Returns the home bounds in viewport coordinates.\n * This method ignores the viewport rotation. Use\n * {@link OpenSeadragon.Viewport#getHomeBounds} to take it into account.\n * @function\n * @returns {OpenSeadragon.Rect} The home bounds in vewport coordinates.\n */\n getHomeBoundsNoRotate: function() {\n var center = this._contentBounds.getCenter();\n var width = 1.0 / this.getHomeZoom();\n var height = width / this.getAspectRatio();\n\n return new $.Rect(\n center.x - (width / 2.0),\n center.y - (height / 2.0),\n width,\n height\n );\n },\n\n /**\n * @function\n * @param {Boolean} immediately\n * @fires OpenSeadragon.Viewer.event:home\n */\n goHome: function(immediately) {\n if (this.viewer) {\n /**\n * Raised when the \"home\" operation occurs (see {@link OpenSeadragon.Viewport#goHome}).\n *\n * @event home\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {Boolean} immediately\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent('home', {\n immediately: immediately\n });\n }\n return this.fitBounds(this.getHomeBounds(), immediately);\n },\n\n /**\n * @function\n */\n getMinZoom: function() {\n var homeZoom = this.getHomeZoom(),\n zoom = this.minZoomLevel ?\n this.minZoomLevel :\n this.minZoomImageRatio * homeZoom;\n\n return zoom;\n },\n\n /**\n * @function\n */\n getMaxZoom: function() {\n var zoom = this.maxZoomLevel;\n if (!zoom) {\n zoom = this._contentSize.x * this.maxZoomPixelRatio / this._containerInnerSize.x;\n zoom /= this._contentBounds.width;\n }\n\n return Math.max( zoom, this.getHomeZoom() );\n },\n\n /**\n * @function\n */\n getAspectRatio: function() {\n return this._containerInnerSize.x / this._containerInnerSize.y;\n },\n\n /**\n * @function\n * @returns {OpenSeadragon.Point} The size of the container, in screen coordinates.\n */\n getContainerSize: function() {\n return new $.Point(\n this.containerSize.x,\n this.containerSize.y\n );\n },\n\n /**\n * The margins push the \"home\" region in from the sides by the specified amounts.\n * @function\n * @returns {Object} Properties (Numbers, in screen coordinates): left, top, right, bottom.\n */\n getMargins: function() {\n return $.extend({}, this._margins); // Make a copy so we are not returning our original\n },\n\n /**\n * The margins push the \"home\" region in from the sides by the specified amounts.\n * @function\n * @param {Object} margins - Properties (Numbers, in screen coordinates): left, top, right, bottom.\n */\n setMargins: function(margins) {\n $.console.assert($.type(margins) === 'object', '[Viewport.setMargins] margins must be an object');\n\n this._margins = $.extend({\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n }, margins);\n\n this._updateContainerInnerSize();\n if (this.viewer) {\n this.viewer.forceRedraw();\n }\n },\n\n /**\n * Returns the bounds of the visible area in viewport coordinates.\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n * @returns {OpenSeadragon.Rect} The location you are zoomed/panned to, in viewport coordinates.\n */\n getBounds: function(current) {\n return this.getBoundsNoRotate(current).rotate(-this.getRotation());\n },\n\n /**\n * Returns the bounds of the visible area in viewport coordinates.\n * This method ignores the viewport rotation. Use\n * {@link OpenSeadragon.Viewport#getBounds} to take it into account.\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n * @returns {OpenSeadragon.Rect} The location you are zoomed/panned to, in viewport coordinates.\n */\n getBoundsNoRotate: function(current) {\n var center = this.getCenter(current);\n var width = 1.0 / this.getZoom(current);\n var height = width / this.getAspectRatio();\n\n return new $.Rect(\n center.x - (width / 2.0),\n center.y - (height / 2.0),\n width,\n height\n );\n },\n\n /**\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n * @returns {OpenSeadragon.Rect} The location you are zoomed/panned to,\n * including the space taken by margins, in viewport coordinates.\n */\n getBoundsWithMargins: function(current) {\n return this.getBoundsNoRotateWithMargins(current).rotate(\n -this.getRotation(), this.getCenter(current));\n },\n\n /**\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n * @returns {OpenSeadragon.Rect} The location you are zoomed/panned to,\n * including the space taken by margins, in viewport coordinates.\n */\n getBoundsNoRotateWithMargins: function(current) {\n var bounds = this.getBoundsNoRotate(current);\n var factor = this._containerInnerSize.x * this.getZoom(current);\n bounds.x -= this._margins.left / factor;\n bounds.y -= this._margins.top / factor;\n bounds.width += (this._margins.left + this._margins.right) / factor;\n bounds.height += (this._margins.top + this._margins.bottom) / factor;\n return bounds;\n },\n\n /**\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n */\n getCenter: function( current ) {\n var centerCurrent = new $.Point(\n this.centerSpringX.current.value,\n this.centerSpringY.current.value\n ),\n centerTarget = new $.Point(\n this.centerSpringX.target.value,\n this.centerSpringY.target.value\n ),\n oldZoomPixel,\n zoom,\n width,\n height,\n bounds,\n newZoomPixel,\n deltaZoomPixels,\n deltaZoomPoints;\n\n if ( current ) {\n return centerCurrent;\n } else if ( !this.zoomPoint ) {\n return centerTarget;\n }\n\n oldZoomPixel = this.pixelFromPoint(this.zoomPoint, true);\n\n zoom = this.getZoom();\n width = 1.0 / zoom;\n height = width / this.getAspectRatio();\n bounds = new $.Rect(\n centerCurrent.x - width / 2.0,\n centerCurrent.y - height / 2.0,\n width,\n height\n );\n\n newZoomPixel = this._pixelFromPoint(this.zoomPoint, bounds);\n deltaZoomPixels = newZoomPixel.minus( oldZoomPixel );\n deltaZoomPoints = deltaZoomPixels.divide( this._containerInnerSize.x * zoom );\n\n return centerTarget.plus( deltaZoomPoints );\n },\n\n /**\n * @function\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n */\n getZoom: function( current ) {\n if ( current ) {\n return this.zoomSpring.current.value;\n } else {\n return this.zoomSpring.target.value;\n }\n },\n\n // private\n _applyZoomConstraints: function(zoom) {\n return Math.max(\n Math.min(zoom, this.getMaxZoom()),\n this.getMinZoom());\n },\n\n /**\n * @function\n * @private\n * @param {OpenSeadragon.Rect} bounds\n * @return {OpenSeadragon.Rect} constrained bounds.\n */\n _applyBoundaryConstraints: function(bounds) {\n var newBounds = new $.Rect(\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height);\n\n if (this.wrapHorizontal) {\n //do nothing\n } else {\n var horizontalThreshold = this.visibilityRatio * newBounds.width;\n var boundsRight = newBounds.x + newBounds.width;\n var contentRight = this._contentBoundsNoRotate.x + this._contentBoundsNoRotate.width;\n var leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold;\n var rightDx = contentRight - newBounds.x - horizontalThreshold;\n\n if (horizontalThreshold > this._contentBoundsNoRotate.width) {\n newBounds.x += (leftDx + rightDx) / 2;\n } else if (rightDx < 0) {\n newBounds.x += rightDx;\n } else if (leftDx > 0) {\n newBounds.x += leftDx;\n }\n }\n\n if (this.wrapVertical) {\n //do nothing\n } else {\n var verticalThreshold = this.visibilityRatio * newBounds.height;\n var boundsBottom = newBounds.y + newBounds.height;\n var contentBottom = this._contentBoundsNoRotate.y + this._contentBoundsNoRotate.height;\n var topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold;\n var bottomDy = contentBottom - newBounds.y - verticalThreshold;\n\n if (verticalThreshold > this._contentBoundsNoRotate.height) {\n newBounds.y += (topDy + bottomDy) / 2;\n } else if (bottomDy < 0) {\n newBounds.y += bottomDy;\n } else if (topDy > 0) {\n newBounds.y += topDy;\n }\n }\n\n return newBounds;\n },\n\n /**\n * @function\n * @private\n * @param {Boolean} [immediately=false] - whether the function that triggered this event was\n * called with the \"immediately\" flag\n */\n _raiseConstraintsEvent: function(immediately) {\n if (this.viewer) {\n /**\n * Raised when the viewport constraints are applied (see {@link OpenSeadragon.Viewport#applyConstraints}).\n *\n * @event constrain\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {Boolean} immediately - whether the function that triggered this event was\n * called with the \"immediately\" flag\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent( 'constrain', {\n immediately: immediately\n });\n }\n },\n\n /**\n * Enforces the minZoom, maxZoom and visibilityRatio constraints by\n * zooming and panning to the closest acceptable zoom and location.\n * @function\n * @param {Boolean} [immediately=false]\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:constrain\n */\n applyConstraints: function(immediately) {\n var actualZoom = this.getZoom();\n var constrainedZoom = this._applyZoomConstraints(actualZoom);\n\n if (actualZoom !== constrainedZoom) {\n this.zoomTo(constrainedZoom, this.zoomPoint, immediately);\n }\n\n var bounds = this.getBoundsNoRotate();\n var constrainedBounds = this._applyBoundaryConstraints(bounds);\n this._raiseConstraintsEvent(immediately);\n\n if (bounds.x !== constrainedBounds.x ||\n bounds.y !== constrainedBounds.y ||\n immediately) {\n this.fitBounds(\n constrainedBounds.rotate(-this.getRotation()),\n immediately);\n }\n return this;\n },\n\n /**\n * Equivalent to {@link OpenSeadragon.Viewport#applyConstraints}\n * @function\n * @param {Boolean} [immediately=false]\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:constrain\n */\n ensureVisible: function(immediately) {\n return this.applyConstraints(immediately);\n },\n\n /**\n * @function\n * @private\n * @param {OpenSeadragon.Rect} bounds\n * @param {Object} options (immediately=false, constraints=false)\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n _fitBounds: function(bounds, options) {\n options = options || {};\n var immediately = options.immediately || false;\n var constraints = options.constraints || false;\n\n var aspect = this.getAspectRatio();\n var center = bounds.getCenter();\n\n // Compute width and height of bounding box.\n var newBounds = new $.Rect(\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height,\n bounds.degrees + this.getRotation())\n .getBoundingBox();\n\n if (newBounds.getAspectRatio() >= aspect) {\n newBounds.height = newBounds.width / aspect;\n } else {\n newBounds.width = newBounds.height * aspect;\n }\n\n // Compute x and y from width, height and center position\n newBounds.x = center.x - newBounds.width / 2;\n newBounds.y = center.y - newBounds.height / 2;\n var newZoom = 1.0 / newBounds.width;\n\n if (constraints) {\n var newBoundsAspectRatio = newBounds.getAspectRatio();\n var newConstrainedZoom = this._applyZoomConstraints(newZoom);\n\n if (newZoom !== newConstrainedZoom) {\n newZoom = newConstrainedZoom;\n newBounds.width = 1.0 / newZoom;\n newBounds.x = center.x - newBounds.width / 2;\n newBounds.height = newBounds.width / newBoundsAspectRatio;\n newBounds.y = center.y - newBounds.height / 2;\n }\n\n newBounds = this._applyBoundaryConstraints(newBounds);\n center = newBounds.getCenter();\n this._raiseConstraintsEvent(immediately);\n }\n\n if (immediately) {\n this.panTo(center, true);\n return this.zoomTo(newZoom, null, true);\n }\n\n this.panTo(this.getCenter(true), true);\n this.zoomTo(this.getZoom(true), null, true);\n\n var oldBounds = this.getBounds();\n var oldZoom = this.getZoom();\n\n if (oldZoom === 0 || Math.abs(newZoom / oldZoom - 1) < 0.00000001) {\n this.zoomTo(newZoom, true);\n return this.panTo(center, immediately);\n }\n\n newBounds = newBounds.rotate(-this.getRotation());\n var referencePoint = newBounds.getTopLeft().times(newZoom)\n .minus(oldBounds.getTopLeft().times(oldZoom))\n .divide(newZoom - oldZoom);\n\n return this.zoomTo(newZoom, referencePoint, immediately);\n },\n\n /**\n * Makes the viewport zoom and pan so that the specified bounds take\n * as much space as possible in the viewport.\n * Note: this method ignores the constraints (minZoom, maxZoom and\n * visibilityRatio).\n * Use {@link OpenSeadragon.Viewport#fitBoundsWithConstraints} to enforce\n * them.\n * @function\n * @param {OpenSeadragon.Rect} bounds\n * @param {Boolean} [immediately=false]\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n fitBounds: function(bounds, immediately) {\n return this._fitBounds(bounds, {\n immediately: immediately,\n constraints: false\n });\n },\n\n /**\n * Makes the viewport zoom and pan so that the specified bounds take\n * as much space as possible in the viewport while enforcing the constraints\n * (minZoom, maxZoom and visibilityRatio).\n * Note: because this method enforces the constraints, part of the\n * provided bounds may end up outside of the viewport.\n * Use {@link OpenSeadragon.Viewport#fitBounds} to ignore them.\n * @function\n * @param {OpenSeadragon.Rect} bounds\n * @param {Boolean} [immediately=false]\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n fitBoundsWithConstraints: function(bounds, immediately) {\n return this._fitBounds(bounds, {\n immediately: immediately,\n constraints: true\n });\n },\n\n /**\n * Zooms so the image just fills the viewer vertically.\n * @param {Boolean} immediately\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n fitVertically: function(immediately) {\n var box = new $.Rect(\n this._contentBounds.x + (this._contentBounds.width / 2),\n this._contentBounds.y,\n 0,\n this._contentBounds.height);\n return this.fitBounds(box, immediately);\n },\n\n /**\n * Zooms so the image just fills the viewer horizontally.\n * @param {Boolean} immediately\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n fitHorizontally: function(immediately) {\n var box = new $.Rect(\n this._contentBounds.x,\n this._contentBounds.y + (this._contentBounds.height / 2),\n this._contentBounds.width,\n 0);\n return this.fitBounds(box, immediately);\n },\n\n\n /**\n * Returns bounds taking constraints into account\n * Added to improve constrained panning\n * @param {Boolean} current - Pass true for the current location; defaults to false (target location).\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n getConstrainedBounds: function(current) {\n var bounds,\n constrainedBounds;\n\n bounds = this.getBounds(current);\n\n constrainedBounds = this._applyBoundaryConstraints(bounds);\n\n return constrainedBounds;\n },\n\n /**\n * @function\n * @param {OpenSeadragon.Point} delta\n * @param {Boolean} immediately\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:pan\n */\n panBy: function( delta, immediately ) {\n var center = new $.Point(\n this.centerSpringX.target.value,\n this.centerSpringY.target.value\n );\n return this.panTo( center.plus( delta ), immediately );\n },\n\n /**\n * @function\n * @param {OpenSeadragon.Point} center\n * @param {Boolean} immediately\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:pan\n */\n panTo: function( center, immediately ) {\n if ( immediately ) {\n this.centerSpringX.resetTo( center.x );\n this.centerSpringY.resetTo( center.y );\n } else {\n this.centerSpringX.springTo( center.x );\n this.centerSpringY.springTo( center.y );\n }\n\n if( this.viewer ){\n /**\n * Raised when the viewport is panned (see {@link OpenSeadragon.Viewport#panBy} and {@link OpenSeadragon.Viewport#panTo}).\n *\n * @event pan\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.Point} center\n * @property {Boolean} immediately\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent( 'pan', {\n center: center,\n immediately: immediately\n });\n }\n\n return this;\n },\n\n /**\n * @function\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:zoom\n */\n zoomBy: function(factor, refPoint, immediately) {\n return this.zoomTo(\n this.zoomSpring.target.value * factor, refPoint, immediately);\n },\n\n /**\n * Zooms to the specified zoom level\n * @function\n * @param {Number} zoom The zoom level to zoom to.\n * @param {OpenSeadragon.Point} [refPoint] The point which will stay at\n * the same screen location. Defaults to the viewport center.\n * @param {Boolean} [immediately=false]\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:zoom\n */\n zoomTo: function(zoom, refPoint, immediately) {\n var _this = this;\n\n this.zoomPoint = refPoint instanceof $.Point &&\n !isNaN(refPoint.x) &&\n !isNaN(refPoint.y) ?\n refPoint :\n null;\n\n if (immediately) {\n this._adjustCenterSpringsForZoomPoint(function() {\n _this.zoomSpring.resetTo(zoom);\n });\n } else {\n this.zoomSpring.springTo(zoom);\n }\n\n if (this.viewer) {\n /**\n * Raised when the viewport zoom level changes (see {@link OpenSeadragon.Viewport#zoomBy} and {@link OpenSeadragon.Viewport#zoomTo}).\n *\n * @event zoom\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {Number} zoom\n * @property {OpenSeadragon.Point} refPoint\n * @property {Boolean} immediately\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent('zoom', {\n zoom: zoom,\n refPoint: refPoint,\n immediately: immediately\n });\n }\n\n return this;\n },\n\n /**\n * Rotates this viewport to the angle specified.\n * @function\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n setRotation: function(degrees) {\n if (!this.viewer || !this.viewer.drawer.canRotate()) {\n return this;\n }\n this.degrees = $.positiveModulo(degrees, 360);\n this._setContentBounds(\n this.viewer.world.getHomeBounds(),\n this.viewer.world.getContentFactor());\n this.viewer.forceRedraw();\n\n /**\n * Raised when rotation has been changed.\n *\n * @event rotate\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Number} degrees - The number of degrees the rotation was set to.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent('rotate', {\"degrees\": degrees});\n return this;\n },\n\n /**\n * Gets the current rotation in degrees.\n * @function\n * @return {Number} The current rotation in degrees.\n */\n getRotation: function() {\n return this.degrees;\n },\n\n /**\n * @function\n * @return {OpenSeadragon.Viewport} Chainable.\n * @fires OpenSeadragon.Viewer.event:resize\n */\n resize: function( newContainerSize, maintain ) {\n var oldBounds = this.getBoundsNoRotate(),\n newBounds = oldBounds,\n widthDeltaFactor;\n\n this.containerSize.x = newContainerSize.x;\n this.containerSize.y = newContainerSize.y;\n\n this._updateContainerInnerSize();\n\n if ( maintain ) {\n // TODO: widthDeltaFactor will always be 1; probably not what's intended\n widthDeltaFactor = newContainerSize.x / this.containerSize.x;\n newBounds.width = oldBounds.width * widthDeltaFactor;\n newBounds.height = newBounds.width / this.getAspectRatio();\n }\n\n if( this.viewer ){\n /**\n * Raised when the viewer is resized (see {@link OpenSeadragon.Viewport#resize}).\n *\n * @event resize\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event.\n * @property {OpenSeadragon.Point} newContainerSize\n * @property {Boolean} maintain\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent( 'resize', {\n newContainerSize: newContainerSize,\n maintain: maintain\n });\n }\n\n return this.fitBounds( newBounds, true );\n },\n\n // private\n _updateContainerInnerSize: function() {\n this._containerInnerSize = new $.Point(\n Math.max(1, this.containerSize.x - (this._margins.left + this._margins.right)),\n Math.max(1, this.containerSize.y - (this._margins.top + this._margins.bottom))\n );\n },\n\n /**\n * Update the zoom and center (X and Y) springs.\n * @function\n * @returns {Boolean} True if any change has been made, false otherwise.\n */\n update: function() {\n var _this = this;\n this._adjustCenterSpringsForZoomPoint(function() {\n _this.zoomSpring.update();\n });\n\n this.centerSpringX.update();\n this.centerSpringY.update();\n\n var changed = this.centerSpringX.current.value !== this._oldCenterX ||\n this.centerSpringY.current.value !== this._oldCenterY ||\n this.zoomSpring.current.value !== this._oldZoom;\n\n this._oldCenterX = this.centerSpringX.current.value;\n this._oldCenterY = this.centerSpringY.current.value;\n this._oldZoom = this.zoomSpring.current.value;\n\n return changed;\n },\n\n _adjustCenterSpringsForZoomPoint: function(zoomSpringHandler) {\n if (this.zoomPoint) {\n var oldZoomPixel = this.pixelFromPoint(this.zoomPoint, true);\n zoomSpringHandler();\n var newZoomPixel = this.pixelFromPoint(this.zoomPoint, true);\n\n var deltaZoomPixels = newZoomPixel.minus(oldZoomPixel);\n var deltaZoomPoints = this.deltaPointsFromPixels(\n deltaZoomPixels, true);\n\n this.centerSpringX.shiftBy(deltaZoomPoints.x);\n this.centerSpringY.shiftBy(deltaZoomPoints.y);\n\n if (this.zoomSpring.isAtTargetValue()) {\n this.zoomPoint = null;\n }\n } else {\n zoomSpringHandler();\n }\n },\n\n /**\n * Convert a delta (translation vector) from viewport coordinates to pixels\n * coordinates. This method does not take rotation into account.\n * Consider using deltaPixelsFromPoints if you need to account for rotation.\n * @param {OpenSeadragon.Point} deltaPoints - The translation vector to convert.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n deltaPixelsFromPointsNoRotate: function(deltaPoints, current) {\n return deltaPoints.times(\n this._containerInnerSize.x * this.getZoom(current)\n );\n },\n\n /**\n * Convert a delta (translation vector) from viewport coordinates to pixels\n * coordinates.\n * @param {OpenSeadragon.Point} deltaPoints - The translation vector to convert.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n deltaPixelsFromPoints: function(deltaPoints, current) {\n return this.deltaPixelsFromPointsNoRotate(\n deltaPoints.rotate(this.getRotation()),\n current);\n },\n\n /**\n * Convert a delta (translation vector) from pixels coordinates to viewport\n * coordinates. This method does not take rotation into account.\n * Consider using deltaPointsFromPixels if you need to account for rotation.\n * @param {OpenSeadragon.Point} deltaPixels - The translation vector to convert.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n deltaPointsFromPixelsNoRotate: function(deltaPixels, current) {\n return deltaPixels.divide(\n this._containerInnerSize.x * this.getZoom(current)\n );\n },\n\n /**\n * Convert a delta (translation vector) from pixels coordinates to viewport\n * coordinates.\n * @param {OpenSeadragon.Point} deltaPixels - The translation vector to convert.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n deltaPointsFromPixels: function(deltaPixels, current) {\n return this.deltaPointsFromPixelsNoRotate(deltaPixels, current)\n .rotate(-this.getRotation());\n },\n\n /**\n * Convert viewport coordinates to pixels coordinates.\n * This method does not take rotation into account.\n * Consider using pixelFromPoint if you need to account for rotation.\n * @param {OpenSeadragon.Point} point the viewport coordinates\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n pixelFromPointNoRotate: function(point, current) {\n return this._pixelFromPointNoRotate(\n point, this.getBoundsNoRotate(current));\n },\n\n /**\n * Convert viewport coordinates to pixel coordinates.\n * @param {OpenSeadragon.Point} point the viewport coordinates\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n pixelFromPoint: function(point, current) {\n return this._pixelFromPoint(point, this.getBoundsNoRotate(current));\n },\n\n // private\n _pixelFromPointNoRotate: function(point, bounds) {\n return point.minus(\n bounds.getTopLeft()\n ).times(\n this._containerInnerSize.x / bounds.width\n ).plus(\n new $.Point(this._margins.left, this._margins.top)\n );\n },\n\n // private\n _pixelFromPoint: function(point, bounds) {\n return this._pixelFromPointNoRotate(\n point.rotate(this.getRotation(), this.getCenter(true)),\n bounds);\n },\n\n /**\n * Convert pixel coordinates to viewport coordinates.\n * This method does not take rotation into account.\n * Consider using pointFromPixel if you need to account for rotation.\n * @param {OpenSeadragon.Point} pixel Pixel coordinates\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n pointFromPixelNoRotate: function(pixel, current) {\n var bounds = this.getBoundsNoRotate(current);\n return pixel.minus(\n new $.Point(this._margins.left, this._margins.top)\n ).divide(\n this._containerInnerSize.x / bounds.width\n ).plus(\n bounds.getTopLeft()\n );\n },\n\n /**\n * Convert pixel coordinates to viewport coordinates.\n * @param {OpenSeadragon.Point} pixel Pixel coordinates\n * @param {Boolean} [current=false] - Pass true for the current location;\n * defaults to false (target location).\n * @returns {OpenSeadragon.Point}\n */\n pointFromPixel: function(pixel, current) {\n return this.pointFromPixelNoRotate(pixel, current).rotate(\n -this.getRotation(),\n this.getCenter(true)\n );\n },\n\n // private\n _viewportToImageDelta: function( viewerX, viewerY ) {\n var scale = this._contentBoundsNoRotate.width;\n return new $.Point(\n viewerX * this._contentSizeNoRotate.x / scale,\n viewerY * this._contentSizeNoRotate.x / scale);\n },\n\n /**\n * Translates from OpenSeadragon viewer coordinate system to image coordinate system.\n * This method can be called either by passing X,Y coordinates or an\n * OpenSeadragon.Point\n * Note: not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.\n * @function\n * @param {(OpenSeadragon.Point|Number)} viewerX either a point or the X\n * coordinate in viewport coordinate system.\n * @param {Number} [viewerY] Y coordinate in viewport coordinate system.\n * @return {OpenSeadragon.Point} a point representing the coordinates in the image.\n */\n viewportToImageCoordinates: function(viewerX, viewerY) {\n if (viewerX instanceof $.Point) {\n //they passed a point instead of individual components\n return this.viewportToImageCoordinates(viewerX.x, viewerX.y);\n }\n\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.viewportToImageCoordinates] is not accurate ' +\n 'with multi-image; use TiledImage.viewportToImageCoordinates instead.');\n } else if (count === 1) {\n // It is better to use TiledImage.viewportToImageCoordinates\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.viewportToImageCoordinates(viewerX, viewerY, true);\n }\n }\n\n return this._viewportToImageDelta(\n viewerX - this._contentBoundsNoRotate.x,\n viewerY - this._contentBoundsNoRotate.y);\n },\n\n // private\n _imageToViewportDelta: function( imageX, imageY ) {\n var scale = this._contentBoundsNoRotate.width;\n return new $.Point(\n imageX / this._contentSizeNoRotate.x * scale,\n imageY / this._contentSizeNoRotate.x * scale);\n },\n\n /**\n * Translates from image coordinate system to OpenSeadragon viewer coordinate system\n * This method can be called either by passing X,Y coordinates or an\n * OpenSeadragon.Point\n * Note: not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.\n * @function\n * @param {(OpenSeadragon.Point | Number)} imageX the point or the\n * X coordinate in image coordinate system.\n * @param {Number} [imageY] Y coordinate in image coordinate system.\n * @return {OpenSeadragon.Point} a point representing the coordinates in the viewport.\n */\n imageToViewportCoordinates: function(imageX, imageY) {\n if (imageX instanceof $.Point) {\n //they passed a point instead of individual components\n return this.imageToViewportCoordinates(imageX.x, imageX.y);\n }\n\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.imageToViewportCoordinates] is not accurate ' +\n 'with multi-image; use TiledImage.imageToViewportCoordinates instead.');\n } else if (count === 1) {\n // It is better to use TiledImage.viewportToImageCoordinates\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.imageToViewportCoordinates(imageX, imageY, true);\n }\n }\n\n var point = this._imageToViewportDelta(imageX, imageY);\n point.x += this._contentBoundsNoRotate.x;\n point.y += this._contentBoundsNoRotate.y;\n return point;\n },\n\n /**\n * Translates from a rectangle which describes a portion of the image in\n * pixel coordinates to OpenSeadragon viewport rectangle coordinates.\n * This method can be called either by passing X,Y,width,height or an\n * OpenSeadragon.Rect\n * Note: not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.\n * @function\n * @param {(OpenSeadragon.Rect | Number)} imageX the rectangle or the X\n * coordinate of the top left corner of the rectangle in image coordinate system.\n * @param {Number} [imageY] the Y coordinate of the top left corner of the rectangle\n * in image coordinate system.\n * @param {Number} [pixelWidth] the width in pixel of the rectangle.\n * @param {Number} [pixelHeight] the height in pixel of the rectangle.\n * @returns {OpenSeadragon.Rect} This image's bounds in viewport coordinates\n */\n imageToViewportRectangle: function(imageX, imageY, pixelWidth, pixelHeight) {\n var rect = imageX;\n if (!(rect instanceof $.Rect)) {\n //they passed individual components instead of a rectangle\n rect = new $.Rect(imageX, imageY, pixelWidth, pixelHeight);\n }\n\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.imageToViewportRectangle] is not accurate ' +\n 'with multi-image; use TiledImage.imageToViewportRectangle instead.');\n } else if (count === 1) {\n // It is better to use TiledImage.imageToViewportRectangle\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.imageToViewportRectangle(\n imageX, imageY, pixelWidth, pixelHeight, true);\n }\n }\n\n var coordA = this.imageToViewportCoordinates(rect.x, rect.y);\n var coordB = this._imageToViewportDelta(rect.width, rect.height);\n return new $.Rect(\n coordA.x,\n coordA.y,\n coordB.x,\n coordB.y,\n rect.degrees\n );\n },\n\n /**\n * Translates from a rectangle which describes a portion of\n * the viewport in point coordinates to image rectangle coordinates.\n * This method can be called either by passing X,Y,width,height or an\n * OpenSeadragon.Rect\n * Note: not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.\n * @function\n * @param {(OpenSeadragon.Rect | Number)} viewerX either a rectangle or\n * the X coordinate of the top left corner of the rectangle in viewport\n * coordinate system.\n * @param {Number} [viewerY] the Y coordinate of the top left corner of the rectangle\n * in viewport coordinate system.\n * @param {Number} [pointWidth] the width of the rectangle in viewport coordinate system.\n * @param {Number} [pointHeight] the height of the rectangle in viewport coordinate system.\n */\n viewportToImageRectangle: function(viewerX, viewerY, pointWidth, pointHeight) {\n var rect = viewerX;\n if (!(rect instanceof $.Rect)) {\n //they passed individual components instead of a rectangle\n rect = new $.Rect(viewerX, viewerY, pointWidth, pointHeight);\n }\n\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.viewportToImageRectangle] is not accurate ' +\n 'with multi-image; use TiledImage.viewportToImageRectangle instead.');\n } else if (count === 1) {\n // It is better to use TiledImage.viewportToImageCoordinates\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.viewportToImageRectangle(\n viewerX, viewerY, pointWidth, pointHeight, true);\n }\n }\n\n var coordA = this.viewportToImageCoordinates(rect.x, rect.y);\n var coordB = this._viewportToImageDelta(rect.width, rect.height);\n return new $.Rect(\n coordA.x,\n coordA.y,\n coordB.x,\n coordB.y,\n rect.degrees\n );\n },\n\n /**\n * Convert pixel coordinates relative to the viewer element to image\n * coordinates.\n * Note: not accurate with multi-image.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n viewerElementToImageCoordinates: function( pixel ) {\n var point = this.pointFromPixel( pixel, true );\n return this.viewportToImageCoordinates( point );\n },\n\n /**\n * Convert pixel coordinates relative to the image to\n * viewer element coordinates.\n * Note: not accurate with multi-image.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n imageToViewerElementCoordinates: function( pixel ) {\n var point = this.imageToViewportCoordinates( pixel );\n return this.pixelFromPoint( point, true );\n },\n\n /**\n * Convert pixel coordinates relative to the window to image coordinates.\n * Note: not accurate with multi-image.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n windowToImageCoordinates: function(pixel) {\n $.console.assert(this.viewer,\n \"[Viewport.windowToImageCoordinates] the viewport must have a viewer.\");\n var viewerCoordinates = pixel.minus(\n $.getElementPosition(this.viewer.element));\n return this.viewerElementToImageCoordinates(viewerCoordinates);\n },\n\n /**\n * Convert image coordinates to pixel coordinates relative to the window.\n * Note: not accurate with multi-image.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n imageToWindowCoordinates: function(pixel) {\n $.console.assert(this.viewer,\n \"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.\");\n var viewerCoordinates = this.imageToViewerElementCoordinates(pixel);\n return viewerCoordinates.plus(\n $.getElementPosition(this.viewer.element));\n },\n\n /**\n * Convert pixel coordinates relative to the viewer element to viewport\n * coordinates.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n viewerElementToViewportCoordinates: function( pixel ) {\n return this.pointFromPixel( pixel, true );\n },\n\n /**\n * Convert viewport coordinates to pixel coordinates relative to the\n * viewer element.\n * @param {OpenSeadragon.Point} point\n * @returns {OpenSeadragon.Point}\n */\n viewportToViewerElementCoordinates: function( point ) {\n return this.pixelFromPoint( point, true );\n },\n\n /**\n * Convert a rectangle in pixel coordinates relative to the viewer element\n * to viewport coordinates.\n * @param {OpenSeadragon.Rect} rectangle the rectangle to convert\n * @returns {OpenSeadragon.Rect} the converted rectangle\n */\n viewerElementToViewportRectangle: function(rectangle) {\n return $.Rect.fromSummits(\n this.pointFromPixel(rectangle.getTopLeft(), true),\n this.pointFromPixel(rectangle.getTopRight(), true),\n this.pointFromPixel(rectangle.getBottomLeft(), true)\n );\n },\n\n /**\n * Convert a rectangle in viewport coordinates to pixel coordinates relative\n * to the viewer element.\n * @param {OpenSeadragon.Rect} rectangle the rectangle to convert\n * @returns {OpenSeadragon.Rect} the converted rectangle\n */\n viewportToViewerElementRectangle: function(rectangle) {\n return $.Rect.fromSummits(\n this.pixelFromPoint(rectangle.getTopLeft(), true),\n this.pixelFromPoint(rectangle.getTopRight(), true),\n this.pixelFromPoint(rectangle.getBottomLeft(), true)\n );\n },\n\n /**\n * Convert pixel coordinates relative to the window to viewport coordinates.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n windowToViewportCoordinates: function(pixel) {\n $.console.assert(this.viewer,\n \"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.\");\n var viewerCoordinates = pixel.minus(\n $.getElementPosition(this.viewer.element));\n return this.viewerElementToViewportCoordinates(viewerCoordinates);\n },\n\n /**\n * Convert viewport coordinates to pixel coordinates relative to the window.\n * @param {OpenSeadragon.Point} point\n * @returns {OpenSeadragon.Point}\n */\n viewportToWindowCoordinates: function(point) {\n $.console.assert(this.viewer,\n \"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.\");\n var viewerCoordinates = this.viewportToViewerElementCoordinates(point);\n return viewerCoordinates.plus(\n $.getElementPosition(this.viewer.element));\n },\n\n /**\n * Convert a viewport zoom to an image zoom.\n * Image zoom: ratio of the original image size to displayed image size.\n * 1 means original image size, 0.5 half size...\n * Viewport zoom: ratio of the displayed image's width to viewport's width.\n * 1 means identical width, 2 means image's width is twice the viewport's width...\n * Note: not accurate with multi-image.\n * @function\n * @param {Number} viewportZoom The viewport zoom\n * target zoom.\n * @returns {Number} imageZoom The image zoom\n */\n viewportToImageZoom: function(viewportZoom) {\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.viewportToImageZoom] is not ' +\n 'accurate with multi-image.');\n } else if (count === 1) {\n // It is better to use TiledImage.viewportToImageZoom\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.viewportToImageZoom(viewportZoom);\n }\n }\n\n var imageWidth = this._contentSizeNoRotate.x;\n var containerWidth = this._containerInnerSize.x;\n var scale = this._contentBoundsNoRotate.width;\n var viewportToImageZoomRatio = (containerWidth / imageWidth) * scale;\n return viewportZoom * viewportToImageZoomRatio;\n },\n\n /**\n * Convert an image zoom to a viewport zoom.\n * Image zoom: ratio of the original image size to displayed image size.\n * 1 means original image size, 0.5 half size...\n * Viewport zoom: ratio of the displayed image's width to viewport's width.\n * 1 means identical width, 2 means image's width is twice the viewport's width...\n * Note: not accurate with multi-image.\n * @function\n * @param {Number} imageZoom The image zoom\n * target zoom.\n * @returns {Number} viewportZoom The viewport zoom\n */\n imageToViewportZoom: function(imageZoom) {\n if (this.viewer) {\n var count = this.viewer.world.getItemCount();\n if (count > 1) {\n $.console.error('[Viewport.imageToViewportZoom] is not accurate ' +\n 'with multi-image.');\n } else if (count === 1) {\n // It is better to use TiledImage.imageToViewportZoom\n // because this._contentBoundsNoRotate can not be relied on\n // with clipping.\n var item = this.viewer.world.getItemAt(0);\n return item.imageToViewportZoom(imageZoom);\n }\n }\n\n var imageWidth = this._contentSizeNoRotate.x;\n var containerWidth = this._containerInnerSize.x;\n var scale = this._contentBoundsNoRotate.width;\n var viewportToImageZoomRatio = (imageWidth / containerWidth) / scale;\n return imageZoom * viewportToImageZoomRatio;\n },\n\n /**\n * Toggles flip state and demands a new drawing on navigator and viewer objects.\n * @function\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n toggleFlip: function() {\n this.setFlip(!this.getFlip());\n return this;\n },\n\n /**\n * Get flip state stored on viewport.\n * @function\n * @return {Boolean} Flip state.\n */\n getFlip: function() {\n return this.flipped;\n },\n\n /**\n * Sets flip state according to the state input argument.\n * @function\n * @param {Boolean} state - Flip state to set.\n * @return {OpenSeadragon.Viewport} Chainable.\n */\n setFlip: function( state ) {\n if ( this.flipped === state ) {\n return this;\n }\n\n this.flipped = state;\n if(this.viewer.navigator){\n this.viewer.navigator.setFlip(this.getFlip());\n }\n this.viewer.forceRedraw();\n\n /**\n * Raised when flip state has been changed.\n *\n * @event flip\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {Number} flipped - The flip state after this change.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.viewer.raiseEvent('flip', {\"flipped\": state});\n return this;\n }\n\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - TiledImage\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * You shouldn't have to create a TiledImage instance directly; get it asynchronously by\n * using {@link OpenSeadragon.Viewer#open} or {@link OpenSeadragon.Viewer#addTiledImage} instead.\n * @class TiledImage\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.EventSource\n * @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.\n * A new instance is created for each TileSource opened.\n * @param {Object} options - Configuration for this TiledImage.\n * @param {OpenSeadragon.TileSource} options.source - The TileSource that defines this TiledImage.\n * @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this TiledImage.\n * @param {OpenSeadragon.TileCache} options.tileCache - The TileCache for this TiledImage to use.\n * @param {OpenSeadragon.Drawer} options.drawer - The Drawer for this TiledImage to draw onto.\n * @param {OpenSeadragon.ImageLoader} options.imageLoader - The ImageLoader for this TiledImage to use.\n * @param {Number} [options.x=0] - Left position, in viewport coordinates.\n * @param {Number} [options.y=0] - Top position, in viewport coordinates.\n * @param {Number} [options.width=1] - Width, in viewport coordinates.\n * @param {Number} [options.height] - Height, in viewport coordinates.\n * @param {OpenSeadragon.Rect} [options.fitBounds] The bounds in viewport coordinates\n * to fit the image into. If specified, x, y, width and height get ignored.\n * @param {OpenSeadragon.Placement} [options.fitBoundsPlacement=OpenSeadragon.Placement.CENTER]\n * How to anchor the image in the bounds if options.fitBounds is set.\n * @param {OpenSeadragon.Rect} [options.clip] - An area, in image pixels, to clip to\n * (portions of the image outside of this area will not be visible). Only works on\n * browsers that support the HTML5 canvas.\n * @param {Number} [options.springStiffness] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.animationTime] - See {@link OpenSeadragon.Options}.\n * @param {Number} [options.minZoomImageRatio] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.wrapHorizontal] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.wrapVertical] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.immediateRender] - See {@link OpenSeadragon.Options}.\n * @param {Number} [options.blendTime] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.alwaysBlend] - See {@link OpenSeadragon.Options}.\n * @param {Number} [options.minPixelRatio] - See {@link OpenSeadragon.Options}.\n * @param {Number} [options.smoothTileEdgesMinZoom] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.iOSDevice] - See {@link OpenSeadragon.Options}.\n * @param {Number} [options.opacity=1] - Set to draw at proportional opacity. If zero, images will not draw.\n * @param {Boolean} [options.preload=false] - Set true to load even when the image is hidden by zero opacity.\n * @param {String} [options.compositeOperation] - How the image is composited onto other images; see compositeOperation in {@link OpenSeadragon.Options} for possible values.\n * @param {Boolean} [options.debugMode] - See {@link OpenSeadragon.Options}.\n * @param {String|CanvasGradient|CanvasPattern|Function} [options.placeholderFillStyle] - See {@link OpenSeadragon.Options}.\n * @param {String|Boolean} [options.crossOriginPolicy] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.ajaxWithCredentials] - See {@link OpenSeadragon.Options}.\n * @param {Boolean} [options.loadTilesWithAjax]\n * Whether to load tile data using AJAX requests.\n * Defaults to the setting in {@link OpenSeadragon.Options}.\n * @param {Object} [options.ajaxHeaders={}]\n * A set of headers to include when making tile AJAX requests.\n */\n$.TiledImage = function( options ) {\n var _this = this;\n /**\n * The {@link OpenSeadragon.TileSource} that defines this TiledImage.\n * @member {OpenSeadragon.TileSource} source\n * @memberof OpenSeadragon.TiledImage#\n */\n $.console.assert( options.tileCache, \"[TiledImage] options.tileCache is required\" );\n $.console.assert( options.drawer, \"[TiledImage] options.drawer is required\" );\n $.console.assert( options.viewer, \"[TiledImage] options.viewer is required\" );\n $.console.assert( options.imageLoader, \"[TiledImage] options.imageLoader is required\" );\n $.console.assert( options.source, \"[TiledImage] options.source is required\" );\n $.console.assert(!options.clip || options.clip instanceof $.Rect,\n \"[TiledImage] options.clip must be an OpenSeadragon.Rect if present\");\n\n $.EventSource.call( this );\n\n this._tileCache = options.tileCache;\n delete options.tileCache;\n\n this._drawer = options.drawer;\n delete options.drawer;\n\n this._imageLoader = options.imageLoader;\n delete options.imageLoader;\n\n if (options.clip instanceof $.Rect) {\n this._clip = options.clip.clone();\n }\n\n delete options.clip;\n\n var x = options.x || 0;\n delete options.x;\n var y = options.y || 0;\n delete options.y;\n\n // Ratio of zoomable image height to width.\n this.normHeight = options.source.dimensions.y / options.source.dimensions.x;\n this.contentAspectX = options.source.dimensions.x / options.source.dimensions.y;\n\n var scale = 1;\n if ( options.width ) {\n scale = options.width;\n delete options.width;\n\n if ( options.height ) {\n $.console.error( \"specifying both width and height to a tiledImage is not supported\" );\n delete options.height;\n }\n } else if ( options.height ) {\n scale = options.height / this.normHeight;\n delete options.height;\n }\n\n var fitBounds = options.fitBounds;\n delete options.fitBounds;\n var fitBoundsPlacement = options.fitBoundsPlacement || OpenSeadragon.Placement.CENTER;\n delete options.fitBoundsPlacement;\n\n var degrees = options.degrees || 0;\n delete options.degrees;\n\n $.extend( true, this, {\n\n //internal state properties\n viewer: null,\n tilesMatrix: {}, // A '3d' dictionary [level][x][y] --> Tile.\n coverage: {}, // A '3d' dictionary [level][x][y] --> Boolean; shows what areas have been drawn.\n loadingCoverage: {}, // A '3d' dictionary [level][x][y] --> Boolean; shows what areas are loaded or are being loaded/blended.\n lastDrawn: [], // An unordered list of Tiles drawn last frame.\n lastResetTime: 0, // Last time for which the tiledImage was reset.\n _midDraw: false, // Is the tiledImage currently updating the viewport?\n _needsDraw: true, // Does the tiledImage need to update the viewport again?\n _hasOpaqueTile: false, // Do we have even one fully opaque tile?\n _tilesLoading: 0, // The number of pending tile requests.\n //configurable settings\n springStiffness: $.DEFAULT_SETTINGS.springStiffness,\n animationTime: $.DEFAULT_SETTINGS.animationTime,\n minZoomImageRatio: $.DEFAULT_SETTINGS.minZoomImageRatio,\n wrapHorizontal: $.DEFAULT_SETTINGS.wrapHorizontal,\n wrapVertical: $.DEFAULT_SETTINGS.wrapVertical,\n immediateRender: $.DEFAULT_SETTINGS.immediateRender,\n blendTime: $.DEFAULT_SETTINGS.blendTime,\n alwaysBlend: $.DEFAULT_SETTINGS.alwaysBlend,\n minPixelRatio: $.DEFAULT_SETTINGS.minPixelRatio,\n smoothTileEdgesMinZoom: $.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,\n iOSDevice: $.DEFAULT_SETTINGS.iOSDevice,\n debugMode: $.DEFAULT_SETTINGS.debugMode,\n crossOriginPolicy: $.DEFAULT_SETTINGS.crossOriginPolicy,\n ajaxWithCredentials: $.DEFAULT_SETTINGS.ajaxWithCredentials,\n placeholderFillStyle: $.DEFAULT_SETTINGS.placeholderFillStyle,\n opacity: $.DEFAULT_SETTINGS.opacity,\n preload: $.DEFAULT_SETTINGS.preload,\n compositeOperation: $.DEFAULT_SETTINGS.compositeOperation\n }, options );\n\n this._preload = this.preload;\n delete this.preload;\n\n this._fullyLoaded = false;\n\n this._xSpring = new $.Spring({\n initial: x,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n\n this._ySpring = new $.Spring({\n initial: y,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n\n this._scaleSpring = new $.Spring({\n initial: scale,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n\n this._degreesSpring = new $.Spring({\n initial: degrees,\n springStiffness: this.springStiffness,\n animationTime: this.animationTime\n });\n\n this._updateForScale();\n\n if (fitBounds) {\n this.fitBounds(fitBounds, fitBoundsPlacement, true);\n }\n\n // We need a callback to give image manipulation a chance to happen\n this._drawingHandler = function(args) {\n /**\n * This event is fired just before the tile is drawn giving the application a chance to alter the image.\n *\n * NOTE: This event is only fired when the drawer is using a &lt;canvas&gt;.\n *\n * @event tile-drawing\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {OpenSeadragon.Tile} tile - The Tile being drawn.\n * @property {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @property {OpenSeadragon.Tile} context - The HTML canvas context being drawn into.\n * @property {OpenSeadragon.Tile} rendered - The HTML canvas context containing the tile imagery.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n _this.viewer.raiseEvent('tile-drawing', $.extend({\n tiledImage: _this\n }, args));\n };\n};\n\n$.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.TiledImage.prototype */{\n /**\n * @returns {Boolean} Whether the TiledImage needs to be drawn.\n */\n needsDraw: function() {\n return this._needsDraw;\n },\n\n /**\n * @returns {Boolean} Whether all tiles necessary for this TiledImage to draw at the current view have been loaded.\n */\n getFullyLoaded: function() {\n return this._fullyLoaded;\n },\n\n // private\n _setFullyLoaded: function(flag) {\n if (flag === this._fullyLoaded) {\n return;\n }\n\n this._fullyLoaded = flag;\n\n /**\n * Fired when the TiledImage's \"fully loaded\" flag (whether all tiles necessary for this TiledImage\n * to draw at the current view have been loaded) changes.\n *\n * @event fully-loaded-change\n * @memberof OpenSeadragon.TiledImage\n * @type {object}\n * @property {Boolean} fullyLoaded - The new \"fully loaded\" value.\n * @property {OpenSeadragon.TiledImage} eventSource - A reference to the TiledImage which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('fully-loaded-change', {\n fullyLoaded: this._fullyLoaded\n });\n },\n\n /**\n * Clears all tiles and triggers an update on the next call to\n * {@link OpenSeadragon.TiledImage#update}.\n */\n reset: function() {\n this._tileCache.clearTilesFor(this);\n this.lastResetTime = $.now();\n this._needsDraw = true;\n },\n\n /**\n * Updates the TiledImage's bounds, animating if needed.\n * @returns {Boolean} Whether the TiledImage animated.\n */\n update: function() {\n var xUpdated = this._xSpring.update();\n var yUpdated = this._ySpring.update();\n var scaleUpdated = this._scaleSpring.update();\n var degreesUpdated = this._degreesSpring.update();\n\n if (xUpdated || yUpdated || scaleUpdated || degreesUpdated) {\n this._updateForScale();\n this._needsDraw = true;\n return true;\n }\n\n return false;\n },\n\n /**\n * Draws the TiledImage to its Drawer.\n */\n draw: function() {\n if (this.opacity !== 0 || this._preload) {\n this._midDraw = true;\n this._updateViewport();\n this._midDraw = false;\n }\n // Images with opacity 0 should not need to be drawn in future. this._needsDraw = false is set in this._updateViewport() for other images.\n else {\n this._needsDraw = false;\n }\n },\n\n /**\n * Destroy the TiledImage (unload current loaded tiles).\n */\n destroy: function() {\n this.reset();\n },\n\n /**\n * Get this TiledImage's bounds in viewport coordinates.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * false for target location.\n * @returns {OpenSeadragon.Rect} This TiledImage's bounds in viewport coordinates.\n */\n getBounds: function(current) {\n return this.getBoundsNoRotate(current)\n .rotate(this.getRotation(current), this._getRotationPoint(current));\n },\n\n /**\n * Get this TiledImage's bounds in viewport coordinates without taking\n * rotation into account.\n * @param {Boolean} [current=false] - Pass true for the current location;\n * false for target location.\n * @returns {OpenSeadragon.Rect} This TiledImage's bounds in viewport coordinates.\n */\n getBoundsNoRotate: function(current) {\n return current ?\n new $.Rect(\n this._xSpring.current.value,\n this._ySpring.current.value,\n this._worldWidthCurrent,\n this._worldHeightCurrent) :\n new $.Rect(\n this._xSpring.target.value,\n this._ySpring.target.value,\n this._worldWidthTarget,\n this._worldHeightTarget);\n },\n\n // deprecated\n getWorldBounds: function() {\n $.console.error('[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead');\n return this.getBounds();\n },\n\n /**\n * Get the bounds of the displayed part of the tiled image.\n * @param {Boolean} [current=false] Pass true for the current location,\n * false for the target location.\n * @returns {$.Rect} The clipped bounds in viewport coordinates.\n */\n getClippedBounds: function(current) {\n var bounds = this.getBoundsNoRotate(current);\n if (this._clip) {\n var worldWidth = current ?\n this._worldWidthCurrent : this._worldWidthTarget;\n var ratio = worldWidth / this.source.dimensions.x;\n var clip = this._clip.times(ratio);\n bounds = new $.Rect(\n bounds.x + clip.x,\n bounds.y + clip.y,\n clip.width,\n clip.height);\n }\n return bounds.rotate(this.getRotation(current), this._getRotationPoint(current));\n },\n\n /**\n * @returns {OpenSeadragon.Point} This TiledImage's content size, in original pixels.\n */\n getContentSize: function() {\n return new $.Point(this.source.dimensions.x, this.source.dimensions.y);\n },\n\n // private\n _viewportToImageDelta: function( viewerX, viewerY, current ) {\n var scale = (current ? this._scaleSpring.current.value : this._scaleSpring.target.value);\n return new $.Point(viewerX * (this.source.dimensions.x / scale),\n viewerY * ((this.source.dimensions.y * this.contentAspectX) / scale));\n },\n\n /**\n * Translates from OpenSeadragon viewer coordinate system to image coordinate system.\n * This method can be called either by passing X,Y coordinates or an {@link OpenSeadragon.Point}.\n * @param {Number|OpenSeadragon.Point} viewerX - The X coordinate or point in viewport coordinate system.\n * @param {Number} [viewerY] - The Y coordinate in viewport coordinate system.\n * @param {Boolean} [current=false] - Pass true to use the current location; false for target location.\n * @return {OpenSeadragon.Point} A point representing the coordinates in the image.\n */\n viewportToImageCoordinates: function(viewerX, viewerY, current) {\n var point;\n if (viewerX instanceof $.Point) {\n //they passed a point instead of individual components\n current = viewerY;\n point = viewerX;\n } else {\n point = new $.Point(viewerX, viewerY);\n }\n\n point = point.rotate(-this.getRotation(current), this._getRotationPoint(current));\n return current ?\n this._viewportToImageDelta(\n point.x - this._xSpring.current.value,\n point.y - this._ySpring.current.value) :\n this._viewportToImageDelta(\n point.x - this._xSpring.target.value,\n point.y - this._ySpring.target.value);\n },\n\n // private\n _imageToViewportDelta: function( imageX, imageY, current ) {\n var scale = (current ? this._scaleSpring.current.value : this._scaleSpring.target.value);\n return new $.Point((imageX / this.source.dimensions.x) * scale,\n (imageY / this.source.dimensions.y / this.contentAspectX) * scale);\n },\n\n /**\n * Translates from image coordinate system to OpenSeadragon viewer coordinate system\n * This method can be called either by passing X,Y coordinates or an {@link OpenSeadragon.Point}.\n * @param {Number|OpenSeadragon.Point} imageX - The X coordinate or point in image coordinate system.\n * @param {Number} [imageY] - The Y coordinate in image coordinate system.\n * @param {Boolean} [current=false] - Pass true to use the current location; false for target location.\n * @return {OpenSeadragon.Point} A point representing the coordinates in the viewport.\n */\n imageToViewportCoordinates: function(imageX, imageY, current) {\n if (imageX instanceof $.Point) {\n //they passed a point instead of individual components\n current = imageY;\n imageY = imageX.y;\n imageX = imageX.x;\n }\n\n var point = this._imageToViewportDelta(imageX, imageY);\n if (current) {\n point.x += this._xSpring.current.value;\n point.y += this._ySpring.current.value;\n } else {\n point.x += this._xSpring.target.value;\n point.y += this._ySpring.target.value;\n }\n\n return point.rotate(this.getRotation(current), this._getRotationPoint(current));\n },\n\n /**\n * Translates from a rectangle which describes a portion of the image in\n * pixel coordinates to OpenSeadragon viewport rectangle coordinates.\n * This method can be called either by passing X,Y,width,height or an {@link OpenSeadragon.Rect}.\n * @param {Number|OpenSeadragon.Rect} imageX - The left coordinate or rectangle in image coordinate system.\n * @param {Number} [imageY] - The top coordinate in image coordinate system.\n * @param {Number} [pixelWidth] - The width in pixel of the rectangle.\n * @param {Number} [pixelHeight] - The height in pixel of the rectangle.\n * @param {Boolean} [current=false] - Pass true to use the current location; false for target location.\n * @return {OpenSeadragon.Rect} A rect representing the coordinates in the viewport.\n */\n imageToViewportRectangle: function(imageX, imageY, pixelWidth, pixelHeight, current) {\n var rect = imageX;\n if (rect instanceof $.Rect) {\n //they passed a rect instead of individual components\n current = imageY;\n } else {\n rect = new $.Rect(imageX, imageY, pixelWidth, pixelHeight);\n }\n\n var coordA = this.imageToViewportCoordinates(rect.getTopLeft(), current);\n var coordB = this._imageToViewportDelta(rect.width, rect.height, current);\n\n return new $.Rect(\n coordA.x,\n coordA.y,\n coordB.x,\n coordB.y,\n rect.degrees + this.getRotation(current)\n );\n },\n\n /**\n * Translates from a rectangle which describes a portion of\n * the viewport in point coordinates to image rectangle coordinates.\n * This method can be called either by passing X,Y,width,height or an {@link OpenSeadragon.Rect}.\n * @param {Number|OpenSeadragon.Rect} viewerX - The left coordinate or rectangle in viewport coordinate system.\n * @param {Number} [viewerY] - The top coordinate in viewport coordinate system.\n * @param {Number} [pointWidth] - The width in viewport coordinate system.\n * @param {Number} [pointHeight] - The height in viewport coordinate system.\n * @param {Boolean} [current=false] - Pass true to use the current location; false for target location.\n * @return {OpenSeadragon.Rect} A rect representing the coordinates in the image.\n */\n viewportToImageRectangle: function( viewerX, viewerY, pointWidth, pointHeight, current ) {\n var rect = viewerX;\n if (viewerX instanceof $.Rect) {\n //they passed a rect instead of individual components\n current = viewerY;\n } else {\n rect = new $.Rect(viewerX, viewerY, pointWidth, pointHeight);\n }\n\n var coordA = this.viewportToImageCoordinates(rect.getTopLeft(), current);\n var coordB = this._viewportToImageDelta(rect.width, rect.height, current);\n\n return new $.Rect(\n coordA.x,\n coordA.y,\n coordB.x,\n coordB.y,\n rect.degrees - this.getRotation(current)\n );\n },\n\n /**\n * Convert pixel coordinates relative to the viewer element to image\n * coordinates.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n viewerElementToImageCoordinates: function( pixel ) {\n var point = this.viewport.pointFromPixel( pixel, true );\n return this.viewportToImageCoordinates( point );\n },\n\n /**\n * Convert pixel coordinates relative to the image to\n * viewer element coordinates.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n imageToViewerElementCoordinates: function( pixel ) {\n var point = this.imageToViewportCoordinates( pixel );\n return this.viewport.pixelFromPoint( point, true );\n },\n\n /**\n * Convert pixel coordinates relative to the window to image coordinates.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n windowToImageCoordinates: function( pixel ) {\n var viewerCoordinates = pixel.minus(\n OpenSeadragon.getElementPosition( this.viewer.element ));\n return this.viewerElementToImageCoordinates( viewerCoordinates );\n },\n\n /**\n * Convert image coordinates to pixel coordinates relative to the window.\n * @param {OpenSeadragon.Point} pixel\n * @returns {OpenSeadragon.Point}\n */\n imageToWindowCoordinates: function( pixel ) {\n var viewerCoordinates = this.imageToViewerElementCoordinates( pixel );\n return viewerCoordinates.plus(\n OpenSeadragon.getElementPosition( this.viewer.element ));\n },\n\n // private\n // Convert rectangle in viewport coordinates to this tiled image point\n // coordinates (x in [0, 1] and y in [0, aspectRatio])\n _viewportToTiledImageRectangle: function(rect) {\n var scale = this._scaleSpring.current.value;\n rect = rect.rotate(-this.getRotation(true), this._getRotationPoint(true));\n return new $.Rect(\n (rect.x - this._xSpring.current.value) / scale,\n (rect.y - this._ySpring.current.value) / scale,\n rect.width / scale,\n rect.height / scale,\n rect.degrees);\n },\n\n /**\n * Convert a viewport zoom to an image zoom.\n * Image zoom: ratio of the original image size to displayed image size.\n * 1 means original image size, 0.5 half size...\n * Viewport zoom: ratio of the displayed image's width to viewport's width.\n * 1 means identical width, 2 means image's width is twice the viewport's width...\n * @function\n * @param {Number} viewportZoom The viewport zoom\n * @returns {Number} imageZoom The image zoom\n */\n viewportToImageZoom: function( viewportZoom ) {\n var ratio = this._scaleSpring.current.value *\n this.viewport._containerInnerSize.x / this.source.dimensions.x;\n return ratio * viewportZoom;\n },\n\n /**\n * Convert an image zoom to a viewport zoom.\n * Image zoom: ratio of the original image size to displayed image size.\n * 1 means original image size, 0.5 half size...\n * Viewport zoom: ratio of the displayed image's width to viewport's width.\n * 1 means identical width, 2 means image's width is twice the viewport's width...\n * Note: not accurate with multi-image.\n * @function\n * @param {Number} imageZoom The image zoom\n * @returns {Number} viewportZoom The viewport zoom\n */\n imageToViewportZoom: function( imageZoom ) {\n var ratio = this._scaleSpring.current.value *\n this.viewport._containerInnerSize.x / this.source.dimensions.x;\n return imageZoom / ratio;\n },\n\n /**\n * Sets the TiledImage's position in the world.\n * @param {OpenSeadragon.Point} position - The new position, in viewport coordinates.\n * @param {Boolean} [immediately=false] - Whether to animate to the new position or snap immediately.\n * @fires OpenSeadragon.TiledImage.event:bounds-change\n */\n setPosition: function(position, immediately) {\n var sameTarget = (this._xSpring.target.value === position.x &&\n this._ySpring.target.value === position.y);\n\n if (immediately) {\n if (sameTarget && this._xSpring.current.value === position.x &&\n this._ySpring.current.value === position.y) {\n return;\n }\n\n this._xSpring.resetTo(position.x);\n this._ySpring.resetTo(position.y);\n this._needsDraw = true;\n } else {\n if (sameTarget) {\n return;\n }\n\n this._xSpring.springTo(position.x);\n this._ySpring.springTo(position.y);\n this._needsDraw = true;\n }\n\n if (!sameTarget) {\n this._raiseBoundsChange();\n }\n },\n\n /**\n * Sets the TiledImage's width in the world, adjusting the height to match based on aspect ratio.\n * @param {Number} width - The new width, in viewport coordinates.\n * @param {Boolean} [immediately=false] - Whether to animate to the new size or snap immediately.\n * @fires OpenSeadragon.TiledImage.event:bounds-change\n */\n setWidth: function(width, immediately) {\n this._setScale(width, immediately);\n },\n\n /**\n * Sets the TiledImage's height in the world, adjusting the width to match based on aspect ratio.\n * @param {Number} height - The new height, in viewport coordinates.\n * @param {Boolean} [immediately=false] - Whether to animate to the new size or snap immediately.\n * @fires OpenSeadragon.TiledImage.event:bounds-change\n */\n setHeight: function(height, immediately) {\n this._setScale(height / this.normHeight, immediately);\n },\n\n /**\n * Positions and scales the TiledImage to fit in the specified bounds.\n * Note: this method fires OpenSeadragon.TiledImage.event:bounds-change\n * twice\n * @param {OpenSeadragon.Rect} bounds The bounds to fit the image into.\n * @param {OpenSeadragon.Placement} [anchor=OpenSeadragon.Placement.CENTER]\n * How to anchor the image in the bounds.\n * @param {Boolean} [immediately=false] Whether to animate to the new size\n * or snap immediately.\n * @fires OpenSeadragon.TiledImage.event:bounds-change\n */\n fitBounds: function(bounds, anchor, immediately) {\n anchor = anchor || $.Placement.CENTER;\n var anchorProperties = $.Placement.properties[anchor];\n var aspectRatio = this.contentAspectX;\n var xOffset = 0;\n var yOffset = 0;\n var displayedWidthRatio = 1;\n var displayedHeightRatio = 1;\n if (this._clip) {\n aspectRatio = this._clip.getAspectRatio();\n displayedWidthRatio = this._clip.width / this.source.dimensions.x;\n displayedHeightRatio = this._clip.height / this.source.dimensions.y;\n if (bounds.getAspectRatio() > aspectRatio) {\n xOffset = this._clip.x / this._clip.height * bounds.height;\n yOffset = this._clip.y / this._clip.height * bounds.height;\n } else {\n xOffset = this._clip.x / this._clip.width * bounds.width;\n yOffset = this._clip.y / this._clip.width * bounds.width;\n }\n }\n\n if (bounds.getAspectRatio() > aspectRatio) {\n // We will have margins on the X axis\n var height = bounds.height / displayedHeightRatio;\n var marginLeft = 0;\n if (anchorProperties.isHorizontallyCentered) {\n marginLeft = (bounds.width - bounds.height * aspectRatio) / 2;\n } else if (anchorProperties.isRight) {\n marginLeft = bounds.width - bounds.height * aspectRatio;\n }\n this.setPosition(\n new $.Point(bounds.x - xOffset + marginLeft, bounds.y - yOffset),\n immediately);\n this.setHeight(height, immediately);\n } else {\n // We will have margins on the Y axis\n var width = bounds.width / displayedWidthRatio;\n var marginTop = 0;\n if (anchorProperties.isVerticallyCentered) {\n marginTop = (bounds.height - bounds.width / aspectRatio) / 2;\n } else if (anchorProperties.isBottom) {\n marginTop = bounds.height - bounds.width / aspectRatio;\n }\n this.setPosition(\n new $.Point(bounds.x - xOffset, bounds.y - yOffset + marginTop),\n immediately);\n this.setWidth(width, immediately);\n }\n },\n\n /**\n * @returns {OpenSeadragon.Rect|null} The TiledImage's current clip rectangle,\n * in image pixels, or null if none.\n */\n getClip: function() {\n if (this._clip) {\n return this._clip.clone();\n }\n\n return null;\n },\n\n /**\n * @param {OpenSeadragon.Rect|null} newClip - An area, in image pixels, to clip to\n * (portions of the image outside of this area will not be visible). Only works on\n * browsers that support the HTML5 canvas.\n * @fires OpenSeadragon.TiledImage.event:clip-change\n */\n setClip: function(newClip) {\n $.console.assert(!newClip || newClip instanceof $.Rect,\n \"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null\");\n\n if (newClip instanceof $.Rect) {\n this._clip = newClip.clone();\n } else {\n this._clip = null;\n }\n\n this._needsDraw = true;\n /**\n * Raised when the TiledImage's clip is changed.\n * @event clip-change\n * @memberOf OpenSeadragon.TiledImage\n * @type {object}\n * @property {OpenSeadragon.TiledImage} eventSource - A reference to the\n * TiledImage which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('clip-change');\n },\n\n /**\n * @returns {Number} The TiledImage's current opacity.\n */\n getOpacity: function() {\n return this.opacity;\n },\n\n /**\n * @param {Number} opacity Opacity the tiled image should be drawn at.\n * @fires OpenSeadragon.TiledImage.event:opacity-change\n */\n setOpacity: function(opacity) {\n if (opacity === this.opacity) {\n return;\n }\n\n this.opacity = opacity;\n this._needsDraw = true;\n /**\n * Raised when the TiledImage's opacity is changed.\n * @event opacity-change\n * @memberOf OpenSeadragon.TiledImage\n * @type {object}\n * @property {Number} opacity - The new opacity value.\n * @property {OpenSeadragon.TiledImage} eventSource - A reference to the\n * TiledImage which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('opacity-change', {\n opacity: this.opacity\n });\n },\n\n /**\n * @returns {Boolean} whether the tiledImage can load its tiles even when it has zero opacity.\n */\n getPreload: function() {\n return this._preload;\n },\n\n /**\n * Set true to load even when hidden. Set false to block loading when hidden.\n */\n setPreload: function(preload) {\n this._preload = !!preload;\n this._needsDraw = true;\n },\n\n /**\n * Get the rotation of this tiled image in degrees.\n * @param {Boolean} [current=false] True for current rotation, false for target.\n * @returns {Number} the rotation of this tiled image in degrees.\n */\n getRotation: function(current) {\n return current ?\n this._degreesSpring.current.value :\n this._degreesSpring.target.value;\n },\n\n /**\n * Set the current rotation of this tiled image in degrees.\n * @param {Number} degrees the rotation in degrees.\n * @param {Boolean} [immediately=false] Whether to animate to the new angle\n * or rotate immediately.\n * @fires OpenSeadragon.TiledImage.event:bounds-change\n */\n setRotation: function(degrees, immediately) {\n if (this._degreesSpring.target.value === degrees &&\n this._degreesSpring.isAtTargetValue()) {\n return;\n }\n if (immediately) {\n this._degreesSpring.resetTo(degrees);\n } else {\n this._degreesSpring.springTo(degrees);\n }\n this._needsDraw = true;\n this._raiseBoundsChange();\n },\n\n /**\n * Get the point around which this tiled image is rotated\n * @private\n * @param {Boolean} current True for current rotation point, false for target.\n * @returns {OpenSeadragon.Point}\n */\n _getRotationPoint: function(current) {\n return this.getBoundsNoRotate(current).getCenter();\n },\n\n /**\n * @returns {String} The TiledImage's current compositeOperation.\n */\n getCompositeOperation: function() {\n return this.compositeOperation;\n },\n\n /**\n * @param {String} compositeOperation the tiled image should be drawn with this globalCompositeOperation.\n * @fires OpenSeadragon.TiledImage.event:composite-operation-change\n */\n setCompositeOperation: function(compositeOperation) {\n if (compositeOperation === this.compositeOperation) {\n return;\n }\n\n this.compositeOperation = compositeOperation;\n this._needsDraw = true;\n /**\n * Raised when the TiledImage's opacity is changed.\n * @event composite-operation-change\n * @memberOf OpenSeadragon.TiledImage\n * @type {object}\n * @property {String} compositeOperation - The new compositeOperation value.\n * @property {OpenSeadragon.TiledImage} eventSource - A reference to the\n * TiledImage which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('composite-operation-change', {\n compositeOperation: this.compositeOperation\n });\n },\n\n // private\n _setScale: function(scale, immediately) {\n var sameTarget = (this._scaleSpring.target.value === scale);\n if (immediately) {\n if (sameTarget && this._scaleSpring.current.value === scale) {\n return;\n }\n\n this._scaleSpring.resetTo(scale);\n this._updateForScale();\n this._needsDraw = true;\n } else {\n if (sameTarget) {\n return;\n }\n\n this._scaleSpring.springTo(scale);\n this._updateForScale();\n this._needsDraw = true;\n }\n\n if (!sameTarget) {\n this._raiseBoundsChange();\n }\n },\n\n // private\n _updateForScale: function() {\n this._worldWidthTarget = this._scaleSpring.target.value;\n this._worldHeightTarget = this.normHeight * this._scaleSpring.target.value;\n this._worldWidthCurrent = this._scaleSpring.current.value;\n this._worldHeightCurrent = this.normHeight * this._scaleSpring.current.value;\n },\n\n // private\n _raiseBoundsChange: function() {\n /**\n * Raised when the TiledImage's bounds are changed.\n * Note that this event is triggered only when the animation target is changed;\n * not for every frame of animation.\n * @event bounds-change\n * @memberOf OpenSeadragon.TiledImage\n * @type {object}\n * @property {OpenSeadragon.TiledImage} eventSource - A reference to the\n * TiledImage which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('bounds-change');\n },\n\n // private\n _isBottomItem: function() {\n return this.viewer.world.getItemAt(0) === this;\n },\n\n // private\n _getLevelsInterval: function() {\n var lowestLevel = Math.max(\n this.source.minLevel,\n Math.floor(Math.log(this.minZoomImageRatio) / Math.log(2))\n );\n var currentZeroRatio = this.viewport.deltaPixelsFromPointsNoRotate(\n this.source.getPixelRatio(0), true).x *\n this._scaleSpring.current.value;\n var highestLevel = Math.min(\n Math.abs(this.source.maxLevel),\n Math.abs(Math.floor(\n Math.log(currentZeroRatio / this.minPixelRatio) / Math.log(2)\n ))\n );\n\n // Calculations for the interval of levels to draw\n // can return invalid intervals; fix that here if necessary\n highestLevel = Math.max(highestLevel, this.source.minLevel || 0);\n lowestLevel = Math.min(lowestLevel, highestLevel);\n return {\n lowestLevel: lowestLevel,\n highestLevel: highestLevel\n };\n },\n\n /**\n * @private\n * @inner\n * Pretty much every other line in this needs to be documented so it's clear\n * how each piece of this routine contributes to the drawing process. That's\n * why there are so many TODO's inside this function.\n */\n _updateViewport: function() {\n this._needsDraw = false;\n this._tilesLoading = 0;\n this.loadingCoverage = {};\n\n // Reset tile's internal drawn state\n while (this.lastDrawn.length > 0) {\n var tile = this.lastDrawn.pop();\n tile.beingDrawn = false;\n }\n\n var viewport = this.viewport;\n var drawArea = this._viewportToTiledImageRectangle(\n viewport.getBoundsWithMargins(true));\n\n if (!this.wrapHorizontal && !this.wrapVertical) {\n var tiledImageBounds = this._viewportToTiledImageRectangle(\n this.getClippedBounds(true));\n drawArea = drawArea.intersection(tiledImageBounds);\n if (drawArea === null) {\n return;\n }\n }\n\n var levelsInterval = this._getLevelsInterval();\n var lowestLevel = levelsInterval.lowestLevel;\n var highestLevel = levelsInterval.highestLevel;\n var bestTile = null;\n var haveDrawn = false;\n var currentTime = $.now();\n\n // Update any level that will be drawn\n for (var level = highestLevel; level >= lowestLevel; level--) {\n var drawLevel = false;\n\n //Avoid calculations for draw if we have already drawn this\n var currentRenderPixelRatio = viewport.deltaPixelsFromPointsNoRotate(\n this.source.getPixelRatio(level),\n true\n ).x * this._scaleSpring.current.value;\n\n if (level === lowestLevel ||\n (!haveDrawn && currentRenderPixelRatio >= this.minPixelRatio)) {\n drawLevel = true;\n haveDrawn = true;\n } else if (!haveDrawn) {\n continue;\n }\n\n //Perform calculations for draw if we haven't drawn this\n var targetRenderPixelRatio = viewport.deltaPixelsFromPointsNoRotate(\n this.source.getPixelRatio(level),\n false\n ).x * this._scaleSpring.current.value;\n\n var targetZeroRatio = viewport.deltaPixelsFromPointsNoRotate(\n this.source.getPixelRatio(\n Math.max(\n this.source.getClosestLevel(),\n 0\n )\n ),\n false\n ).x * this._scaleSpring.current.value;\n\n var optimalRatio = this.immediateRender ? 1 : targetZeroRatio;\n var levelOpacity = Math.min(1, (currentRenderPixelRatio - 0.5) / 0.5);\n var levelVisibility = optimalRatio / Math.abs(\n optimalRatio - targetRenderPixelRatio\n );\n\n // Update the level and keep track of 'best' tile to load\n bestTile = updateLevel(\n this,\n haveDrawn,\n drawLevel,\n level,\n levelOpacity,\n levelVisibility,\n drawArea,\n currentTime,\n bestTile\n );\n\n // Stop the loop if lower-res tiles would all be covered by\n // already drawn tiles\n if (providesCoverage(this.coverage, level)) {\n break;\n }\n }\n\n // Perform the actual drawing\n drawTiles(this, this.lastDrawn);\n\n // Load the new 'best' tile\n if (bestTile && !bestTile.context2D) {\n loadTile(this, bestTile, currentTime);\n this._needsDraw = true;\n this._setFullyLoaded(false);\n } else {\n this._setFullyLoaded(this._tilesLoading === 0);\n }\n },\n\n // private\n _getCornerTiles: function(level, topLeftBound, bottomRightBound) {\n var leftX;\n var rightX;\n if (this.wrapHorizontal) {\n leftX = $.positiveModulo(topLeftBound.x, 1);\n rightX = $.positiveModulo(bottomRightBound.x, 1);\n } else {\n leftX = Math.max(0, topLeftBound.x);\n rightX = Math.min(1, bottomRightBound.x);\n }\n var topY;\n var bottomY;\n var aspectRatio = 1 / this.source.aspectRatio;\n if (this.wrapVertical) {\n topY = $.positiveModulo(topLeftBound.y, aspectRatio);\n bottomY = $.positiveModulo(bottomRightBound.y, aspectRatio);\n } else {\n topY = Math.max(0, topLeftBound.y);\n bottomY = Math.min(aspectRatio, bottomRightBound.y);\n }\n\n var topLeftTile = this.source.getTileAtPoint(level, new $.Point(leftX, topY));\n var bottomRightTile = this.source.getTileAtPoint(level, new $.Point(rightX, bottomY));\n var numTiles = this.source.getNumTiles(level);\n\n if (this.wrapHorizontal) {\n topLeftTile.x += numTiles.x * Math.floor(topLeftBound.x);\n bottomRightTile.x += numTiles.x * Math.floor(bottomRightBound.x);\n }\n if (this.wrapVertical) {\n topLeftTile.y += numTiles.y * Math.floor(topLeftBound.y / aspectRatio);\n bottomRightTile.y += numTiles.y * Math.floor(bottomRightBound.y / aspectRatio);\n }\n\n return {\n topLeft: topLeftTile,\n bottomRight: bottomRightTile,\n };\n }\n});\n\n/**\n * @private\n * @inner\n * Updates all tiles at a given resolution level.\n * @param {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @param {Boolean} haveDrawn\n * @param {Boolean} drawLevel\n * @param {Number} level\n * @param {Number} levelOpacity\n * @param {Number} levelVisibility\n * @param {OpenSeadragon.Point} viewportTL - The index of the most top-left visible tile.\n * @param {OpenSeadragon.Point} viewportBR - The index of the most bottom-right visible tile.\n * @param {Number} currentTime\n * @param {OpenSeadragon.Tile} best - The current \"best\" tile to draw.\n */\nfunction updateLevel(tiledImage, haveDrawn, drawLevel, level, levelOpacity,\n levelVisibility, drawArea, currentTime, best) {\n\n var topLeftBound = drawArea.getBoundingBox().getTopLeft();\n var bottomRightBound = drawArea.getBoundingBox().getBottomRight();\n\n if (tiledImage.viewer) {\n /**\n * <em>- Needs documentation -</em>\n *\n * @event update-level\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @property {Object} havedrawn\n * @property {Object} level\n * @property {Object} opacity\n * @property {Object} visibility\n * @property {OpenSeadragon.Rect} drawArea\n * @property {Object} topleft deprecated, use drawArea instead\n * @property {Object} bottomright deprecated, use drawArea instead\n * @property {Object} currenttime\n * @property {Object} best\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n tiledImage.viewer.raiseEvent('update-level', {\n tiledImage: tiledImage,\n havedrawn: haveDrawn,\n level: level,\n opacity: levelOpacity,\n visibility: levelVisibility,\n drawArea: drawArea,\n topleft: topLeftBound,\n bottomright: bottomRightBound,\n currenttime: currentTime,\n best: best\n });\n }\n\n resetCoverage(tiledImage.coverage, level);\n resetCoverage(tiledImage.loadingCoverage, level);\n\n //OK, a new drawing so do your calculations\n var cornerTiles = tiledImage._getCornerTiles(level, topLeftBound, bottomRightBound);\n var topLeftTile = cornerTiles.topLeft;\n var bottomRightTile = cornerTiles.bottomRight;\n var numberOfTiles = tiledImage.source.getNumTiles(level);\n\n var viewportCenter = tiledImage.viewport.pixelFromPoint(\n tiledImage.viewport.getCenter());\n for (var x = topLeftTile.x; x <= bottomRightTile.x; x++) {\n for (var y = topLeftTile.y; y <= bottomRightTile.y; y++) {\n\n // Optimisation disabled with wrapping because getTileBounds does not\n // work correctly with x and y outside of the number of tiles\n if (!tiledImage.wrapHorizontal && !tiledImage.wrapVertical) {\n var tileBounds = tiledImage.source.getTileBounds(level, x, y);\n if (drawArea.intersection(tileBounds) === null) {\n // This tile is outside of the viewport, no need to draw it\n continue;\n }\n }\n\n best = updateTile(\n tiledImage,\n drawLevel,\n haveDrawn,\n x, y,\n level,\n levelOpacity,\n levelVisibility,\n viewportCenter,\n numberOfTiles,\n currentTime,\n best\n );\n\n }\n }\n\n return best;\n}\n\n/**\n * @private\n * @inner\n * Update a single tile at a particular resolution level.\n * @param {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @param {Boolean} haveDrawn\n * @param {Boolean} drawLevel\n * @param {Number} x\n * @param {Number} y\n * @param {Number} level\n * @param {Number} levelOpacity\n * @param {Number} levelVisibility\n * @param {OpenSeadragon.Point} viewportCenter\n * @param {Number} numberOfTiles\n * @param {Number} currentTime\n * @param {OpenSeadragon.Tile} best - The current \"best\" tile to draw.\n */\nfunction updateTile( tiledImage, haveDrawn, drawLevel, x, y, level, levelOpacity, levelVisibility, viewportCenter, numberOfTiles, currentTime, best){\n\n var tile = getTile(\n x, y,\n level,\n tiledImage,\n tiledImage.source,\n tiledImage.tilesMatrix,\n currentTime,\n numberOfTiles,\n tiledImage._worldWidthCurrent,\n tiledImage._worldHeightCurrent\n ),\n drawTile = drawLevel;\n\n if( tiledImage.viewer ){\n /**\n * <em>- Needs documentation -</em>\n *\n * @event update-tile\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @property {OpenSeadragon.Tile} tile\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n tiledImage.viewer.raiseEvent( 'update-tile', {\n tiledImage: tiledImage,\n tile: tile\n });\n }\n\n setCoverage( tiledImage.coverage, level, x, y, false );\n\n var loadingCoverage = tile.loaded || tile.loading || isCovered(tiledImage.loadingCoverage, level, x, y);\n setCoverage(tiledImage.loadingCoverage, level, x, y, loadingCoverage);\n\n if ( !tile.exists ) {\n return best;\n }\n\n if ( haveDrawn && !drawTile ) {\n if ( isCovered( tiledImage.coverage, level, x, y ) ) {\n setCoverage( tiledImage.coverage, level, x, y, true );\n } else {\n drawTile = true;\n }\n }\n\n if ( !drawTile ) {\n return best;\n }\n\n positionTile(\n tile,\n tiledImage.source.tileOverlap,\n tiledImage.viewport,\n viewportCenter,\n levelVisibility,\n tiledImage\n );\n\n if (!tile.loaded) {\n if (tile.context2D) {\n setTileLoaded(tiledImage, tile);\n } else {\n var imageRecord = tiledImage._tileCache.getImageRecord(tile.cacheKey);\n if (imageRecord) {\n var image = imageRecord.getImage();\n setTileLoaded(tiledImage, tile, image);\n }\n }\n }\n\n if ( tile.loaded ) {\n var needsDraw = blendTile(\n tiledImage,\n tile,\n x, y,\n level,\n levelOpacity,\n currentTime\n );\n\n if ( needsDraw ) {\n tiledImage._needsDraw = true;\n }\n } else if ( tile.loading ) {\n // the tile is already in the download queue\n tiledImage._tilesLoading++;\n } else if (!loadingCoverage) {\n best = compareTiles( best, tile );\n }\n\n return best;\n}\n\n/**\n * @private\n * @inner\n * Obtains a tile at the given location.\n * @param {Number} x\n * @param {Number} y\n * @param {Number} level\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.TileSource} tileSource\n * @param {Object} tilesMatrix - A '3d' dictionary [level][x][y] --> Tile.\n * @param {Number} time\n * @param {Number} numTiles\n * @param {Number} worldWidth\n * @param {Number} worldHeight\n * @returns {OpenSeadragon.Tile}\n */\nfunction getTile(\n x, y,\n level,\n tiledImage,\n tileSource,\n tilesMatrix,\n time,\n numTiles,\n worldWidth,\n worldHeight\n) {\n var xMod,\n yMod,\n bounds,\n sourceBounds,\n exists,\n url,\n ajaxHeaders,\n context2D,\n tile;\n\n if ( !tilesMatrix[ level ] ) {\n tilesMatrix[ level ] = {};\n }\n if ( !tilesMatrix[ level ][ x ] ) {\n tilesMatrix[ level ][ x ] = {};\n }\n\n if ( !tilesMatrix[ level ][ x ][ y ] ) {\n xMod = ( numTiles.x + ( x % numTiles.x ) ) % numTiles.x;\n yMod = ( numTiles.y + ( y % numTiles.y ) ) % numTiles.y;\n bounds = tileSource.getTileBounds( level, xMod, yMod );\n sourceBounds = tileSource.getTileBounds( level, xMod, yMod, true );\n exists = tileSource.tileExists( level, xMod, yMod );\n url = tileSource.getTileUrl( level, xMod, yMod );\n\n // Headers are only applicable if loadTilesWithAjax is set\n if (tiledImage.loadTilesWithAjax) {\n ajaxHeaders = tileSource.getTileAjaxHeaders( level, xMod, yMod );\n // Combine tile AJAX headers with tiled image AJAX headers (if applicable)\n if ($.isPlainObject(tiledImage.ajaxHeaders)) {\n ajaxHeaders = $.extend({}, tiledImage.ajaxHeaders, ajaxHeaders);\n }\n } else {\n ajaxHeaders = null;\n }\n\n context2D = tileSource.getContext2D ?\n tileSource.getContext2D(level, xMod, yMod) : undefined;\n\n bounds.x += ( x - xMod ) / numTiles.x;\n bounds.y += (worldHeight / worldWidth) * (( y - yMod ) / numTiles.y);\n\n tile = new $.Tile(\n level,\n x,\n y,\n bounds,\n exists,\n url,\n context2D,\n tiledImage.loadTilesWithAjax,\n ajaxHeaders,\n sourceBounds\n );\n\n if (xMod === numTiles.x - 1) {\n tile.isRightMost = true;\n }\n\n if (yMod === numTiles.y - 1) {\n tile.isBottomMost = true;\n }\n\n tilesMatrix[ level ][ x ][ y ] = tile;\n }\n\n tile = tilesMatrix[ level ][ x ][ y ];\n tile.lastTouchTime = time;\n\n return tile;\n}\n\n/**\n * @private\n * @inner\n * Dispatch a job to the ImageLoader to load the Image for a Tile.\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile} tile\n * @param {Number} time\n */\nfunction loadTile( tiledImage, tile, time ) {\n tile.loading = true;\n tiledImage._imageLoader.addJob({\n src: tile.url,\n loadWithAjax: tile.loadWithAjax,\n ajaxHeaders: tile.ajaxHeaders,\n crossOriginPolicy: tiledImage.crossOriginPolicy,\n ajaxWithCredentials: tiledImage.ajaxWithCredentials,\n callback: function( image, errorMsg, tileRequest ){\n onTileLoad( tiledImage, tile, time, image, errorMsg, tileRequest );\n },\n abort: function() {\n tile.loading = false;\n }\n });\n}\n\n/**\n * @private\n * @inner\n * Callback fired when a Tile's Image finished downloading.\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile} tile\n * @param {Number} time\n * @param {Image} image\n * @param {String} errorMsg\n * @param {XMLHttpRequest} tileRequest\n */\nfunction onTileLoad( tiledImage, tile, time, image, errorMsg, tileRequest ) {\n if ( !image ) {\n $.console.log( \"Tile %s failed to load: %s - error: %s\", tile, tile.url, errorMsg );\n /**\n * Triggered when a tile fails to load.\n *\n * @event tile-load-failed\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Tile} tile - The tile that failed to load.\n * @property {OpenSeadragon.TiledImage} tiledImage - The tiled image the tile belongs to.\n * @property {number} time - The time in milliseconds when the tile load began.\n * @property {string} message - The error message.\n * @property {XMLHttpRequest} tileRequest - The XMLHttpRequest used to load the tile if available.\n */\n tiledImage.viewer.raiseEvent(\"tile-load-failed\", {\n tile: tile,\n tiledImage: tiledImage,\n time: time,\n message: errorMsg,\n tileRequest: tileRequest\n });\n tile.loading = false;\n tile.exists = false;\n return;\n }\n\n if ( time < tiledImage.lastResetTime ) {\n $.console.log( \"Ignoring tile %s loaded before reset: %s\", tile, tile.url );\n tile.loading = false;\n return;\n }\n\n var finish = function() {\n var cutoff = tiledImage.source.getClosestLevel();\n setTileLoaded(tiledImage, tile, image, cutoff, tileRequest);\n };\n\n // Check if we're mid-update; this can happen on IE8 because image load events for\n // cached images happen immediately there\n if ( !tiledImage._midDraw ) {\n finish();\n } else {\n // Wait until after the update, in case caching unloads any tiles\n window.setTimeout( finish, 1);\n }\n}\n\n/**\n * @private\n * @inner\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile} tile\n * @param {Image} image\n * @param {Number} cutoff\n */\nfunction setTileLoaded(tiledImage, tile, image, cutoff, tileRequest) {\n var increment = 0;\n\n function getCompletionCallback() {\n increment++;\n return completionCallback;\n }\n\n function completionCallback() {\n increment--;\n if (increment === 0) {\n tile.loading = false;\n tile.loaded = true;\n if (!tile.context2D) {\n tiledImage._tileCache.cacheTile({\n image: image,\n tile: tile,\n cutoff: cutoff,\n tiledImage: tiledImage\n });\n }\n tiledImage._needsDraw = true;\n }\n }\n\n /**\n * Triggered when a tile has just been loaded in memory. That means that the\n * image has been downloaded and can be modified before being drawn to the canvas.\n *\n * @event tile-loaded\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {Image} image - The image of the tile.\n * @property {OpenSeadragon.TiledImage} tiledImage - The tiled image of the loaded tile.\n * @property {OpenSeadragon.Tile} tile - The tile which has been loaded.\n * @property {XMLHttpRequest} tiledImage - The AJAX request that loaded this tile (if applicable).\n * @property {function} getCompletionCallback - A function giving a callback to call\n * when the asynchronous processing of the image is done. The image will be\n * marked as entirely loaded when the callback has been called once for each\n * call to getCompletionCallback.\n */\n tiledImage.viewer.raiseEvent(\"tile-loaded\", {\n tile: tile,\n tiledImage: tiledImage,\n tileRequest: tileRequest,\n image: image,\n getCompletionCallback: getCompletionCallback\n });\n // In case the completion callback is never called, we at least force it once.\n getCompletionCallback()();\n}\n\n/**\n * @private\n * @inner\n * @param {OpenSeadragon.Tile} tile\n * @param {Boolean} overlap\n * @param {OpenSeadragon.Viewport} viewport\n * @param {OpenSeadragon.Point} viewportCenter\n * @param {Number} levelVisibility\n * @param {OpenSeadragon.TiledImage} tiledImage\n */\nfunction positionTile( tile, overlap, viewport, viewportCenter, levelVisibility, tiledImage ){\n var boundsTL = tile.bounds.getTopLeft();\n\n boundsTL.x *= tiledImage._scaleSpring.current.value;\n boundsTL.y *= tiledImage._scaleSpring.current.value;\n boundsTL.x += tiledImage._xSpring.current.value;\n boundsTL.y += tiledImage._ySpring.current.value;\n\n var boundsSize = tile.bounds.getSize();\n\n boundsSize.x *= tiledImage._scaleSpring.current.value;\n boundsSize.y *= tiledImage._scaleSpring.current.value;\n\n var positionC = viewport.pixelFromPointNoRotate(boundsTL, true),\n positionT = viewport.pixelFromPointNoRotate(boundsTL, false),\n sizeC = viewport.deltaPixelsFromPointsNoRotate(boundsSize, true),\n sizeT = viewport.deltaPixelsFromPointsNoRotate(boundsSize, false),\n tileCenter = positionT.plus( sizeT.divide( 2 ) ),\n tileSquaredDistance = viewportCenter.squaredDistanceTo( tileCenter );\n\n if ( !overlap ) {\n sizeC = sizeC.plus( new $.Point( 1, 1 ) );\n }\n\n if (tile.isRightMost && tiledImage.wrapHorizontal) {\n sizeC.x += 0.75; // Otherwise Firefox and Safari show seams\n }\n\n if (tile.isBottomMost && tiledImage.wrapVertical) {\n sizeC.y += 0.75; // Otherwise Firefox and Safari show seams\n }\n\n tile.position = positionC;\n tile.size = sizeC;\n tile.squaredDistance = tileSquaredDistance;\n tile.visibility = levelVisibility;\n}\n\n/**\n * @private\n * @inner\n * Updates the opacity of a tile according to the time it has been on screen\n * to perform a fade-in.\n * Updates coverage once a tile is fully opaque.\n * Returns whether the fade-in has completed.\n *\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile} tile\n * @param {Number} x\n * @param {Number} y\n * @param {Number} level\n * @param {Number} levelOpacity\n * @param {Number} currentTime\n * @returns {Boolean}\n */\nfunction blendTile( tiledImage, tile, x, y, level, levelOpacity, currentTime ){\n var blendTimeMillis = 1000 * tiledImage.blendTime,\n deltaTime,\n opacity;\n\n if ( !tile.blendStart ) {\n tile.blendStart = currentTime;\n }\n\n deltaTime = currentTime - tile.blendStart;\n opacity = blendTimeMillis ? Math.min( 1, deltaTime / ( blendTimeMillis ) ) : 1;\n\n if ( tiledImage.alwaysBlend ) {\n opacity *= levelOpacity;\n }\n\n tile.opacity = opacity;\n\n tiledImage.lastDrawn.push( tile );\n\n if ( opacity === 1 ) {\n setCoverage( tiledImage.coverage, level, x, y, true );\n tiledImage._hasOpaqueTile = true;\n } else if ( deltaTime < blendTimeMillis ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @private\n * @inner\n * Returns true if the given tile provides coverage to lower-level tiles of\n * lower resolution representing the same content. If neither x nor y is\n * given, returns true if the entire visible level provides coverage.\n *\n * Note that out-of-bounds tiles provide coverage in this sense, since\n * there's no content that they would need to cover. Tiles at non-existent\n * levels that are within the image bounds, however, do not.\n *\n * @param {Object} coverage - A '3d' dictionary [level][x][y] --> Boolean.\n * @param {Number} level - The resolution level of the tile.\n * @param {Number} x - The X position of the tile.\n * @param {Number} y - The Y position of the tile.\n * @returns {Boolean}\n */\nfunction providesCoverage( coverage, level, x, y ) {\n var rows,\n cols,\n i, j;\n\n if ( !coverage[ level ] ) {\n return false;\n }\n\n if ( x === undefined || y === undefined ) {\n rows = coverage[ level ];\n for ( i in rows ) {\n if ( rows.hasOwnProperty( i ) ) {\n cols = rows[ i ];\n for ( j in cols ) {\n if ( cols.hasOwnProperty( j ) && !cols[ j ] ) {\n return false;\n }\n }\n }\n }\n\n return true;\n }\n\n return (\n coverage[ level ][ x] === undefined ||\n coverage[ level ][ x ][ y ] === undefined ||\n coverage[ level ][ x ][ y ] === true\n );\n}\n\n/**\n * @private\n * @inner\n * Returns true if the given tile is completely covered by higher-level\n * tiles of higher resolution representing the same content. If neither x\n * nor y is given, returns true if the entire visible level is covered.\n *\n * @param {Object} coverage - A '3d' dictionary [level][x][y] --> Boolean.\n * @param {Number} level - The resolution level of the tile.\n * @param {Number} x - The X position of the tile.\n * @param {Number} y - The Y position of the tile.\n * @returns {Boolean}\n */\nfunction isCovered( coverage, level, x, y ) {\n if ( x === undefined || y === undefined ) {\n return providesCoverage( coverage, level + 1 );\n } else {\n return (\n providesCoverage( coverage, level + 1, 2 * x, 2 * y ) &&\n providesCoverage( coverage, level + 1, 2 * x, 2 * y + 1 ) &&\n providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y ) &&\n providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y + 1 )\n );\n }\n}\n\n/**\n * @private\n * @inner\n * Sets whether the given tile provides coverage or not.\n *\n * @param {Object} coverage - A '3d' dictionary [level][x][y] --> Boolean.\n * @param {Number} level - The resolution level of the tile.\n * @param {Number} x - The X position of the tile.\n * @param {Number} y - The Y position of the tile.\n * @param {Boolean} covers - Whether the tile provides coverage.\n */\nfunction setCoverage( coverage, level, x, y, covers ) {\n if ( !coverage[ level ] ) {\n $.console.warn(\n \"Setting coverage for a tile before its level's coverage has been reset: %s\",\n level\n );\n return;\n }\n\n if ( !coverage[ level ][ x ] ) {\n coverage[ level ][ x ] = {};\n }\n\n coverage[ level ][ x ][ y ] = covers;\n}\n\n/**\n * @private\n * @inner\n * Resets coverage information for the given level. This should be called\n * after every draw routine. Note that at the beginning of the next draw\n * routine, coverage for every visible tile should be explicitly set.\n *\n * @param {Object} coverage - A '3d' dictionary [level][x][y] --> Boolean.\n * @param {Number} level - The resolution level of tiles to completely reset.\n */\nfunction resetCoverage( coverage, level ) {\n coverage[ level ] = {};\n}\n\n/**\n * @private\n * @inner\n * Determines whether the 'last best' tile for the area is better than the\n * tile in question.\n *\n * @param {OpenSeadragon.Tile} previousBest\n * @param {OpenSeadragon.Tile} tile\n * @returns {OpenSeadragon.Tile} The new best tile.\n */\nfunction compareTiles( previousBest, tile ) {\n if ( !previousBest ) {\n return tile;\n }\n\n if ( tile.visibility > previousBest.visibility ) {\n return tile;\n } else if ( tile.visibility == previousBest.visibility ) {\n if ( tile.squaredDistance < previousBest.squaredDistance ) {\n return tile;\n }\n }\n\n return previousBest;\n}\n\n/**\n * @private\n * @inner\n * Draws a TiledImage.\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile[]} lastDrawn - An unordered list of Tiles drawn last frame.\n */\nfunction drawTiles( tiledImage, lastDrawn ) {\n if (tiledImage.opacity === 0 || (lastDrawn.length === 0 && !tiledImage.placeholderFillStyle)) {\n return;\n }\n\n var tile = lastDrawn[0];\n var useSketch;\n\n if (tile) {\n useSketch = tiledImage.opacity < 1 ||\n (tiledImage.compositeOperation &&\n tiledImage.compositeOperation !== 'source-over') ||\n (!tiledImage._isBottomItem() && tile._hasTransparencyChannel());\n }\n\n var sketchScale;\n var sketchTranslate;\n\n var zoom = tiledImage.viewport.getZoom(true);\n var imageZoom = tiledImage.viewportToImageZoom(zoom);\n\n if (lastDrawn.length > 1 &&\n imageZoom > tiledImage.smoothTileEdgesMinZoom &&\n !tiledImage.iOSDevice &&\n tiledImage.getRotation(true) % 360 === 0 && // TODO: support tile edge smoothing with tiled image rotation.\n $.supportsCanvas) {\n // When zoomed in a lot (>100%) the tile edges are visible.\n // So we have to composite them at ~100% and scale them up together.\n // Note: Disabled on iOS devices per default as it causes a native crash\n useSketch = true;\n sketchScale = tile.getScaleForEdgeSmoothing();\n sketchTranslate = tile.getTranslationForEdgeSmoothing(sketchScale,\n tiledImage._drawer.getCanvasSize(false),\n tiledImage._drawer.getCanvasSize(true));\n }\n\n var bounds;\n if (useSketch) {\n if (!sketchScale) {\n // Except when edge smoothing, we only clean the part of the\n // sketch canvas we are going to use for performance reasons.\n bounds = tiledImage.viewport.viewportToViewerElementRectangle(\n tiledImage.getClippedBounds(true))\n .getIntegerBoundingBox()\n .times($.pixelDensityRatio);\n\n if(tiledImage._drawer.viewer.viewport.getFlip()) {\n if (tiledImage.viewport.degrees !== 0 || tiledImage.getRotation(true) % 360 !== 0){\n bounds.x = tiledImage._drawer.viewer.container.clientWidth - (bounds.x + bounds.width);\n }\n }\n }\n tiledImage._drawer._clear(true, bounds);\n }\n\n // When scaling, we must rotate only when blending the sketch canvas to\n // avoid interpolation\n if (!sketchScale) {\n if (tiledImage.viewport.degrees !== 0) {\n tiledImage._drawer._offsetForRotation({\n degrees: tiledImage.viewport.degrees,\n useSketch: useSketch\n });\n }\n if (tiledImage.getRotation(true) % 360 !== 0) {\n tiledImage._drawer._offsetForRotation({\n degrees: tiledImage.getRotation(true),\n point: tiledImage.viewport.pixelFromPointNoRotate(\n tiledImage._getRotationPoint(true), true),\n useSketch: useSketch\n });\n }\n\n if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){\n if(tiledImage._drawer.viewer.viewport.getFlip()) {\n tiledImage._drawer._flip();\n }\n }\n }\n\n var usedClip = false;\n if ( tiledImage._clip ) {\n tiledImage._drawer.saveContext(useSketch);\n\n var box = tiledImage.imageToViewportRectangle(tiledImage._clip, true);\n box = box.rotate(-tiledImage.getRotation(true), tiledImage._getRotationPoint(true));\n var clipRect = tiledImage._drawer.viewportToDrawerRectangle(box);\n if (sketchScale) {\n clipRect = clipRect.times(sketchScale);\n }\n if (sketchTranslate) {\n clipRect = clipRect.translate(sketchTranslate);\n }\n tiledImage._drawer.setClip(clipRect, useSketch);\n\n usedClip = true;\n }\n\n if ( tiledImage.placeholderFillStyle && tiledImage._hasOpaqueTile === false ) {\n var placeholderRect = tiledImage._drawer.viewportToDrawerRectangle(tiledImage.getBounds(true));\n if (sketchScale) {\n placeholderRect = placeholderRect.times(sketchScale);\n }\n if (sketchTranslate) {\n placeholderRect = placeholderRect.translate(sketchTranslate);\n }\n\n var fillStyle = null;\n if ( typeof tiledImage.placeholderFillStyle === \"function\" ) {\n fillStyle = tiledImage.placeholderFillStyle(tiledImage, tiledImage._drawer.context);\n }\n else {\n fillStyle = tiledImage.placeholderFillStyle;\n }\n\n tiledImage._drawer.drawRectangle(placeholderRect, fillStyle, useSketch);\n }\n\n for (var i = lastDrawn.length - 1; i >= 0; i--) {\n tile = lastDrawn[ i ];\n tiledImage._drawer.drawTile( tile, tiledImage._drawingHandler, useSketch, sketchScale, sketchTranslate );\n tile.beingDrawn = true;\n\n if( tiledImage.viewer ){\n /**\n * <em>- Needs documentation -</em>\n *\n * @event tile-drawn\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.\n * @property {OpenSeadragon.TiledImage} tiledImage - Which TiledImage is being drawn.\n * @property {OpenSeadragon.Tile} tile\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n tiledImage.viewer.raiseEvent( 'tile-drawn', {\n tiledImage: tiledImage,\n tile: tile\n });\n }\n }\n\n if ( usedClip ) {\n tiledImage._drawer.restoreContext( useSketch );\n }\n\n if (!sketchScale) {\n if (tiledImage.getRotation(true) % 360 !== 0) {\n tiledImage._drawer._restoreRotationChanges(useSketch);\n }\n if (tiledImage.viewport.degrees !== 0) {\n tiledImage._drawer._restoreRotationChanges(useSketch);\n }\n }\n\n if (useSketch) {\n if (sketchScale) {\n if (tiledImage.viewport.degrees !== 0) {\n tiledImage._drawer._offsetForRotation({\n degrees: tiledImage.viewport.degrees,\n useSketch: false\n });\n }\n if (tiledImage.getRotation(true) % 360 !== 0) {\n tiledImage._drawer._offsetForRotation({\n degrees: tiledImage.getRotation(true),\n point: tiledImage.viewport.pixelFromPointNoRotate(\n tiledImage._getRotationPoint(true), true),\n useSketch: false\n });\n }\n }\n tiledImage._drawer.blendSketch({\n opacity: tiledImage.opacity,\n scale: sketchScale,\n translate: sketchTranslate,\n compositeOperation: tiledImage.compositeOperation,\n bounds: bounds\n });\n if (sketchScale) {\n if (tiledImage.getRotation(true) % 360 !== 0) {\n tiledImage._drawer._restoreRotationChanges(false);\n }\n if (tiledImage.viewport.degrees !== 0) {\n tiledImage._drawer._restoreRotationChanges(false);\n }\n }\n }\n\n if (!sketchScale) {\n if (tiledImage.viewport.degrees === 0 && tiledImage.getRotation(true) % 360 === 0){\n if(tiledImage._drawer.viewer.viewport.getFlip()) {\n tiledImage._drawer._flip();\n }\n }\n }\n\n drawDebugInfo( tiledImage, lastDrawn );\n}\n\n/**\n * @private\n * @inner\n * Draws special debug information for a TiledImage if in debug mode.\n * @param {OpenSeadragon.TiledImage} tiledImage\n * @param {OpenSeadragon.Tile[]} lastDrawn - An unordered list of Tiles drawn last frame.\n */\nfunction drawDebugInfo( tiledImage, lastDrawn ) {\n if( tiledImage.debugMode ) {\n for ( var i = lastDrawn.length - 1; i >= 0; i-- ) {\n var tile = lastDrawn[ i ];\n try {\n tiledImage._drawer.drawDebugInfo(\n tile, lastDrawn.length, i, tiledImage);\n } catch(e) {\n $.console.error(e);\n }\n }\n }\n}\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - TileCache\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n// private class\nvar TileRecord = function( options ) {\n $.console.assert( options, \"[TileCache.cacheTile] options is required\" );\n $.console.assert( options.tile, \"[TileCache.cacheTile] options.tile is required\" );\n $.console.assert( options.tiledImage, \"[TileCache.cacheTile] options.tiledImage is required\" );\n this.tile = options.tile;\n this.tiledImage = options.tiledImage;\n};\n\n// private class\nvar ImageRecord = function(options) {\n $.console.assert( options, \"[ImageRecord] options is required\" );\n $.console.assert( options.image, \"[ImageRecord] options.image is required\" );\n this._image = options.image;\n this._tiles = [];\n};\n\nImageRecord.prototype = {\n destroy: function() {\n this._image = null;\n this._renderedContext = null;\n this._tiles = null;\n },\n\n getImage: function() {\n return this._image;\n },\n\n getRenderedContext: function() {\n if (!this._renderedContext) {\n var canvas = document.createElement( 'canvas' );\n canvas.width = this._image.width;\n canvas.height = this._image.height;\n this._renderedContext = canvas.getContext('2d');\n this._renderedContext.drawImage( this._image, 0, 0 );\n //since we are caching the prerendered image on a canvas\n //allow the image to not be held in memory\n this._image = null;\n }\n return this._renderedContext;\n },\n\n setRenderedContext: function(renderedContext) {\n $.console.error(\"ImageRecord.setRenderedContext is deprecated. \" +\n \"The rendered context should be created by the ImageRecord \" +\n \"itself when calling ImageRecord.getRenderedContext.\");\n this._renderedContext = renderedContext;\n },\n\n addTile: function(tile) {\n $.console.assert(tile, '[ImageRecord.addTile] tile is required');\n this._tiles.push(tile);\n },\n\n removeTile: function(tile) {\n for (var i = 0; i < this._tiles.length; i++) {\n if (this._tiles[i] === tile) {\n this._tiles.splice(i, 1);\n return;\n }\n }\n\n $.console.warn('[ImageRecord.removeTile] trying to remove unknown tile', tile);\n },\n\n getTileCount: function() {\n return this._tiles.length;\n }\n};\n\n/**\n * @class TileCache\n * @memberof OpenSeadragon\n * @classdesc Stores all the tiles displayed in a {@link OpenSeadragon.Viewer}.\n * You generally won't have to interact with the TileCache directly.\n * @param {Object} options - Configuration for this TileCache.\n * @param {Number} [options.maxImageCacheCount] - See maxImageCacheCount in\n * {@link OpenSeadragon.Options} for details.\n */\n$.TileCache = function( options ) {\n options = options || {};\n\n this._maxImageCacheCount = options.maxImageCacheCount || $.DEFAULT_SETTINGS.maxImageCacheCount;\n this._tilesLoaded = [];\n this._imagesLoaded = [];\n this._imagesLoadedCount = 0;\n};\n\n/** @lends OpenSeadragon.TileCache.prototype */\n$.TileCache.prototype = {\n /**\n * @returns {Number} The total number of tiles that have been loaded by\n * this TileCache.\n */\n numTilesLoaded: function() {\n return this._tilesLoaded.length;\n },\n\n /**\n * Caches the specified tile, removing an old tile if necessary to stay under the\n * maxImageCacheCount specified on construction. Note that if multiple tiles reference\n * the same image, there may be more tiles than maxImageCacheCount; the goal is to keep\n * the number of images below that number. Note, as well, that even the number of images\n * may temporarily surpass that number, but should eventually come back down to the max specified.\n * @param {Object} options - Tile info.\n * @param {OpenSeadragon.Tile} options.tile - The tile to cache.\n * @param {String} options.tile.cacheKey - The unique key used to identify this tile in the cache.\n * @param {Image} options.image - The image of the tile to cache.\n * @param {OpenSeadragon.TiledImage} options.tiledImage - The TiledImage that owns that tile.\n * @param {Number} [options.cutoff=0] - If adding this tile goes over the cache max count, this\n * function will release an old tile. The cutoff option specifies a tile level at or below which\n * tiles will not be released.\n */\n cacheTile: function( options ) {\n $.console.assert( options, \"[TileCache.cacheTile] options is required\" );\n $.console.assert( options.tile, \"[TileCache.cacheTile] options.tile is required\" );\n $.console.assert( options.tile.cacheKey, \"[TileCache.cacheTile] options.tile.cacheKey is required\" );\n $.console.assert( options.tiledImage, \"[TileCache.cacheTile] options.tiledImage is required\" );\n\n var cutoff = options.cutoff || 0;\n var insertionIndex = this._tilesLoaded.length;\n\n var imageRecord = this._imagesLoaded[options.tile.cacheKey];\n if (!imageRecord) {\n $.console.assert( options.image, \"[TileCache.cacheTile] options.image is required to create an ImageRecord\" );\n imageRecord = this._imagesLoaded[options.tile.cacheKey] = new ImageRecord({\n image: options.image\n });\n\n this._imagesLoadedCount++;\n }\n\n imageRecord.addTile(options.tile);\n options.tile.cacheImageRecord = imageRecord;\n\n // Note that just because we're unloading a tile doesn't necessarily mean\n // we're unloading an image. With repeated calls it should sort itself out, though.\n if ( this._imagesLoadedCount > this._maxImageCacheCount ) {\n var worstTile = null;\n var worstTileIndex = -1;\n var worstTileRecord = null;\n var prevTile, worstTime, worstLevel, prevTime, prevLevel, prevTileRecord;\n\n for ( var i = this._tilesLoaded.length - 1; i >= 0; i-- ) {\n prevTileRecord = this._tilesLoaded[ i ];\n prevTile = prevTileRecord.tile;\n\n if ( prevTile.level <= cutoff || prevTile.beingDrawn ) {\n continue;\n } else if ( !worstTile ) {\n worstTile = prevTile;\n worstTileIndex = i;\n worstTileRecord = prevTileRecord;\n continue;\n }\n\n prevTime = prevTile.lastTouchTime;\n worstTime = worstTile.lastTouchTime;\n prevLevel = prevTile.level;\n worstLevel = worstTile.level;\n\n if ( prevTime < worstTime ||\n ( prevTime == worstTime && prevLevel > worstLevel ) ) {\n worstTile = prevTile;\n worstTileIndex = i;\n worstTileRecord = prevTileRecord;\n }\n }\n\n if ( worstTile && worstTileIndex >= 0 ) {\n this._unloadTile(worstTileRecord);\n insertionIndex = worstTileIndex;\n }\n }\n\n this._tilesLoaded[ insertionIndex ] = new TileRecord({\n tile: options.tile,\n tiledImage: options.tiledImage\n });\n },\n\n /**\n * Clears all tiles associated with the specified tiledImage.\n * @param {OpenSeadragon.TiledImage} tiledImage\n */\n clearTilesFor: function( tiledImage ) {\n $.console.assert(tiledImage, '[TileCache.clearTilesFor] tiledImage is required');\n var tileRecord;\n for ( var i = 0; i < this._tilesLoaded.length; ++i ) {\n tileRecord = this._tilesLoaded[ i ];\n if ( tileRecord.tiledImage === tiledImage ) {\n this._unloadTile(tileRecord);\n this._tilesLoaded.splice( i, 1 );\n i--;\n }\n }\n },\n\n // private\n getImageRecord: function(cacheKey) {\n $.console.assert(cacheKey, '[TileCache.getImageRecord] cacheKey is required');\n return this._imagesLoaded[cacheKey];\n },\n\n // private\n _unloadTile: function(tileRecord) {\n $.console.assert(tileRecord, '[TileCache._unloadTile] tileRecord is required');\n var tile = tileRecord.tile;\n var tiledImage = tileRecord.tiledImage;\n\n tile.unload();\n tile.cacheImageRecord = null;\n\n var imageRecord = this._imagesLoaded[tile.cacheKey];\n imageRecord.removeTile(tile);\n if (!imageRecord.getTileCount()) {\n imageRecord.destroy();\n delete this._imagesLoaded[tile.cacheKey];\n this._imagesLoadedCount--;\n }\n\n /**\n * Triggered when a tile has just been unloaded from memory.\n *\n * @event tile-unloaded\n * @memberof OpenSeadragon.Viewer\n * @type {object}\n * @property {OpenSeadragon.TiledImage} tiledImage - The tiled image of the unloaded tile.\n * @property {OpenSeadragon.Tile} tile - The tile which has been unloaded.\n */\n tiledImage.viewer.raiseEvent(\"tile-unloaded\", {\n tile: tile,\n tiledImage: tiledImage\n });\n }\n};\n\n}( OpenSeadragon ));\n\n/*\n * OpenSeadragon - World\n *\n * Copyright (C) 2009 CodePlex Foundation\n * Copyright (C) 2010-2013 OpenSeadragon contributors\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * - Neither the name of CodePlex Foundation nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function( $ ){\n\n/**\n * @class World\n * @memberof OpenSeadragon\n * @extends OpenSeadragon.EventSource\n * @classdesc Keeps track of all of the tiled images in the scene.\n * @param {Object} options - World options.\n * @param {OpenSeadragon.Viewer} options.viewer - The Viewer that owns this World.\n **/\n$.World = function( options ) {\n var _this = this;\n\n $.console.assert( options.viewer, \"[World] options.viewer is required\" );\n\n $.EventSource.call( this );\n\n this.viewer = options.viewer;\n this._items = [];\n this._needsDraw = false;\n this._autoRefigureSizes = true;\n this._needsSizesFigured = false;\n this._delegatedFigureSizes = function(event) {\n if (_this._autoRefigureSizes) {\n _this._figureSizes();\n } else {\n _this._needsSizesFigured = true;\n }\n };\n\n this._figureSizes();\n};\n\n$.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.World.prototype */{\n /**\n * Add the specified item.\n * @param {OpenSeadragon.TiledImage} item - The item to add.\n * @param {Number} [options.index] - Index for the item. If not specified, goes at the top.\n * @fires OpenSeadragon.World.event:add-item\n * @fires OpenSeadragon.World.event:metrics-change\n */\n addItem: function( item, options ) {\n $.console.assert(item, \"[World.addItem] item is required\");\n $.console.assert(item instanceof $.TiledImage, \"[World.addItem] only TiledImages supported at this time\");\n\n options = options || {};\n if (options.index !== undefined) {\n var index = Math.max(0, Math.min(this._items.length, options.index));\n this._items.splice(index, 0, item);\n } else {\n this._items.push( item );\n }\n\n if (this._autoRefigureSizes) {\n this._figureSizes();\n } else {\n this._needsSizesFigured = true;\n }\n\n this._needsDraw = true;\n\n item.addHandler('bounds-change', this._delegatedFigureSizes);\n item.addHandler('clip-change', this._delegatedFigureSizes);\n\n /**\n * Raised when an item is added to the World.\n * @event add-item\n * @memberOf OpenSeadragon.World\n * @type {object}\n * @property {OpenSeadragon.Viewer} eventSource - A reference to the World which raised the event.\n * @property {OpenSeadragon.TiledImage} item - The item that has been added.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'add-item', {\n item: item\n } );\n },\n\n /**\n * Get the item at the specified index.\n * @param {Number} index - The item's index.\n * @returns {OpenSeadragon.TiledImage} The item at the specified index.\n */\n getItemAt: function( index ) {\n $.console.assert(index !== undefined, \"[World.getItemAt] index is required\");\n return this._items[ index ];\n },\n\n /**\n * Get the index of the given item or -1 if not present.\n * @param {OpenSeadragon.TiledImage} item - The item.\n * @returns {Number} The index of the item or -1 if not present.\n */\n getIndexOfItem: function( item ) {\n $.console.assert(item, \"[World.getIndexOfItem] item is required\");\n return $.indexOf( this._items, item );\n },\n\n /**\n * @returns {Number} The number of items used.\n */\n getItemCount: function() {\n return this._items.length;\n },\n\n /**\n * Change the index of a item so that it appears over or under others.\n * @param {OpenSeadragon.TiledImage} item - The item to move.\n * @param {Number} index - The new index.\n * @fires OpenSeadragon.World.event:item-index-change\n */\n setItemIndex: function( item, index ) {\n $.console.assert(item, \"[World.setItemIndex] item is required\");\n $.console.assert(index !== undefined, \"[World.setItemIndex] index is required\");\n\n var oldIndex = this.getIndexOfItem( item );\n\n if ( index >= this._items.length ) {\n throw new Error( \"Index bigger than number of layers.\" );\n }\n\n if ( index === oldIndex || oldIndex === -1 ) {\n return;\n }\n\n this._items.splice( oldIndex, 1 );\n this._items.splice( index, 0, item );\n this._needsDraw = true;\n\n /**\n * Raised when the order of the indexes has been changed.\n * @event item-index-change\n * @memberOf OpenSeadragon.World\n * @type {object}\n * @property {OpenSeadragon.World} eventSource - A reference to the World which raised the event.\n * @property {OpenSeadragon.TiledImage} item - The item whose index has\n * been changed\n * @property {Number} previousIndex - The previous index of the item\n * @property {Number} newIndex - The new index of the item\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'item-index-change', {\n item: item,\n previousIndex: oldIndex,\n newIndex: index\n } );\n },\n\n /**\n * Remove an item.\n * @param {OpenSeadragon.TiledImage} item - The item to remove.\n * @fires OpenSeadragon.World.event:remove-item\n * @fires OpenSeadragon.World.event:metrics-change\n */\n removeItem: function( item ) {\n $.console.assert(item, \"[World.removeItem] item is required\");\n\n var index = $.indexOf(this._items, item );\n if ( index === -1 ) {\n return;\n }\n\n item.removeHandler('bounds-change', this._delegatedFigureSizes);\n item.removeHandler('clip-change', this._delegatedFigureSizes);\n item.destroy();\n this._items.splice( index, 1 );\n this._figureSizes();\n this._needsDraw = true;\n this._raiseRemoveItem(item);\n },\n\n /**\n * Remove all items.\n * @fires OpenSeadragon.World.event:remove-item\n * @fires OpenSeadragon.World.event:metrics-change\n */\n removeAll: function() {\n // We need to make sure any pending images are canceled so the world items don't get messed up\n this.viewer._cancelPendingImages();\n var item;\n var i;\n for (i = 0; i < this._items.length; i++) {\n item = this._items[i];\n item.removeHandler('bounds-change', this._delegatedFigureSizes);\n item.removeHandler('clip-change', this._delegatedFigureSizes);\n item.destroy();\n }\n\n var removedItems = this._items;\n this._items = [];\n this._figureSizes();\n this._needsDraw = true;\n\n for (i = 0; i < removedItems.length; i++) {\n item = removedItems[i];\n this._raiseRemoveItem(item);\n }\n },\n\n /**\n * Clears all tiles and triggers updates for all items.\n */\n resetItems: function() {\n for ( var i = 0; i < this._items.length; i++ ) {\n this._items[i].reset();\n }\n },\n\n /**\n * Updates (i.e. animates bounds of) all items.\n */\n update: function() {\n var animated = false;\n for ( var i = 0; i < this._items.length; i++ ) {\n animated = this._items[i].update() || animated;\n }\n\n return animated;\n },\n\n /**\n * Draws all items.\n */\n draw: function() {\n for ( var i = 0; i < this._items.length; i++ ) {\n this._items[i].draw();\n }\n\n this._needsDraw = false;\n },\n\n /**\n * @returns {Boolean} true if any items need updating.\n */\n needsDraw: function() {\n for ( var i = 0; i < this._items.length; i++ ) {\n if ( this._items[i].needsDraw() ) {\n return true;\n }\n }\n return this._needsDraw;\n },\n\n /**\n * @returns {OpenSeadragon.Rect} The smallest rectangle that encloses all items, in viewport coordinates.\n */\n getHomeBounds: function() {\n return this._homeBounds.clone();\n },\n\n /**\n * To facilitate zoom constraints, we keep track of the pixel density of the\n * densest item in the World (i.e. the item whose content size to viewport size\n * ratio is the highest) and save it as this \"content factor\".\n * @returns {Number} the number of content units per viewport unit.\n */\n getContentFactor: function() {\n return this._contentFactor;\n },\n\n /**\n * As a performance optimization, setting this flag to false allows the bounds-change event handler\n * on tiledImages to skip calculations on the world bounds. If a lot of images are going to be positioned in\n * rapid succession, this is a good idea. When finished, setAutoRefigureSizes should be called with true\n * or the system may behave oddly.\n * @param {Boolean} [value] The value to which to set the flag.\n */\n setAutoRefigureSizes: function(value) {\n this._autoRefigureSizes = value;\n if (value & this._needsSizesFigured) {\n this._figureSizes();\n this._needsSizesFigured = false;\n }\n },\n\n /**\n * Arranges all of the TiledImages with the specified settings.\n * @param {Object} options - Specifies how to arrange.\n * @param {Boolean} [options.immediately=false] - Whether to animate to the new arrangement.\n * @param {String} [options.layout] - See collectionLayout in {@link OpenSeadragon.Options}.\n * @param {Number} [options.rows] - See collectionRows in {@link OpenSeadragon.Options}.\n * @param {Number} [options.columns] - See collectionColumns in {@link OpenSeadragon.Options}.\n * @param {Number} [options.tileSize] - See collectionTileSize in {@link OpenSeadragon.Options}.\n * @param {Number} [options.tileMargin] - See collectionTileMargin in {@link OpenSeadragon.Options}.\n * @fires OpenSeadragon.World.event:metrics-change\n */\n arrange: function(options) {\n options = options || {};\n var immediately = options.immediately || false;\n var layout = options.layout || $.DEFAULT_SETTINGS.collectionLayout;\n var rows = options.rows || $.DEFAULT_SETTINGS.collectionRows;\n var columns = options.columns || $.DEFAULT_SETTINGS.collectionColumns;\n var tileSize = options.tileSize || $.DEFAULT_SETTINGS.collectionTileSize;\n var tileMargin = options.tileMargin || $.DEFAULT_SETTINGS.collectionTileMargin;\n var increment = tileSize + tileMargin;\n var wrap;\n if (!options.rows && columns) {\n wrap = columns;\n } else {\n wrap = Math.ceil(this._items.length / rows);\n }\n var x = 0;\n var y = 0;\n var item, box, width, height, position;\n\n this.setAutoRefigureSizes(false);\n for (var i = 0; i < this._items.length; i++) {\n if (i && (i % wrap) === 0) {\n if (layout === 'horizontal') {\n y += increment;\n x = 0;\n } else {\n x += increment;\n y = 0;\n }\n }\n\n item = this._items[i];\n box = item.getBounds();\n if (box.width > box.height) {\n width = tileSize;\n } else {\n width = tileSize * (box.width / box.height);\n }\n\n height = width * (box.height / box.width);\n position = new $.Point(x + ((tileSize - width) / 2),\n y + ((tileSize - height) / 2));\n\n item.setPosition(position, immediately);\n item.setWidth(width, immediately);\n\n if (layout === 'horizontal') {\n x += increment;\n } else {\n y += increment;\n }\n }\n this.setAutoRefigureSizes(true);\n },\n\n // private\n _figureSizes: function() {\n var oldHomeBounds = this._homeBounds ? this._homeBounds.clone() : null;\n var oldContentSize = this._contentSize ? this._contentSize.clone() : null;\n var oldContentFactor = this._contentFactor || 0;\n\n if (!this._items.length) {\n this._homeBounds = new $.Rect(0, 0, 1, 1);\n this._contentSize = new $.Point(1, 1);\n this._contentFactor = 1;\n } else {\n var item = this._items[0];\n var bounds = item.getBounds();\n this._contentFactor = item.getContentSize().x / bounds.width;\n var clippedBounds = item.getClippedBounds().getBoundingBox();\n var left = clippedBounds.x;\n var top = clippedBounds.y;\n var right = clippedBounds.x + clippedBounds.width;\n var bottom = clippedBounds.y + clippedBounds.height;\n for (var i = 1; i < this._items.length; i++) {\n item = this._items[i];\n bounds = item.getBounds();\n this._contentFactor = Math.max(this._contentFactor,\n item.getContentSize().x / bounds.width);\n clippedBounds = item.getClippedBounds().getBoundingBox();\n left = Math.min(left, clippedBounds.x);\n top = Math.min(top, clippedBounds.y);\n right = Math.max(right, clippedBounds.x + clippedBounds.width);\n bottom = Math.max(bottom, clippedBounds.y + clippedBounds.height);\n }\n\n this._homeBounds = new $.Rect(left, top, right - left, bottom - top);\n this._contentSize = new $.Point(\n this._homeBounds.width * this._contentFactor,\n this._homeBounds.height * this._contentFactor);\n }\n\n if (this._contentFactor !== oldContentFactor ||\n !this._homeBounds.equals(oldHomeBounds) ||\n !this._contentSize.equals(oldContentSize)) {\n /**\n * Raised when the home bounds or content factor change.\n * @event metrics-change\n * @memberOf OpenSeadragon.World\n * @type {object}\n * @property {OpenSeadragon.World} eventSource - A reference to the World which raised the event.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent('metrics-change', {});\n }\n },\n\n // private\n _raiseRemoveItem: function(item) {\n /**\n * Raised when an item is removed.\n * @event remove-item\n * @memberOf OpenSeadragon.World\n * @type {object}\n * @property {OpenSeadragon.World} eventSource - A reference to the World which raised the event.\n * @property {OpenSeadragon.TiledImage} item - The item's underlying item.\n * @property {?Object} userData - Arbitrary subscriber-defined object.\n */\n this.raiseEvent( 'remove-item', { item: item } );\n }\n});\n\n}( OpenSeadragon ));\n\n//# sourceMappingURL=openseadragon.js.map","/*!\n * Bootstrap v4.4.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :\n typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :\n (global = global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper));\n}(this, (function (exports, $, Popper) { 'use strict';\n\n $ = $ && $.hasOwnProperty('default') ? $['default'] : $;\n Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n }\n\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n var hrefAttr = element.getAttribute('href');\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';\n }\n\n try {\n return document.querySelector(selector) ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var transitionDelay = $(element).css('transition-delay');\n var floatTransitionDuration = parseFloat(transitionDuration);\n var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n },\n findShadowRoot: function findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it'll return the document\n\n\n if (typeof element.getRootNode === 'function') {\n var root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don't find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return Util.findShadowRoot(element.parentNode);\n },\n jQueryDetection: function jQueryDetection() {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.');\n }\n\n var version = $.fn.jquery.split(' ')[0].split('.');\n var minMajor = 1;\n var ltMajor = 2;\n var minMinor = 9;\n var minPatch = 1;\n var maxMajor = 4;\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');\n }\n }\n };\n Util.jQueryDetection();\n setTransitionEndSupport();\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME = 'alert';\n var VERSION = '4.4.1';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Selector = {\n DISMISS: '[data-dismiss=\"alert\"]'\n };\n var Event = {\n CLOSE: \"close\" + EVENT_KEY,\n CLOSED: \"closed\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n ALERT: 'alert',\n FADE: 'fade',\n SHOW: 'show'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Alert =\n /*#__PURE__*/\n function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n } // Private\n ;\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n if (!parent) {\n parent = $(element).closest(\".\" + ClassName.ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $.Event(Event.CLOSE);\n $(element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $(element).removeClass(ClassName.SHOW);\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $(element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $(element).detach().trigger(Event.CLOSED).remove();\n } // Static\n ;\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface;\n $.fn[NAME].Constructor = Alert;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$1 = 'button';\n var VERSION$1 = '4.4.1';\n var DATA_KEY$1 = 'bs.button';\n var EVENT_KEY$1 = \".\" + DATA_KEY$1;\n var DATA_API_KEY$1 = '.data-api';\n var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];\n var ClassName$1 = {\n ACTIVE: 'active',\n BUTTON: 'btn',\n FOCUS: 'focus'\n };\n var Selector$1 = {\n DATA_TOGGLE_CARROT: '[data-toggle^=\"button\"]',\n DATA_TOGGLES: '[data-toggle=\"buttons\"]',\n DATA_TOGGLE: '[data-toggle=\"button\"]',\n DATA_TOGGLES_BUTTONS: '[data-toggle=\"buttons\"] .btn',\n INPUT: 'input:not([type=\"hidden\"])',\n ACTIVE: '.active',\n BUTTON: '.btn'\n };\n var Event$1 = {\n CLICK_DATA_API: \"click\" + EVENT_KEY$1 + DATA_API_KEY$1,\n FOCUS_BLUR_DATA_API: \"focus\" + EVENT_KEY$1 + DATA_API_KEY$1 + \" \" + (\"blur\" + EVENT_KEY$1 + DATA_API_KEY$1),\n LOAD_DATA_API: \"load\" + EVENT_KEY$1 + DATA_API_KEY$1\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Button =\n /*#__PURE__*/\n function () {\n function Button(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLES)[0];\n\n if (rootElement) {\n var input = this._element.querySelector(Selector$1.INPUT);\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = rootElement.querySelector(Selector$1.ACTIVE);\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName$1.ACTIVE);\n }\n }\n } else if (input.type === 'checkbox') {\n if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName$1.ACTIVE)) {\n triggerChangeEvent = false;\n }\n } else {\n // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input\n triggerChangeEvent = false;\n }\n\n if (triggerChangeEvent) {\n input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);\n $(input).trigger('change');\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName$1.ACTIVE);\n }\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$1);\n this._element = null;\n } // Static\n ;\n\n Button._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$1);\n\n if (!data) {\n data = new Button(this);\n $(this).data(DATA_KEY$1, data);\n }\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$1;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {\n var button = event.target;\n\n if (!$(button).hasClass(ClassName$1.BUTTON)) {\n button = $(button).closest(Selector$1.BUTTON)[0];\n }\n\n if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {\n event.preventDefault(); // work around Firefox bug #1540995\n } else {\n var inputBtn = button.querySelector(Selector$1.INPUT);\n\n if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {\n event.preventDefault(); // work around Firefox bug #1540995\n\n return;\n }\n\n Button._jQueryInterface.call($(button), 'toggle');\n }\n }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {\n var button = $(event.target).closest(Selector$1.BUTTON)[0];\n $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));\n });\n $(window).on(Event$1.LOAD_DATA_API, function () {\n // ensure correct active class is set to match the controls' actual values/states\n // find all checkboxes/readio buttons inside data-toggle groups\n var buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLES_BUTTONS));\n\n for (var i = 0, len = buttons.length; i < len; i++) {\n var button = buttons[i];\n var input = button.querySelector(Selector$1.INPUT);\n\n if (input.checked || input.hasAttribute('checked')) {\n button.classList.add(ClassName$1.ACTIVE);\n } else {\n button.classList.remove(ClassName$1.ACTIVE);\n }\n } // find all button toggles\n\n\n buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLE));\n\n for (var _i = 0, _len = buttons.length; _i < _len; _i++) {\n var _button = buttons[_i];\n\n if (_button.getAttribute('aria-pressed') === 'true') {\n _button.classList.add(ClassName$1.ACTIVE);\n } else {\n _button.classList.remove(ClassName$1.ACTIVE);\n }\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$1] = Button._jQueryInterface;\n $.fn[NAME$1].Constructor = Button;\n\n $.fn[NAME$1].noConflict = function () {\n $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;\n return Button._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$2 = 'carousel';\n var VERSION$2 = '4.4.1';\n var DATA_KEY$2 = 'bs.carousel';\n var EVENT_KEY$2 = \".\" + DATA_KEY$2;\n var DATA_API_KEY$2 = '.data-api';\n var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var SWIPE_THRESHOLD = 40;\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n };\n var Direction = {\n NEXT: 'next',\n PREV: 'prev',\n LEFT: 'left',\n RIGHT: 'right'\n };\n var Event$2 = {\n SLIDE: \"slide\" + EVENT_KEY$2,\n SLID: \"slid\" + EVENT_KEY$2,\n KEYDOWN: \"keydown\" + EVENT_KEY$2,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$2,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$2,\n TOUCHSTART: \"touchstart\" + EVENT_KEY$2,\n TOUCHMOVE: \"touchmove\" + EVENT_KEY$2,\n TOUCHEND: \"touchend\" + EVENT_KEY$2,\n POINTERDOWN: \"pointerdown\" + EVENT_KEY$2,\n POINTERUP: \"pointerup\" + EVENT_KEY$2,\n DRAG_START: \"dragstart\" + EVENT_KEY$2,\n LOAD_DATA_API: \"load\" + EVENT_KEY$2 + DATA_API_KEY$2,\n CLICK_DATA_API: \"click\" + EVENT_KEY$2 + DATA_API_KEY$2\n };\n var ClassName$2 = {\n CAROUSEL: 'carousel',\n ACTIVE: 'active',\n SLIDE: 'slide',\n RIGHT: 'carousel-item-right',\n LEFT: 'carousel-item-left',\n NEXT: 'carousel-item-next',\n PREV: 'carousel-item-prev',\n ITEM: 'carousel-item',\n POINTER_EVENT: 'pointer-event'\n };\n var Selector$2 = {\n ACTIVE: '.active',\n ACTIVE_ITEM: '.active.carousel-item',\n ITEM: '.carousel-item',\n ITEM_IMG: '.carousel-item img',\n NEXT_PREV: '.carousel-item-next, .carousel-item-prev',\n INDICATORS: '.carousel-indicators',\n DATA_SLIDE: '[data-slide], [data-slide-to]',\n DATA_RIDE: '[data-ride=\"carousel\"]'\n };\n var PointerType = {\n TOUCH: 'touch',\n PEN: 'pen'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Carousel =\n /*#__PURE__*/\n function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._element = element;\n this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (this._element.querySelector(Selector$2.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $(this._element).one(Event$2.SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $(this._element).off(EVENT_KEY$2);\n $.removeData(this._element, DATA_KEY$2);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, Default, {}, config);\n Util.typeCheckConfig(NAME$2, config, DefaultType);\n return config;\n };\n\n _proto._handleSwipe = function _handleSwipe() {\n var absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n var direction = absDeltax / this.touchDeltaX;\n this.touchDeltaX = 0; // swipe left\n\n if (direction > 0) {\n this.prev();\n } // swipe right\n\n\n if (direction < 0) {\n this.next();\n }\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $(this._element).on(Event$2.KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $(this._element).on(Event$2.MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(Event$2.MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners();\n }\n };\n\n _proto._addTouchEventListeners = function _addTouchEventListeners() {\n var _this3 = this;\n\n if (!this._touchSupported) {\n return;\n }\n\n var start = function start(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchStartX = event.originalEvent.clientX;\n } else if (!_this3._pointerEvent) {\n _this3.touchStartX = event.originalEvent.touches[0].clientX;\n }\n };\n\n var move = function move(event) {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n _this3.touchDeltaX = 0;\n } else {\n _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;\n }\n };\n\n var end = function end(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;\n }\n\n _this3._handleSwipe();\n\n if (_this3._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n _this3.pause();\n\n if (_this3.touchTimeout) {\n clearTimeout(_this3.touchTimeout);\n }\n\n _this3.touchTimeout = setTimeout(function (event) {\n return _this3.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);\n }\n };\n\n $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {\n return e.preventDefault();\n });\n\n if (this._pointerEvent) {\n $(this._element).on(Event$2.POINTERDOWN, function (event) {\n return start(event);\n });\n $(this._element).on(Event$2.POINTERUP, function (event) {\n return end(event);\n });\n\n this._element.classList.add(ClassName$2.POINTER_EVENT);\n } else {\n $(this._element).on(Event$2.TOUCHSTART, function (event) {\n return start(event);\n });\n $(this._element).on(Event$2.TOUCHMOVE, function (event) {\n return move(event);\n });\n $(this._element).on(Event$2.TOUCHEND, function (event) {\n return end(event);\n });\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === Direction.NEXT;\n var isPrevDirection = direction === Direction.PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === Direction.PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));\n\n var slideEvent = $.Event(Event$2.SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $(this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));\n $(indicators).removeClass(ClassName$2.ACTIVE);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName$2.ACTIVE);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this4 = this;\n\n var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName$2.LEFT;\n orderClassName = ClassName$2.NEXT;\n eventDirectionName = Direction.LEFT;\n } else {\n directionalClassName = ClassName$2.RIGHT;\n orderClassName = ClassName$2.PREV;\n eventDirectionName = Direction.RIGHT;\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $.Event(Event$2.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($(this._element).hasClass(ClassName$2.SLIDE)) {\n $(nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $(activeElement).addClass(directionalClassName);\n $(nextElement).addClass(directionalClassName);\n var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);\n\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = nextElementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $(activeElement).one(Util.TRANSITION_END, function () {\n $(nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(ClassName$2.ACTIVE);\n $(activeElement).removeClass(ClassName$2.ACTIVE + \" \" + orderClassName + \" \" + directionalClassName);\n _this4._isSliding = false;\n setTimeout(function () {\n return $(_this4._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $(activeElement).removeClass(ClassName$2.ACTIVE);\n $(nextElement).addClass(ClassName$2.ACTIVE);\n this._isSliding = false;\n $(this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n } // Static\n ;\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$2);\n\n var _config = _objectSpread2({}, Default, {}, $(this).data());\n\n if (typeof config === 'object') {\n _config = _objectSpread2({}, _config, {}, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $(this).data(DATA_KEY$2, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $(selector)[0];\n\n if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {\n return;\n }\n\n var config = _objectSpread2({}, $(target).data(), {}, $(this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($(target), config);\n\n if (slideIndex) {\n $(target).data(DATA_KEY$2).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$2;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);\n $(window).on(Event$2.LOAD_DATA_API, function () {\n var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));\n\n for (var i = 0, len = carousels.length; i < len; i++) {\n var $carousel = $(carousels[i]);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$2] = Carousel._jQueryInterface;\n $.fn[NAME$2].Constructor = Carousel;\n\n $.fn[NAME$2].noConflict = function () {\n $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;\n return Carousel._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$3 = 'collapse';\n var VERSION$3 = '4.4.1';\n var DATA_KEY$3 = 'bs.collapse';\n var EVENT_KEY$3 = \".\" + DATA_KEY$3;\n var DATA_API_KEY$3 = '.data-api';\n var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];\n var Default$1 = {\n toggle: true,\n parent: ''\n };\n var DefaultType$1 = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var Event$3 = {\n SHOW: \"show\" + EVENT_KEY$3,\n SHOWN: \"shown\" + EVENT_KEY$3,\n HIDE: \"hide\" + EVENT_KEY$3,\n HIDDEN: \"hidden\" + EVENT_KEY$3,\n CLICK_DATA_API: \"click\" + EVENT_KEY$3 + DATA_API_KEY$3\n };\n var ClassName$3 = {\n SHOW: 'show',\n COLLAPSE: 'collapse',\n COLLAPSING: 'collapsing',\n COLLAPSED: 'collapsed'\n };\n var Dimension = {\n WIDTH: 'width',\n HEIGHT: 'height'\n };\n var Selector$3 = {\n ACTIVES: '.show, .collapsing',\n DATA_TOGGLE: '[data-toggle=\"collapse\"]'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Collapse =\n /*#__PURE__*/\n function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = [].slice.call(document.querySelectorAll(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));\n\n for (var i = 0, len = toggleList.length; i < len; i++) {\n var elem = toggleList[i];\n var selector = Util.getSelectorFromElement(elem);\n var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {\n return foundElem === element;\n });\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($(this._element).hasClass(ClassName$3.SHOW)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {\n if (typeof _this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === _this._config.parent;\n }\n\n return elem.classList.contains(ClassName$3.COLLAPSE);\n });\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY$3);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $.Event(Event$3.SHOW);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $(actives).data(DATA_KEY$3, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length) {\n $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $(_this._element).trigger(Event$3.SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {\n return;\n }\n\n var startEvent = $.Event(Event$3.HIDE);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);\n var triggerArrayLength = this._triggerArray.length;\n\n if (triggerArrayLength > 0) {\n for (var i = 0; i < triggerArrayLength; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $([].slice.call(document.querySelectorAll(selector)));\n\n if (!$elem.hasClass(ClassName$3.SHOW)) {\n $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$3);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, Default$1, {}, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME$3, config, DefaultType$1);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $(this._element).hasClass(Dimension.WIDTH);\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = document.querySelector(this._config.parent);\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n var children = [].slice.call(parent.querySelectorAll(selector));\n $(children).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n var isOpen = $(element).hasClass(ClassName$3.SHOW);\n\n if (triggerArray.length) {\n $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n } // Static\n ;\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY$3);\n\n var _config = _objectSpread2({}, Default$1, {}, $this.data(), {}, typeof config === 'object' && config ? config : {});\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $this.data(DATA_KEY$3, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$3;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$1;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $(this);\n var selector = Util.getSelectorFromElement(this);\n var selectors = [].slice.call(document.querySelectorAll(selector));\n $(selectors).each(function () {\n var $target = $(this);\n var data = $target.data(DATA_KEY$3);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$3] = Collapse._jQueryInterface;\n $.fn[NAME$3].Constructor = Collapse;\n\n $.fn[NAME$3].noConflict = function () {\n $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;\n return Collapse._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$4 = 'dropdown';\n var VERSION$4 = '4.4.1';\n var DATA_KEY$4 = 'bs.dropdown';\n var EVENT_KEY$4 = \".\" + DATA_KEY$4;\n var DATA_API_KEY$4 = '.data-api';\n var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var Event$4 = {\n HIDE: \"hide\" + EVENT_KEY$4,\n HIDDEN: \"hidden\" + EVENT_KEY$4,\n SHOW: \"show\" + EVENT_KEY$4,\n SHOWN: \"shown\" + EVENT_KEY$4,\n CLICK: \"click\" + EVENT_KEY$4,\n CLICK_DATA_API: \"click\" + EVENT_KEY$4 + DATA_API_KEY$4,\n KEYDOWN_DATA_API: \"keydown\" + EVENT_KEY$4 + DATA_API_KEY$4,\n KEYUP_DATA_API: \"keyup\" + EVENT_KEY$4 + DATA_API_KEY$4\n };\n var ClassName$4 = {\n DISABLED: 'disabled',\n SHOW: 'show',\n DROPUP: 'dropup',\n DROPRIGHT: 'dropright',\n DROPLEFT: 'dropleft',\n MENURIGHT: 'dropdown-menu-right',\n MENULEFT: 'dropdown-menu-left',\n POSITION_STATIC: 'position-static'\n };\n var Selector$4 = {\n DATA_TOGGLE: '[data-toggle=\"dropdown\"]',\n FORM_CHILD: '.dropdown form',\n MENU: '.dropdown-menu',\n NAVBAR_NAV: '.navbar-nav',\n VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n };\n var AttachmentMap = {\n TOP: 'top-start',\n TOPEND: 'top-end',\n BOTTOM: 'bottom-start',\n BOTTOMEND: 'bottom-end',\n RIGHT: 'right-start',\n RIGHTEND: 'right-end',\n LEFT: 'left-start',\n LEFTEND: 'left-end'\n };\n var Default$2 = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic',\n popperConfig: null\n };\n var DefaultType$2 = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string',\n popperConfig: '(null|object)'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Dropdown =\n /*#__PURE__*/\n function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {\n return;\n }\n\n var isActive = $(this._menu).hasClass(ClassName$4.SHOW);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n this.show(true);\n };\n\n _proto.show = function show(usePopper) {\n if (usePopper === void 0) {\n usePopper = false;\n }\n\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $.Event(Event$4.SHOW, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar && usePopper) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName$4.POSITION_STATIC);\n }\n\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $(this._menu).toggleClass(ClassName$4.SHOW);\n $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));\n };\n\n _proto.hide = function hide() {\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var hideEvent = $.Event(Event$4.HIDE, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n $(this._menu).toggleClass(ClassName$4.SHOW);\n $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$4);\n $(this._element).off(EVENT_KEY$4);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Private\n ;\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $(this._element).on(Event$4.CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config);\n Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n if (parent) {\n this._menu = parent.querySelector(Selector$4.MENU);\n }\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $(this._element.parentNode);\n var placement = AttachmentMap.BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {\n placement = AttachmentMap.TOP;\n\n if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {\n placement = AttachmentMap.TOPEND;\n }\n } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT;\n } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {\n placement = AttachmentMap.LEFT;\n } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0;\n };\n\n _proto._getOffset = function _getOffset() {\n var _this2 = this;\n\n var offset = {};\n\n if (typeof this._config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});\n return data;\n };\n } else {\n offset.offset = this._config.offset;\n }\n\n return offset;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }; // Disable Popper.js if we have a static display\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);\n } // Static\n ;\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$4);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $(this).data(DATA_KEY$4, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));\n\n for (var i = 0, len = toggles.length; i < len; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $(toggles[i]).data(DATA_KEY$4);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$(parent).hasClass(ClassName$4.SHOW)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $.Event(Event$4.HIDE, relatedTarget);\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n\n if (context._popper) {\n context._popper.destroy();\n }\n\n $(dropdownMenu).removeClass(ClassName$4.SHOW);\n $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n return parent || element.parentNode;\n } // eslint-disable-next-line complexity\n ;\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $(parent).hasClass(ClassName$4.SHOW);\n\n if (!isActive && event.which === ESCAPE_KEYCODE) {\n return;\n }\n\n if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);\n $(toggle).trigger('focus');\n }\n\n $(this).trigger('click');\n return;\n }\n\n var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)).filter(function (item) {\n return $(item).is(':visible');\n });\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$4;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$2;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$2;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + \" \" + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($(this), 'toggle');\n }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$4] = Dropdown._jQueryInterface;\n $.fn[NAME$4].Constructor = Dropdown;\n\n $.fn[NAME$4].noConflict = function () {\n $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;\n return Dropdown._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$5 = 'modal';\n var VERSION$5 = '4.4.1';\n var DATA_KEY$5 = 'bs.modal';\n var EVENT_KEY$5 = \".\" + DATA_KEY$5;\n var DATA_API_KEY$5 = '.data-api';\n var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];\n var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default$3 = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType$3 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var Event$5 = {\n HIDE: \"hide\" + EVENT_KEY$5,\n HIDE_PREVENTED: \"hidePrevented\" + EVENT_KEY$5,\n HIDDEN: \"hidden\" + EVENT_KEY$5,\n SHOW: \"show\" + EVENT_KEY$5,\n SHOWN: \"shown\" + EVENT_KEY$5,\n FOCUSIN: \"focusin\" + EVENT_KEY$5,\n RESIZE: \"resize\" + EVENT_KEY$5,\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY$5,\n KEYDOWN_DISMISS: \"keydown.dismiss\" + EVENT_KEY$5,\n MOUSEUP_DISMISS: \"mouseup.dismiss\" + EVENT_KEY$5,\n MOUSEDOWN_DISMISS: \"mousedown.dismiss\" + EVENT_KEY$5,\n CLICK_DATA_API: \"click\" + EVENT_KEY$5 + DATA_API_KEY$5\n };\n var ClassName$5 = {\n SCROLLABLE: 'modal-dialog-scrollable',\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n SHOW: 'show',\n STATIC: 'modal-static'\n };\n var Selector$5 = {\n DIALOG: '.modal-dialog',\n MODAL_BODY: '.modal-body',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT: '.sticky-top'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Modal =\n /*#__PURE__*/\n function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = element.querySelector(Selector$5.DIALOG);\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n if ($(this._element).hasClass(ClassName$5.FADE)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $.Event(Event$5.SHOW, {\n relatedTarget: relatedTarget\n });\n $(this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {\n $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {\n if ($(event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n var hideEvent = $.Event(Event$5.HIDE);\n $(this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $(this._element).hasClass(ClassName$5.FADE);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(document).off(Event$5.FOCUSIN);\n $(this._element).removeClass(ClassName$5.SHOW);\n $(this._element).off(Event$5.CLICK_DISMISS);\n $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n [window, this._element, this._dialog].forEach(function (htmlElement) {\n return $(htmlElement).off(EVENT_KEY$5);\n });\n /**\n * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `Event.CLICK_DATA_API` event that should remain\n */\n\n $(document).off(Event$5.FOCUSIN);\n $.removeData(this._element, DATA_KEY$5);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._isTransitioning = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, Default$3, {}, config);\n Util.typeCheckConfig(NAME$5, config, DefaultType$3);\n return config;\n };\n\n _proto._triggerBackdropTransition = function _triggerBackdropTransition() {\n var _this3 = this;\n\n if (this._config.backdrop === 'static') {\n var hideEventPrevented = $.Event(Event$5.HIDE_PREVENTED);\n $(this._element).trigger(hideEventPrevented);\n\n if (hideEventPrevented.defaultPrevented) {\n return;\n }\n\n this._element.classList.add(ClassName$5.STATIC);\n\n var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, function () {\n _this3._element.classList.remove(ClassName$5.STATIC);\n }).emulateTransitionEnd(modalTransitionDuration);\n\n this._element.focus();\n } else {\n this.hide();\n }\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this4 = this;\n\n var transition = $(this._element).hasClass(ClassName$5.FADE);\n var modalBody = this._dialog ? this._dialog.querySelector(Selector$5.MODAL_BODY) : null;\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE) && modalBody) {\n modalBody.scrollTop = 0;\n } else {\n this._element.scrollTop = 0;\n }\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $(this._element).addClass(ClassName$5.SHOW);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $.Event(Event$5.SHOWN, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this4._config.focus) {\n _this4._element.focus();\n }\n\n _this4._isTransitioning = false;\n $(_this4._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this5 = this;\n\n $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop\n .on(Event$5.FOCUSIN, function (event) {\n if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {\n _this5._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this6 = this;\n\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {\n if (event.which === ESCAPE_KEYCODE$1) {\n _this6._triggerBackdropTransition();\n }\n });\n } else if (!this._isShown) {\n $(this._element).off(Event$5.KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this7 = this;\n\n if (this._isShown) {\n $(window).on(Event$5.RESIZE, function (event) {\n return _this7.handleUpdate(event);\n });\n } else {\n $(window).off(Event$5.RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this8 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $(document.body).removeClass(ClassName$5.OPEN);\n\n _this8._resetAdjustments();\n\n _this8._resetScrollbar();\n\n $(_this8._element).trigger(Event$5.HIDDEN);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this9 = this;\n\n var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = ClassName$5.BACKDROP;\n\n if (animate) {\n this._backdrop.classList.add(animate);\n }\n\n $(this._backdrop).appendTo(document.body);\n $(this._element).on(Event$5.CLICK_DISMISS, function (event) {\n if (_this9._ignoreBackdropClick) {\n _this9._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n _this9._triggerBackdropTransition();\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $(this._backdrop).addClass(ClassName$5.SHOW);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName$5.SHOW);\n\n var callbackRemove = function callbackRemove() {\n _this9._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($(this._element).hasClass(ClassName$5.FADE)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n ;\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this10 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));\n var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding\n\n $(fixedContent).each(function (index, element) {\n var actualPadding = element.style.paddingRight;\n var calculatedPadding = $(element).css('padding-right');\n $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $(stickyContent).each(function (index, element) {\n var actualMargin = element.style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $(document.body).css('padding-right');\n $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n\n $(document.body).addClass(ClassName$5.OPEN);\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));\n $(fixedContent).each(function (index, element) {\n var padding = $(element).data('padding-right');\n $(element).removeData('padding-right');\n element.style.paddingRight = padding ? padding : '';\n }); // Restore sticky content\n\n var elements = [].slice.call(document.querySelectorAll(\"\" + Selector$5.STICKY_CONTENT));\n $(elements).each(function (index, element) {\n var margin = $(element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $(document.body).data('padding-right');\n $(document.body).removeData('padding-right');\n document.body.style.paddingRight = padding ? padding : '';\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n } // Static\n ;\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$5);\n\n var _config = _objectSpread2({}, Default$3, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $(this).data(DATA_KEY$5, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$5;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$3;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {\n var _this11 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $(target).one(Event$5.SHOW, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(Event$5.HIDDEN, function () {\n if ($(_this11).is(':visible')) {\n _this11.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($(target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$5] = Modal._jQueryInterface;\n $.fn[NAME$5].Constructor = Modal;\n\n $.fn[NAME$5].noConflict = function () {\n $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;\n return Modal._jQueryInterface;\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];\n var ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n var DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n };\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;\n\n function allowedAttribute(attr, allowedAttributeList) {\n var attrName = attr.nodeName.toLowerCase();\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));\n }\n\n return true;\n }\n\n var regExp = allowedAttributeList.filter(function (attrRegex) {\n return attrRegex instanceof RegExp;\n }); // Check if a regular expression validates the attribute.\n\n for (var i = 0, l = regExp.length; i < l; i++) {\n if (attrName.match(regExp[i])) {\n return true;\n }\n }\n\n return false;\n }\n\n function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml);\n }\n\n var domParser = new window.DOMParser();\n var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n var whitelistKeys = Object.keys(whiteList);\n var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));\n\n var _loop = function _loop(i, len) {\n var el = elements[i];\n var elName = el.nodeName.toLowerCase();\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el);\n return \"continue\";\n }\n\n var attributeList = [].slice.call(el.attributes);\n var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);\n attributeList.forEach(function (attr) {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName);\n }\n });\n };\n\n for (var i = 0, len = elements.length; i < len; i++) {\n var _ret = _loop(i);\n\n if (_ret === \"continue\") continue;\n }\n\n return createdDocument.body.innerHTML;\n }\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$6 = 'tooltip';\n var VERSION$6 = '4.4.1';\n var DATA_KEY$6 = 'bs.tooltip';\n var EVENT_KEY$6 = \".\" + DATA_KEY$6;\n var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];\n var DefaultType$4 = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n whiteList: 'object',\n popperConfig: '(null|object)'\n };\n var AttachmentMap$1 = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default$4 = {\n animation: true,\n template: '<div class=\"tooltip\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<div class=\"tooltip-inner\"></div></div>',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent',\n sanitize: true,\n sanitizeFn: null,\n whiteList: DefaultWhitelist,\n popperConfig: null\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event$6 = {\n HIDE: \"hide\" + EVENT_KEY$6,\n HIDDEN: \"hidden\" + EVENT_KEY$6,\n SHOW: \"show\" + EVENT_KEY$6,\n SHOWN: \"shown\" + EVENT_KEY$6,\n INSERTED: \"inserted\" + EVENT_KEY$6,\n CLICK: \"click\" + EVENT_KEY$6,\n FOCUSIN: \"focusin\" + EVENT_KEY$6,\n FOCUSOUT: \"focusout\" + EVENT_KEY$6,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$6,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$6\n };\n var ClassName$6 = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$6 = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Tooltip =\n /*#__PURE__*/\n function () {\n function Tooltip(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var shadowRoot = Util.findShadowRoot(this.element);\n var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName$6.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n\n var container = this._getContainer();\n\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));\n $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName$6.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName$6.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Protected\n ;\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var tip = this.getTipElement();\n this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());\n $(tip).removeClass(ClassName$6.FADE + \" \" + ClassName$6.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n\n return;\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);\n }\n\n $element.html(content);\n } else {\n $element.text(content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n } // Private\n ;\n\n _proto._getPopperConfig = function _getPopperConfig(attachment) {\n var _this3 = this;\n\n var defaultBsConfig = {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector$6.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this3._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n return _this3._handlePopperPlacementChange(data);\n }\n };\n return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);\n };\n\n _proto._getOffset = function _getOffset() {\n var _this4 = this;\n\n var offset = {};\n\n if (typeof this.config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});\n return data;\n };\n } else {\n offset.offset = this.config.offset;\n }\n\n return offset;\n };\n\n _proto._getContainer = function _getContainer() {\n if (this.config.container === false) {\n return document.body;\n }\n\n if (Util.isElement(this.config.container)) {\n return $(this.config.container);\n }\n\n return $(document).find(this.config.container);\n };\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap$1[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this5 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {\n return _this5.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;\n $(_this5.element).on(eventIn, _this5.config.selector, function (event) {\n return _this5._enter(event);\n }).on(eventOut, _this5.config.selector, function (event) {\n return _this5._leave(event);\n });\n }\n });\n\n this._hideModalHandler = function () {\n if (_this5.element) {\n _this5.hide();\n }\n };\n\n $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);\n\n if (this.config.selector) {\n this.config = _objectSpread2({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n var dataAttributes = $(this.element).data();\n Object.keys(dataAttributes).forEach(function (dataAttr) {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr];\n }\n });\n config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);\n }\n\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {\n var popperInstance = popperData.instance;\n this.tip = popperInstance.popper;\n\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(popperData.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName$6.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n } // Static\n ;\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$6);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY$6, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$6;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$4;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$6;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$6;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event$6;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$6;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$4;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME$6] = Tooltip._jQueryInterface;\n $.fn[NAME$6].Constructor = Tooltip;\n\n $.fn[NAME$6].noConflict = function () {\n $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;\n return Tooltip._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$7 = 'popover';\n var VERSION$7 = '4.4.1';\n var DATA_KEY$7 = 'bs.popover';\n var EVENT_KEY$7 = \".\" + DATA_KEY$7;\n var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];\n var CLASS_PREFIX$1 = 'bs-popover';\n var BSCLS_PREFIX_REGEX$1 = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX$1 + \"\\\\S+\", 'g');\n\n var Default$5 = _objectSpread2({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' + '<div class=\"arrow\"></div>' + '<h3 class=\"popover-header\"></h3>' + '<div class=\"popover-body\"></div></div>'\n });\n\n var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var ClassName$7 = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$7 = {\n TITLE: '.popover-header',\n CONTENT: '.popover-body'\n };\n var Event$7 = {\n HIDE: \"hide\" + EVENT_KEY$7,\n HIDDEN: \"hidden\" + EVENT_KEY$7,\n SHOW: \"show\" + EVENT_KEY$7,\n SHOWN: \"shown\" + EVENT_KEY$7,\n INSERTED: \"inserted\" + EVENT_KEY$7,\n CLICK: \"click\" + EVENT_KEY$7,\n FOCUSIN: \"focusin\" + EVENT_KEY$7,\n FOCUSOUT: \"focusout\" + EVENT_KEY$7,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$7,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$7\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Popover =\n /*#__PURE__*/\n function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX$1 + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector$7.CONTENT), content);\n $tip.removeClass(ClassName$7.FADE + \" \" + ClassName$7.SHOW);\n } // Private\n ;\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n } // Static\n ;\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$7);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $(this).data(DATA_KEY$7, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION$7;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$5;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$7;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$7;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event$7;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$7;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$5;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME$7] = Popover._jQueryInterface;\n $.fn[NAME$7].Constructor = Popover;\n\n $.fn[NAME$7].noConflict = function () {\n $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;\n return Popover._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$8 = 'scrollspy';\n var VERSION$8 = '4.4.1';\n var DATA_KEY$8 = 'bs.scrollspy';\n var EVENT_KEY$8 = \".\" + DATA_KEY$8;\n var DATA_API_KEY$6 = '.data-api';\n var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];\n var Default$6 = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType$6 = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var Event$8 = {\n ACTIVATE: \"activate\" + EVENT_KEY$8,\n SCROLL: \"scroll\" + EVENT_KEY$8,\n LOAD_DATA_API: \"load\" + EVENT_KEY$8 + DATA_API_KEY$6\n };\n var ClassName$8 = {\n DROPDOWN_ITEM: 'dropdown-item',\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active'\n };\n var Selector$8 = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n ACTIVE: '.active',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_ITEMS: '.dropdown-item',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n };\n var OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var ScrollSpy =\n /*#__PURE__*/\n function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + Selector$8.NAV_LINKS + \",\" + (this._config.target + \" \" + Selector$8.LIST_ITEMS + \",\") + (this._config.target + \" \" + Selector$8.DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $(this._scrollElement).on(Event$8.SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = [].slice.call(document.querySelectorAll(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = document.querySelector(targetSelector);\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$(target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$8);\n $(this._scrollElement).off(EVENT_KEY$8);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string') {\n var id = $(config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME$8);\n $(config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME$8, config, DefaultType$6);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n var offsetLength = this._offsets.length;\n\n for (var i = offsetLength; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(',').map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + selector + \"[href=\\\"\" + target + \"\\\"]\";\n });\n\n var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));\n\n if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {\n $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);\n $link.addClass(ClassName$8.ACTIVE);\n } else {\n // Set triggered link as active\n $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n\n $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + \", \" + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item\n\n $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);\n }\n\n $(this._scrollElement).trigger(Event$8.ACTIVATE, {\n relatedTarget: target\n });\n };\n\n _proto._clear = function _clear() {\n [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {\n return node.classList.contains(ClassName$8.ACTIVE);\n }).forEach(function (node) {\n return node.classList.remove(ClassName$8.ACTIVE);\n });\n } // Static\n ;\n\n ScrollSpy._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$8);\n\n var _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new ScrollSpy(this, _config);\n $(this).data(DATA_KEY$8, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(ScrollSpy, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$8;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$6;\n }\n }]);\n\n return ScrollSpy;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(window).on(Event$8.LOAD_DATA_API, function () {\n var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));\n var scrollSpysLength = scrollSpys.length;\n\n for (var i = scrollSpysLength; i--;) {\n var $spy = $(scrollSpys[i]);\n\n ScrollSpy._jQueryInterface.call($spy, $spy.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$8] = ScrollSpy._jQueryInterface;\n $.fn[NAME$8].Constructor = ScrollSpy;\n\n $.fn[NAME$8].noConflict = function () {\n $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;\n return ScrollSpy._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$9 = 'tab';\n var VERSION$9 = '4.4.1';\n var DATA_KEY$9 = 'bs.tab';\n var EVENT_KEY$9 = \".\" + DATA_KEY$9;\n var DATA_API_KEY$7 = '.data-api';\n var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];\n var Event$9 = {\n HIDE: \"hide\" + EVENT_KEY$9,\n HIDDEN: \"hidden\" + EVENT_KEY$9,\n SHOW: \"show\" + EVENT_KEY$9,\n SHOWN: \"shown\" + EVENT_KEY$9,\n CLICK_DATA_API: \"click\" + EVENT_KEY$9 + DATA_API_KEY$7\n };\n var ClassName$9 = {\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active',\n DISABLED: 'disabled',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$9 = {\n DROPDOWN: '.dropdown',\n NAV_LIST_GROUP: '.nav, .list-group',\n ACTIVE: '.active',\n ACTIVE_UL: '> li > .active',\n DATA_TOGGLE: '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE: '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Tab =\n /*#__PURE__*/\n function () {\n function Tab(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Tab.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {\n return;\n }\n\n var target;\n var previous;\n var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];\n var selector = Util.getSelectorFromElement(this._element);\n\n if (listElement) {\n var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;\n previous = $.makeArray($(listElement).find(itemSelector));\n previous = previous[previous.length - 1];\n }\n\n var hideEvent = $.Event(Event$9.HIDE, {\n relatedTarget: this._element\n });\n var showEvent = $.Event(Event$9.SHOW, {\n relatedTarget: previous\n });\n\n if (previous) {\n $(previous).trigger(hideEvent);\n }\n\n $(this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n this._activate(this._element, listElement);\n\n var complete = function complete() {\n var hiddenEvent = $.Event(Event$9.HIDDEN, {\n relatedTarget: _this._element\n });\n var shownEvent = $.Event(Event$9.SHOWN, {\n relatedTarget: previous\n });\n $(previous).trigger(hiddenEvent);\n $(_this._element).trigger(shownEvent);\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$9);\n this._element = null;\n } // Private\n ;\n\n _proto._activate = function _activate(element, container, callback) {\n var _this2 = this;\n\n var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);\n var active = activeElements[0];\n var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);\n\n var complete = function complete() {\n return _this2._transitionComplete(element, active, callback);\n };\n\n if (active && isTransitioning) {\n var transitionDuration = Util.getTransitionDurationFromElement(active);\n $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._transitionComplete = function _transitionComplete(element, active, callback) {\n if (active) {\n $(active).removeClass(ClassName$9.ACTIVE);\n var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName$9.ACTIVE);\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false);\n }\n }\n\n $(element).addClass(ClassName$9.ACTIVE);\n\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true);\n }\n\n Util.reflow(element);\n\n if (element.classList.contains(ClassName$9.FADE)) {\n element.classList.add(ClassName$9.SHOW);\n }\n\n if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {\n var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];\n\n if (dropdownElement) {\n var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));\n $(dropdownToggleList).addClass(ClassName$9.ACTIVE);\n }\n\n element.setAttribute('aria-expanded', true);\n }\n\n if (callback) {\n callback();\n }\n } // Static\n ;\n\n Tab._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY$9);\n\n if (!data) {\n data = new Tab(this);\n $this.data(DATA_KEY$9, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tab, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$9;\n }\n }]);\n\n return Tab;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {\n event.preventDefault();\n\n Tab._jQueryInterface.call($(this), 'show');\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$9] = Tab._jQueryInterface;\n $.fn[NAME$9].Constructor = Tab;\n\n $.fn[NAME$9].noConflict = function () {\n $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;\n return Tab._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$a = 'toast';\n var VERSION$a = '4.4.1';\n var DATA_KEY$a = 'bs.toast';\n var EVENT_KEY$a = \".\" + DATA_KEY$a;\n var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];\n var Event$a = {\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY$a,\n HIDE: \"hide\" + EVENT_KEY$a,\n HIDDEN: \"hidden\" + EVENT_KEY$a,\n SHOW: \"show\" + EVENT_KEY$a,\n SHOWN: \"shown\" + EVENT_KEY$a\n };\n var ClassName$a = {\n FADE: 'fade',\n HIDE: 'hide',\n SHOW: 'show',\n SHOWING: 'showing'\n };\n var DefaultType$7 = {\n animation: 'boolean',\n autohide: 'boolean',\n delay: 'number'\n };\n var Default$7 = {\n animation: true,\n autohide: true,\n delay: 500\n };\n var Selector$a = {\n DATA_DISMISS: '[data-dismiss=\"toast\"]'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Toast =\n /*#__PURE__*/\n function () {\n function Toast(element, config) {\n this._element = element;\n this._config = this._getConfig(config);\n this._timeout = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Toast.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n var showEvent = $.Event(Event$a.SHOW);\n $(this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n }\n\n if (this._config.animation) {\n this._element.classList.add(ClassName$a.FADE);\n }\n\n var complete = function complete() {\n _this._element.classList.remove(ClassName$a.SHOWING);\n\n _this._element.classList.add(ClassName$a.SHOW);\n\n $(_this._element).trigger(Event$a.SHOWN);\n\n if (_this._config.autohide) {\n _this._timeout = setTimeout(function () {\n _this.hide();\n }, _this._config.delay);\n }\n };\n\n this._element.classList.remove(ClassName$a.HIDE);\n\n Util.reflow(this._element);\n\n this._element.classList.add(ClassName$a.SHOWING);\n\n if (this._config.animation) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto.hide = function hide() {\n if (!this._element.classList.contains(ClassName$a.SHOW)) {\n return;\n }\n\n var hideEvent = $.Event(Event$a.HIDE);\n $(this._element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._close();\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n this._timeout = null;\n\n if (this._element.classList.contains(ClassName$a.SHOW)) {\n this._element.classList.remove(ClassName$a.SHOW);\n }\n\n $(this._element).off(Event$a.CLICK_DISMISS);\n $.removeData(this._element, DATA_KEY$a);\n this._element = null;\n this._config = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread2({}, Default$7, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {});\n Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._setListeners = function _setListeners() {\n var _this2 = this;\n\n $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {\n return _this2.hide();\n });\n };\n\n _proto._close = function _close() {\n var _this3 = this;\n\n var complete = function complete() {\n _this3._element.classList.add(ClassName$a.HIDE);\n\n $(_this3._element).trigger(Event$a.HIDDEN);\n };\n\n this._element.classList.remove(ClassName$a.SHOW);\n\n if (this._config.animation) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n } // Static\n ;\n\n Toast._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $(this);\n var data = $element.data(DATA_KEY$a);\n\n var _config = typeof config === 'object' && config;\n\n if (!data) {\n data = new Toast(this, _config);\n $element.data(DATA_KEY$a, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](this);\n }\n });\n };\n\n _createClass(Toast, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$a;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$7;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$7;\n }\n }]);\n\n return Toast;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME$a] = Toast._jQueryInterface;\n $.fn[NAME$a].Constructor = Toast;\n\n $.fn[NAME$a].noConflict = function () {\n $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;\n return Toast._jQueryInterface;\n };\n\n exports.Alert = Alert;\n exports.Button = Button;\n exports.Carousel = Carousel;\n exports.Collapse = Collapse;\n exports.Dropdown = Dropdown;\n exports.Modal = Modal;\n exports.Popover = Popover;\n exports.Scrollspy = ScrollSpy;\n exports.Tab = Tab;\n exports.Toast = Toast;\n exports.Tooltip = Tooltip;\n exports.Util = Util;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=bootstrap.js.map\n","\n/* **********************************************\n Begin prism-core.js\n********************************************** */\n\nvar _self = (typeof window !== 'undefined')\n\t? window // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t? self // if in worker\n\t\t: {} // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n * MIT license http://www.opensource.org/licenses/mit-license.php/\n * @author Lea Verou http://lea.verou.me\n */\n\nvar Prism = (function (_self){\n\n// Private helper vars\nvar lang = /\\blang(?:uage)?-([\\w-]+)\\b/i;\nvar uniqueId = 0;\n\n\nvar _ = {\n\tmanual: _self.Prism && _self.Prism.manual,\n\tdisableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,\n\tutil: {\n\t\tencode: function (tokens) {\n\t\t\tif (tokens instanceof Token) {\n\t\t\t\treturn new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);\n\t\t\t} else if (Array.isArray(tokens)) {\n\t\t\t\treturn tokens.map(_.util.encode);\n\t\t\t} else {\n\t\t\t\treturn tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\\u00a0/g, ' ');\n\t\t\t}\n\t\t},\n\n\t\ttype: function (o) {\n\t\t\treturn Object.prototype.toString.call(o).slice(8, -1);\n\t\t},\n\n\t\tobjId: function (obj) {\n\t\t\tif (!obj['__id']) {\n\t\t\t\tObject.defineProperty(obj, '__id', { value: ++uniqueId });\n\t\t\t}\n\t\t\treturn obj['__id'];\n\t\t},\n\n\t\t// Deep clone a language definition (e.g. to extend it)\n\t\tclone: function deepClone(o, visited) {\n\t\t\tvar clone, id, type = _.util.type(o);\n\t\t\tvisited = visited || {};\n\n\t\t\tswitch (type) {\n\t\t\t\tcase 'Object':\n\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t}\n\t\t\t\t\tclone = {};\n\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\tfor (var key in o) {\n\t\t\t\t\t\tif (o.hasOwnProperty(key)) {\n\t\t\t\t\t\t\tclone[key] = deepClone(o[key], visited);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn clone;\n\n\t\t\t\tcase 'Array':\n\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t}\n\t\t\t\t\tclone = [];\n\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\to.forEach(function (v, i) {\n\t\t\t\t\t\tclone[i] = deepClone(v, visited);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn clone;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn o;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.\n\t\t *\n\t\t * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.\n\t\t *\n\t\t * @param {Element} element\n\t\t * @returns {string}\n\t\t */\n\t\tgetLanguage: function (element) {\n\t\t\twhile (element && !lang.test(element.className)) {\n\t\t\t\telement = element.parentElement;\n\t\t\t}\n\t\t\tif (element) {\n\t\t\t\treturn (element.className.match(lang) || [, 'none'])[1].toLowerCase();\n\t\t\t}\n\t\t\treturn 'none';\n\t\t},\n\n\t\t/**\n\t\t * Returns the script element that is currently executing.\n\t\t *\n\t\t * This does __not__ work for line script element.\n\t\t *\n\t\t * @returns {HTMLScriptElement | null}\n\t\t */\n\t\tcurrentScript: function () {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ('currentScript' in document) {\n\t\t\t\treturn document.currentScript;\n\t\t\t}\n\n\t\t\t// IE11 workaround\n\t\t\t// we'll get the src of the current script by parsing IE11's error stack trace\n\t\t\t// this will not work for inline scripts\n\n\t\t\ttry {\n\t\t\t\tthrow new Error();\n\t\t\t} catch (err) {\n\t\t\t\t// Get file src url from stack. Specifically works with the format of stack traces in IE.\n\t\t\t\t// A stack will look like this:\n\t\t\t\t//\n\t\t\t\t// Error\n\t\t\t\t// at _.util.currentScript (http://localhost/components/prism-core.js:119:5)\n\t\t\t\t// at Global code (http://localhost/components/prism-core.js:606:1)\n\n\t\t\t\tvar src = (/at [^(\\r\\n]*\\((.*):.+:.+\\)$/i.exec(err.stack) || [])[1];\n\t\t\t\tif (src) {\n\t\t\t\t\tvar scripts = document.getElementsByTagName('script');\n\t\t\t\t\tfor (var i in scripts) {\n\t\t\t\t\t\tif (scripts[i].src == src) {\n\t\t\t\t\t\t\treturn scripts[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t},\n\n\tlanguages: {\n\t\textend: function (id, redef) {\n\t\t\tvar lang = _.util.clone(_.languages[id]);\n\n\t\t\tfor (var key in redef) {\n\t\t\t\tlang[key] = redef[key];\n\t\t\t}\n\n\t\t\treturn lang;\n\t\t},\n\n\t\t/**\n\t\t * Insert a token before another token in a language literal\n\t\t * As this needs to recreate the object (we cannot actually insert before keys in object literals),\n\t\t * we cannot just provide an object, we need an object and a key.\n\t\t * @param inside The key (or language id) of the parent\n\t\t * @param before The key to insert before.\n\t\t * @param insert Object with the key/value pairs to insert\n\t\t * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.\n\t\t */\n\t\tinsertBefore: function (inside, before, insert, root) {\n\t\t\troot = root || _.languages;\n\t\t\tvar grammar = root[inside];\n\t\t\tvar ret = {};\n\n\t\t\tfor (var token in grammar) {\n\t\t\t\tif (grammar.hasOwnProperty(token)) {\n\n\t\t\t\t\tif (token == before) {\n\t\t\t\t\t\tfor (var newToken in insert) {\n\t\t\t\t\t\t\tif (insert.hasOwnProperty(newToken)) {\n\t\t\t\t\t\t\t\tret[newToken] = insert[newToken];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Do not insert token which also occur in insert. See #1525\n\t\t\t\t\tif (!insert.hasOwnProperty(token)) {\n\t\t\t\t\t\tret[token] = grammar[token];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar old = root[inside];\n\t\t\troot[inside] = ret;\n\n\t\t\t// Update references in other language definitions\n\t\t\t_.languages.DFS(_.languages, function(key, value) {\n\t\t\t\tif (value === old && key != inside) {\n\t\t\t\t\tthis[key] = ret;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn ret;\n\t\t},\n\n\t\t// Traverse a language definition with Depth First Search\n\t\tDFS: function DFS(o, callback, type, visited) {\n\t\t\tvisited = visited || {};\n\n\t\t\tvar objId = _.util.objId;\n\n\t\t\tfor (var i in o) {\n\t\t\t\tif (o.hasOwnProperty(i)) {\n\t\t\t\t\tcallback.call(o, i, o[i], type || i);\n\n\t\t\t\t\tvar property = o[i],\n\t\t\t\t\t propertyType = _.util.type(property);\n\n\t\t\t\t\tif (propertyType === 'Object' && !visited[objId(property)]) {\n\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\tDFS(property, callback, null, visited);\n\t\t\t\t\t}\n\t\t\t\t\telse if (propertyType === 'Array' && !visited[objId(property)]) {\n\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\tDFS(property, callback, i, visited);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tplugins: {},\n\n\thighlightAll: function(async, callback) {\n\t\t_.highlightAllUnder(document, async, callback);\n\t},\n\n\thighlightAllUnder: function(container, async, callback) {\n\t\tvar env = {\n\t\t\tcallback: callback,\n\t\t\tcontainer: container,\n\t\t\tselector: 'code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code'\n\t\t};\n\n\t\t_.hooks.run('before-highlightall', env);\n\n\t\tenv.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));\n\n\t\t_.hooks.run('before-all-elements-highlight', env);\n\n\t\tfor (var i = 0, element; element = env.elements[i++];) {\n\t\t\t_.highlightElement(element, async === true, env.callback);\n\t\t}\n\t},\n\n\thighlightElement: function(element, async, callback) {\n\t\t// Find language\n\t\tvar language = _.util.getLanguage(element);\n\t\tvar grammar = _.languages[language];\n\n\t\t// Set language on the element, if not present\n\t\telement.className = element.className.replace(lang, '').replace(/\\s+/g, ' ') + ' language-' + language;\n\n\t\t// Set language on the parent, for styling\n\t\tvar parent = element.parentNode;\n\t\tif (parent && parent.nodeName.toLowerCase() === 'pre') {\n\t\t\tparent.className = parent.className.replace(lang, '').replace(/\\s+/g, ' ') + ' language-' + language;\n\t\t}\n\n\t\tvar code = element.textContent;\n\n\t\tvar env = {\n\t\t\telement: element,\n\t\t\tlanguage: language,\n\t\t\tgrammar: grammar,\n\t\t\tcode: code\n\t\t};\n\n\t\tfunction insertHighlightedCode(highlightedCode) {\n\t\t\tenv.highlightedCode = highlightedCode;\n\n\t\t\t_.hooks.run('before-insert', env);\n\n\t\t\tenv.element.innerHTML = env.highlightedCode;\n\n\t\t\t_.hooks.run('after-highlight', env);\n\t\t\t_.hooks.run('complete', env);\n\t\t\tcallback && callback.call(env.element);\n\t\t}\n\n\t\t_.hooks.run('before-sanity-check', env);\n\n\t\tif (!env.code) {\n\t\t\t_.hooks.run('complete', env);\n\t\t\tcallback && callback.call(env.element);\n\t\t\treturn;\n\t\t}\n\n\t\t_.hooks.run('before-highlight', env);\n\n\t\tif (!env.grammar) {\n\t\t\tinsertHighlightedCode(_.util.encode(env.code));\n\t\t\treturn;\n\t\t}\n\n\t\tif (async && _self.Worker) {\n\t\t\tvar worker = new Worker(_.filename);\n\n\t\t\tworker.onmessage = function(evt) {\n\t\t\t\tinsertHighlightedCode(evt.data);\n\t\t\t};\n\n\t\t\tworker.postMessage(JSON.stringify({\n\t\t\t\tlanguage: env.language,\n\t\t\t\tcode: env.code,\n\t\t\t\timmediateClose: true\n\t\t\t}));\n\t\t}\n\t\telse {\n\t\t\tinsertHighlightedCode(_.highlight(env.code, env.grammar, env.language));\n\t\t}\n\t},\n\n\thighlight: function (text, grammar, language) {\n\t\tvar env = {\n\t\t\tcode: text,\n\t\t\tgrammar: grammar,\n\t\t\tlanguage: language\n\t\t};\n\t\t_.hooks.run('before-tokenize', env);\n\t\tenv.tokens = _.tokenize(env.code, env.grammar);\n\t\t_.hooks.run('after-tokenize', env);\n\t\treturn Token.stringify(_.util.encode(env.tokens), env.language);\n\t},\n\n\tmatchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {\n\t\tfor (var token in grammar) {\n\t\t\tif (!grammar.hasOwnProperty(token) || !grammar[token]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar patterns = grammar[token];\n\t\t\tpatterns = Array.isArray(patterns) ? patterns : [patterns];\n\n\t\t\tfor (var j = 0; j < patterns.length; ++j) {\n\t\t\t\tif (target && target == token + ',' + j) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar pattern = patterns[j],\n\t\t\t\t\tinside = pattern.inside,\n\t\t\t\t\tlookbehind = !!pattern.lookbehind,\n\t\t\t\t\tgreedy = !!pattern.greedy,\n\t\t\t\t\tlookbehindLength = 0,\n\t\t\t\t\talias = pattern.alias;\n\n\t\t\t\tif (greedy && !pattern.pattern.global) {\n\t\t\t\t\t// Without the global flag, lastIndex won't work\n\t\t\t\t\tvar flags = pattern.pattern.toString().match(/[imsuy]*$/)[0];\n\t\t\t\t\tpattern.pattern = RegExp(pattern.pattern.source, flags + 'g');\n\t\t\t\t}\n\n\t\t\t\tpattern = pattern.pattern || pattern;\n\n\t\t\t\t// Don’t cache length as it changes during the loop\n\t\t\t\tfor (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {\n\n\t\t\t\t\tvar str = strarr[i];\n\n\t\t\t\t\tif (strarr.length > text.length) {\n\t\t\t\t\t\t// Something went terribly wrong, ABORT, ABORT!\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (str instanceof Token) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (greedy && i != strarr.length - 1) {\n\t\t\t\t\t\tpattern.lastIndex = pos;\n\t\t\t\t\t\tvar match = pattern.exec(text);\n\t\t\t\t\t\tif (!match) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar from = match.index + (lookbehind && match[1] ? match[1].length : 0),\n\t\t\t\t\t\t to = match.index + match[0].length,\n\t\t\t\t\t\t k = i,\n\t\t\t\t\t\t p = pos;\n\n\t\t\t\t\t\tfor (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {\n\t\t\t\t\t\t\tp += strarr[k].length;\n\t\t\t\t\t\t\t// Move the index i to the element in strarr that is closest to from\n\t\t\t\t\t\t\tif (from >= p) {\n\t\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\t\tpos = p;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If strarr[i] is a Token, then the match starts inside another Token, which is invalid\n\t\t\t\t\t\tif (strarr[i] instanceof Token) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Number of tokens to delete and replace with the new match\n\t\t\t\t\t\tdelNum = k - i;\n\t\t\t\t\t\tstr = text.slice(pos, p);\n\t\t\t\t\t\tmatch.index -= pos;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpattern.lastIndex = 0;\n\n\t\t\t\t\t\tvar match = pattern.exec(str),\n\t\t\t\t\t\t\tdelNum = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tif (oneshot) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(lookbehind) {\n\t\t\t\t\t\tlookbehindLength = match[1] ? match[1].length : 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar from = match.index + lookbehindLength,\n\t\t\t\t\t match = match[0].slice(lookbehindLength),\n\t\t\t\t\t to = from + match.length,\n\t\t\t\t\t before = str.slice(0, from),\n\t\t\t\t\t after = str.slice(to);\n\n\t\t\t\t\tvar args = [i, delNum];\n\n\t\t\t\t\tif (before) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t\tpos += before.length;\n\t\t\t\t\t\targs.push(before);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);\n\n\t\t\t\t\targs.push(wrapped);\n\n\t\t\t\t\tif (after) {\n\t\t\t\t\t\targs.push(after);\n\t\t\t\t\t}\n\n\t\t\t\t\tArray.prototype.splice.apply(strarr, args);\n\n\t\t\t\t\tif (delNum != 1)\n\t\t\t\t\t\t_.matchGrammar(text, strarr, grammar, i, pos, true, token + ',' + j);\n\n\t\t\t\t\tif (oneshot)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\ttokenize: function(text, grammar) {\n\t\tvar strarr = [text];\n\n\t\tvar rest = grammar.rest;\n\n\t\tif (rest) {\n\t\t\tfor (var token in rest) {\n\t\t\t\tgrammar[token] = rest[token];\n\t\t\t}\n\n\t\t\tdelete grammar.rest;\n\t\t}\n\n\t\t_.matchGrammar(text, strarr, grammar, 0, 0, false);\n\n\t\treturn strarr;\n\t},\n\n\thooks: {\n\t\tall: {},\n\n\t\tadd: function (name, callback) {\n\t\t\tvar hooks = _.hooks.all;\n\n\t\t\thooks[name] = hooks[name] || [];\n\n\t\t\thooks[name].push(callback);\n\t\t},\n\n\t\trun: function (name, env) {\n\t\t\tvar callbacks = _.hooks.all[name];\n\n\t\t\tif (!callbacks || !callbacks.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (var i=0, callback; callback = callbacks[i++];) {\n\t\t\t\tcallback(env);\n\t\t\t}\n\t\t}\n\t},\n\n\tToken: Token\n};\n\n_self.Prism = _;\n\nfunction Token(type, content, alias, matchedStr, greedy) {\n\tthis.type = type;\n\tthis.content = content;\n\tthis.alias = alias;\n\t// Copy of the full string this token was created from\n\tthis.length = (matchedStr || '').length|0;\n\tthis.greedy = !!greedy;\n}\n\nToken.stringify = function(o, language) {\n\tif (typeof o == 'string') {\n\t\treturn o;\n\t}\n\n\tif (Array.isArray(o)) {\n\t\treturn o.map(function(element) {\n\t\t\treturn Token.stringify(element, language);\n\t\t}).join('');\n\t}\n\n\tvar env = {\n\t\ttype: o.type,\n\t\tcontent: Token.stringify(o.content, language),\n\t\ttag: 'span',\n\t\tclasses: ['token', o.type],\n\t\tattributes: {},\n\t\tlanguage: language\n\t};\n\n\tif (o.alias) {\n\t\tvar aliases = Array.isArray(o.alias) ? o.alias : [o.alias];\n\t\tArray.prototype.push.apply(env.classes, aliases);\n\t}\n\n\t_.hooks.run('wrap', env);\n\n\tvar attributes = Object.keys(env.attributes).map(function(name) {\n\t\treturn name + '=\"' + (env.attributes[name] || '').replace(/\"/g, '&quot;') + '\"';\n\t}).join(' ');\n\n\treturn '<' + env.tag + ' class=\"' + env.classes.join(' ') + '\"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';\n};\n\nif (!_self.document) {\n\tif (!_self.addEventListener) {\n\t\t// in Node.js\n\t\treturn _;\n\t}\n\n\tif (!_.disableWorkerMessageHandler) {\n\t\t// In worker\n\t\t_self.addEventListener('message', function (evt) {\n\t\t\tvar message = JSON.parse(evt.data),\n\t\t\t\tlang = message.language,\n\t\t\t\tcode = message.code,\n\t\t\t\timmediateClose = message.immediateClose;\n\n\t\t\t_self.postMessage(_.highlight(code, _.languages[lang], lang));\n\t\t\tif (immediateClose) {\n\t\t\t\t_self.close();\n\t\t\t}\n\t\t}, false);\n\t}\n\n\treturn _;\n}\n\n//Get current script and highlight\nvar script = _.util.currentScript();\n\nif (script) {\n\t_.filename = script.src;\n\n\tif (script.hasAttribute('data-manual')) {\n\t\t_.manual = true;\n\t}\n}\n\nif (!_.manual) {\n\tfunction highlightAutomaticallyCallback() {\n\t\tif (!_.manual) {\n\t\t\t_.highlightAll();\n\t\t}\n\t}\n\n\t// If the document state is \"loading\", then we'll use DOMContentLoaded.\n\t// If the document state is \"interactive\" and the prism.js script is deferred, then we'll also use the\n\t// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they\n\t// might take longer one animation frame to execute which can create a race condition where only some plugins have\n\t// been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.\n\t// See https://github.com/PrismJS/prism/issues/2102\n\tvar readyState = document.readyState;\n\tif (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {\n\t\tdocument.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);\n\t} else {\n\t\tif (window.requestAnimationFrame) {\n\t\t\twindow.requestAnimationFrame(highlightAutomaticallyCallback);\n\t\t} else {\n\t\t\twindow.setTimeout(highlightAutomaticallyCallback, 16);\n\t\t}\n\t}\n}\n\nreturn _;\n\n})(_self);\n\nif (typeof module !== 'undefined' && module.exports) {\n\tmodule.exports = Prism;\n}\n\n// hack for components to work correctly in node.js\nif (typeof global !== 'undefined') {\n\tglobal.Prism = Prism;\n}\n\n\n/* **********************************************\n Begin prism-markup.js\n********************************************** */\n\nPrism.languages.markup = {\n\t'comment': /<!--[\\s\\S]*?-->/,\n\t'prolog': /<\\?[\\s\\S]+?\\?>/,\n\t'doctype': {\n\t\tpattern: /<!DOCTYPE(?:[^>\"'[\\]]|\"[^\"]*\"|'[^']*')+(?:\\[(?:(?!<!--)[^\"'\\]]|\"[^\"]*\"|'[^']*'|<!--[\\s\\S]*?-->)*\\]\\s*)?>/i,\n\t\tgreedy: true\n\t},\n\t'cdata': /<!\\[CDATA\\[[\\s\\S]*?]]>/i,\n\t'tag': {\n\t\tpattern: /<\\/?(?!\\d)[^\\s>\\/=$<%]+(?:\\s(?:\\s*[^\\s>\\/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))|(?=[\\s/>])))+)?\\s*\\/?>/i,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'tag': {\n\t\t\t\tpattern: /^<\\/?[^\\s>\\/]+/i,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /^<\\/?/,\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t},\n\t\t\t'attr-value': {\n\t\t\t\tpattern: /=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+)/i,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t/^=/,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^(\\s*)[\"']|[\"']$/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t'punctuation': /\\/?>/,\n\t\t\t'attr-name': {\n\t\t\t\tpattern: /[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t},\n\t'entity': /&#?[\\da-z]{1,8};/i\n};\n\nPrism.languages.markup['tag'].inside['attr-value'].inside['entity'] =\n\tPrism.languages.markup['entity'];\n\n// Plugin to make entity title show the real entity, idea by Roman Komarov\nPrism.hooks.add('wrap', function(env) {\n\n\tif (env.type === 'entity') {\n\t\tenv.attributes['title'] = env.content.replace(/&amp;/, '&');\n\t}\n});\n\nObject.defineProperty(Prism.languages.markup.tag, 'addInlined', {\n\t/**\n\t * Adds an inlined language to markup.\n\t *\n\t * An example of an inlined language is CSS with `<style>` tags.\n\t *\n\t * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addInlined('style', 'css');\n\t */\n\tvalue: function addInlined(tagName, lang) {\n\t\tvar includedCdataInside = {};\n\t\tincludedCdataInside['language-' + lang] = {\n\t\t\tpattern: /(^<!\\[CDATA\\[)[\\s\\S]+?(?=\\]\\]>$)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\t\tincludedCdataInside['cdata'] = /^<!\\[CDATA\\[|\\]\\]>$/i;\n\n\t\tvar inside = {\n\t\t\t'included-cdata': {\n\t\t\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\t\t\tinside: includedCdataInside\n\t\t\t}\n\t\t};\n\t\tinside['language-' + lang] = {\n\t\t\tpattern: /[\\s\\S]+/,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\n\t\tvar def = {};\n\t\tdef[tagName] = {\n\t\t\tpattern: RegExp(/(<__[\\s\\S]*?>)(?:<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\s*|[\\s\\S])*?(?=<\\/__>)/.source.replace(/__/g, tagName), 'i'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: inside\n\t\t};\n\n\t\tPrism.languages.insertBefore('markup', 'cdata', def);\n\t}\n});\n\nPrism.languages.xml = Prism.languages.extend('markup', {});\nPrism.languages.html = Prism.languages.markup;\nPrism.languages.mathml = Prism.languages.markup;\nPrism.languages.svg = Prism.languages.markup;\n\n\n/* **********************************************\n Begin prism-css.js\n********************************************** */\n\n(function (Prism) {\n\n\tvar string = /(\"|')(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/;\n\n\tPrism.languages.css = {\n\t\t'comment': /\\/\\*[\\s\\S]*?\\*\\//,\n\t\t'atrule': {\n\t\t\tpattern: /@[\\w-]+[\\s\\S]*?(?:;|(?=\\s*\\{))/,\n\t\t\tinside: {\n\t\t\t\t'rule': /@[\\w-]+/\n\t\t\t\t// See rest below\n\t\t\t}\n\t\t},\n\t\t'url': {\n\t\t\tpattern: RegExp('url\\\\((?:' + string.source + '|[^\\n\\r()]*)\\\\)', 'i'),\n\t\t\tinside: {\n\t\t\t\t'function': /^url/i,\n\t\t\t\t'punctuation': /^\\(|\\)$/\n\t\t\t}\n\t\t},\n\t\t'selector': RegExp('[^{}\\\\s](?:[^{};\"\\']|' + string.source + ')*?(?=\\\\s*\\\\{)'),\n\t\t'string': {\n\t\t\tpattern: string,\n\t\t\tgreedy: true\n\t\t},\n\t\t'property': /[-_a-z\\xA0-\\uFFFF][-\\w\\xA0-\\uFFFF]*(?=\\s*:)/i,\n\t\t'important': /!important\\b/i,\n\t\t'function': /[-a-z0-9]+(?=\\()/i,\n\t\t'punctuation': /[(){};:,]/\n\t};\n\n\tPrism.languages.css['atrule'].inside.rest = Prism.languages.css;\n\n\tvar markup = Prism.languages.markup;\n\tif (markup) {\n\t\tmarkup.tag.addInlined('style', 'css');\n\n\t\tPrism.languages.insertBefore('inside', 'attr-value', {\n\t\t\t'style-attr': {\n\t\t\t\tpattern: /\\s*style=(\"|')(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])*\\1/i,\n\t\t\t\tinside: {\n\t\t\t\t\t'attr-name': {\n\t\t\t\t\t\tpattern: /^\\s*style/i,\n\t\t\t\t\t\tinside: markup.tag.inside\n\t\t\t\t\t},\n\t\t\t\t\t'punctuation': /^\\s*=\\s*['\"]|['\"]\\s*$/,\n\t\t\t\t\t'attr-value': {\n\t\t\t\t\t\tpattern: /.+/i,\n\t\t\t\t\t\tinside: Prism.languages.css\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\talias: 'language-css'\n\t\t\t}\n\t\t}, markup.tag);\n\t}\n\n}(Prism));\n\n\n/* **********************************************\n Begin prism-clike.js\n********************************************** */\n\nPrism.languages.clike = {\n\t'comment': [\n\t\t{\n\t\t\tpattern: /(^|[^\\\\])\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^\\\\:])\\/\\/.*/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t}\n\t],\n\t'string': {\n\t\tpattern: /([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,\n\t\tgreedy: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\b(?:class|interface|extends|implements|trait|instanceof|new)\\s+|\\bcatch\\s+\\()[\\w.\\\\]+/i,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'punctuation': /[.\\\\]/\n\t\t}\n\t},\n\t'keyword': /\\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\\b/,\n\t'boolean': /\\b(?:true|false)\\b/,\n\t'function': /\\w+(?=\\()/,\n\t'number': /\\b0x[\\da-f]+\\b|(?:\\b\\d+\\.?\\d*|\\B\\.\\d+)(?:e[+-]?\\d+)?/i,\n\t'operator': /[<>]=?|[!=]=?=?|--?|\\+\\+?|&&?|\\|\\|?|[?*/~^%]/,\n\t'punctuation': /[{}[\\];(),.:]/\n};\n\n\n/* **********************************************\n Begin prism-javascript.js\n********************************************** */\n\nPrism.languages.javascript = Prism.languages.extend('clike', {\n\t'class-name': [\n\t\tPrism.languages.clike['class-name'],\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])[_$A-Z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*(?=\\.(?:prototype|constructor))/,\n\t\t\tlookbehind: true\n\t\t}\n\t],\n\t'keyword': [\n\t\t{\n\t\t\tpattern: /((?:^|})\\s*)(?:catch|finally)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^.]|\\.\\.\\.\\s*)\\b(?:as|async(?=\\s*(?:function\\b|\\(|[$\\w\\xA0-\\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t],\n\t'number': /\\b(?:(?:0[xX](?:[\\dA-Fa-f](?:_[\\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\\d(?:_\\d)?)+n|NaN|Infinity)\\b|(?:\\b(?:\\d(?:_\\d)?)+\\.?(?:\\d(?:_\\d)?)*|\\B\\.(?:\\d(?:_\\d)?)+)(?:[Ee][+-]?(?:\\d(?:_\\d)?)+)?/,\n\t// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)\n\t'function': /#?[_$a-zA-Z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n\t'operator': /--|\\+\\+|\\*\\*=?|=>|&&|\\|\\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\\.{3}|\\?[.?]?|[~:]/\n});\n\nPrism.languages.javascript['class-name'][0].pattern = /(\\b(?:class|interface|extends|implements|instanceof|new)\\s+)[\\w.\\\\]+/;\n\nPrism.languages.insertBefore('javascript', 'keyword', {\n\t'regex': {\n\t\tpattern: /((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s])\\s*)\\/(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[gimyus]{0,6}(?=(?:\\s|\\/\\*[\\s\\S]*?\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t// This must be declared before keyword because we use \"function\" inside the look-forward\n\t'function-variable': {\n\t\tpattern: /#?[_$a-zA-Z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*(?=\\s*[=:]\\s*(?:async\\s*)?(?:\\bfunction\\b|(?:\\((?:[^()]|\\([^()]*\\))*\\)|[_$a-zA-Z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*)\\s*=>))/,\n\t\talias: 'function'\n\t},\n\t'parameter': [\n\t\t{\n\t\t\tpattern: /(function(?:\\s+[_$A-Za-z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*)?\\s*\\(\\s*)(?!\\s)(?:[^()]|\\([^()]*\\))+?(?=\\s*\\))/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /[_$a-z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*(?=\\s*=>)/i,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(\\(\\s*)(?!\\s)(?:[^()]|\\([^()]*\\))+?(?=\\s*\\)\\s*=>)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /((?:\\b|\\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\\w\\xA0-\\uFFFF]))(?:[_$A-Za-z\\xA0-\\uFFFF][$\\w\\xA0-\\uFFFF]*\\s*)\\(\\s*)(?!\\s)(?:[^()]|\\([^()]*\\))+?(?=\\s*\\)\\s*\\{)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t}\n\t],\n\t'constant': /\\b[A-Z](?:[A-Z_]|\\dx?)*\\b/\n});\n\nPrism.languages.insertBefore('javascript', 'string', {\n\t'template-string': {\n\t\tpattern: /`(?:\\\\[\\s\\S]|\\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\\${)[^\\\\`])*`/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'template-punctuation': {\n\t\t\t\tpattern: /^`|`$/,\n\t\t\t\talias: 'string'\n\t\t\t},\n\t\t\t'interpolation': {\n\t\t\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)\\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\t\tpattern: /^\\${|}$/,\n\t\t\t\t\t\talias: 'punctuation'\n\t\t\t\t\t},\n\t\t\t\t\trest: Prism.languages.javascript\n\t\t\t\t}\n\t\t\t},\n\t\t\t'string': /[\\s\\S]+/\n\t\t}\n\t}\n});\n\nif (Prism.languages.markup) {\n\tPrism.languages.markup.tag.addInlined('script', 'javascript');\n}\n\nPrism.languages.js = Prism.languages.javascript;\n\n\n/* **********************************************\n Begin prism-file-highlight.js\n********************************************** */\n\n(function () {\n\tif (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {\n\t\treturn;\n\t}\n\n\t/**\n\t * @param {Element} [container=document]\n\t */\n\tself.Prism.fileHighlight = function(container) {\n\t\tcontainer = container || document;\n\n\t\tvar Extensions = {\n\t\t\t'js': 'javascript',\n\t\t\t'py': 'python',\n\t\t\t'rb': 'ruby',\n\t\t\t'ps1': 'powershell',\n\t\t\t'psm1': 'powershell',\n\t\t\t'sh': 'bash',\n\t\t\t'bat': 'batch',\n\t\t\t'h': 'c',\n\t\t\t'tex': 'latex'\n\t\t};\n\n\t\tArray.prototype.slice.call(container.querySelectorAll('pre[data-src]')).forEach(function (pre) {\n\t\t\t// ignore if already loaded\n\t\t\tif (pre.hasAttribute('data-src-loaded')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// load current\n\t\t\tvar src = pre.getAttribute('data-src');\n\n\t\t\tvar language, parent = pre;\n\t\t\tvar lang = /\\blang(?:uage)?-([\\w-]+)\\b/i;\n\t\t\twhile (parent && !lang.test(parent.className)) {\n\t\t\t\tparent = parent.parentNode;\n\t\t\t}\n\n\t\t\tif (parent) {\n\t\t\t\tlanguage = (pre.className.match(lang) || [, ''])[1];\n\t\t\t}\n\n\t\t\tif (!language) {\n\t\t\t\tvar extension = (src.match(/\\.(\\w+)$/) || [, ''])[1];\n\t\t\t\tlanguage = Extensions[extension] || extension;\n\t\t\t}\n\n\t\t\tvar code = document.createElement('code');\n\t\t\tcode.className = 'language-' + language;\n\n\t\t\tpre.textContent = '';\n\n\t\t\tcode.textContent = 'Loading…';\n\n\t\t\tpre.appendChild(code);\n\n\t\t\tvar xhr = new XMLHttpRequest();\n\n\t\t\txhr.open('GET', src, true);\n\n\t\t\txhr.onreadystatechange = function () {\n\t\t\t\tif (xhr.readyState == 4) {\n\n\t\t\t\t\tif (xhr.status < 400 && xhr.responseText) {\n\t\t\t\t\t\tcode.textContent = xhr.responseText;\n\n\t\t\t\t\t\tPrism.highlightElement(code);\n\t\t\t\t\t\t// mark as loaded\n\t\t\t\t\t\tpre.setAttribute('data-src-loaded', '');\n\t\t\t\t\t}\n\t\t\t\t\telse if (xhr.status >= 400) {\n\t\t\t\t\t\tcode.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcode.textContent = '✖ Error: File does not exist or is empty';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send(null);\n\t\t});\n\t};\n\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\t// execute inside handler, for dropping Event as argument\n\t\tself.Prism.fileHighlight();\n\t});\n\n})();\n"],"sourceRoot":"webpack:///"}