{"version":3,"sources":["webpack://Jcrop/webpack/bootstrap","webpack://Jcrop/./build/js/util/extend.js","webpack://Jcrop/./build/js/domobj.js","webpack://Jcrop/./build/js/rect.js","webpack://Jcrop/./build/js/defaults.js","webpack://Jcrop/./build/js/dragger.js","webpack://Jcrop/./build/js/sticker.js","webpack://Jcrop/./build/js/stage/dom.js","webpack://Jcrop/./build/js/widget.js","webpack://Jcrop/./build/js/handle.js","webpack://Jcrop/./build/js/confobj.js","webpack://Jcrop/./build/js/easing.js","webpack://Jcrop/./build/js/shade.js","webpack://Jcrop/./build/js/jcrop.js","webpack://Jcrop/./build/js/keyboard.js","webpack://Jcrop/./build/js/animate.js","webpack://Jcrop/./build/js/stage/image.js","webpack://Jcrop/./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","webpack://Jcrop/(webpack)/buildin/global.js","webpack://Jcrop/./build/js/loader.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","extended","arguments","argument","prop","DomObj","el","_classCallCheck","this","document","getElementById","appendChild","evname","ev","createEvent","initEvent","cropTarget","dispatchEvent","cl","className","split","filter","join","length","hasClass","handler","addEventListener","e","Rect","x","y","w","h","Math","round","_ref","min","x2","y2","max","x1","y1","rect","normalize","v","fromPoints","p1","p2","_ref2","undefined","from","Array","isArray","fromArray","offsetLeft","offsetTop","offsetWidth","offsetHeight","args","apply","Error","sizeOf","getMax","aspect","fromPoint","point","quad","animateEasingFunction","animateFrames","multi","multiMax","multiMin","cropperClass","disabledClass","canDrag","canResize","canSelect","canRemove","multiple","autoFront","active","handles","shade","shadeClass","shadeColor","shadeOpacity","widgetConstructor","startcb","movecb","donecb","ox","oy","start","obj","type","touches","pageX","pageY","preventDefault","stopPropagation","window","move","done","changedTouches","removeEventListener","remove","Sticker","ord","sw","sh","locked","getCornerPoint","getOppositeCorner","stuck","translateStuckPoint","relx","rely","abs","_stuck","_slicedToArray","xx","yy","sp","_getMaxRect","getMaxRect","_getMaxRect2","getDragQuadrant","res","Stage","options","_this","_possibleConstructorReturn","__proto__","getPrototypeOf","scalex","scaley","crops","Set","enabled","init","ConfObj","initStageDrag","Shade","Manager","attach","_this2","_optconf","limitWidgets","clname","focus","removeWidget","shift","size","crop","pos","stick","_this3","_dragger2","default","canCreate","Widget","offsetParent","addWidget","aspectRatio","render","emit","_this4","z","forEach","style","zIndex","addClass","removeClass","refresh","widget","pop","delete","add","reorderWidgets","shades","enable","disable","attachToStage","appendTo","activate","_extend2","unscale","adjust","_get","setOptions","createHandles","createMover","attachFocus","Keyboard","ar","_Rect$getMax","_Rect$getMax2","stage","frames","efunc","_animate2","then","_this5","pe","parentElement","rebound","_this6","handle","Handle","top","left","width","height","scale","createElement","opts","Defaults","setAttribute","configurable","writable","initOptions","keys","def","swing","b","inQuad","outQuad","inOutQuad","inCubic","outCubic","inOutCubic","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","inElastic","a","asin","outElastic","inOutElastic","inBack","outBack","inOutBack","inBounce","outBounce","inOutBounce","isActive","f","floor","ceil","insert","color","opacity","updateShades","setStyle","backgroundColor","defaults","tagName","ImageStage","Dragger","easing","load","shiftKey","nudge","to","cb","cur","curFrame","Promise","resolve","reject","requestAnimationFrame","step","wrapper","div","parentNode","insertBefore","srcEl","onload","resizeToImage","initResizeObserver","ResizeObserver","entries","observer","observe","_getImageDimensions","getImageDimensions","_getImageDimensions2","_getNaturalDimensions","getNaturalDimensions","_getNaturalDimensions2","nw","nh","rescaleWidgets","sel","naturalWidth","naturalHeight","__webpack_exports__","global","MapShim","Map","getIndex","arr","result","some","entry","index","anonymous","__entries__","prototypeAccessors","set","push","splice","has","clear","callback","ctx","list","defineProperties","isBrowser","global$1","self","Function","requestAnimationFrame$1","setTimeout","Date","now","trailingTimeout","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","indexOf","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","gatherActive","hasActive","broadcastActive","attributes","childList","characterData","subtree","disconnect","ref","propertyName","getInstance","instance_","defineConfigurable","target","props","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","len","reduce","position","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","paddings","getPaddings","horizPad","right","vertPad","bottom","boxSizing","documentElement","isDocumentElement","vertScrollbar","horizScrollbar","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","getSVGContentRect","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","broadcastRect","ResizeObserverEntry","rectInit","contentRect","Constr","DOMRectReadOnly","createReadOnlyRect","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","this$1","observation","map","WeakMap","method","g","eval","Loader","img","check","complete"],"mappings":"sBACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,E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AS3a,EAASE,GAChBya,EAAI5V,oBAAoB,OAAO/E,GAC/B2a,EAAI5V,oBAAoB,QAAQ/E,GACpB,SAAXE,EAAEmE,KAAkB+L,EAAQuK,GAAMtK,EAAOsK,GAG5CA,EAAI1a,iBAAiB,OAAOD,GAC5B2a,EAAI1a,iBAAiB,QAAQD,sDAKjC0a,EAAOE,MAAQ,SAAUD,GACvB,QAAKA,EAAIE,UACgB,IAArBF,EAAI7I,wBAIK4I","file":"jcrop.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","export default function extend () {\n var extended = {};\n\n for (let key in arguments) {\n var argument = arguments[key];\n for (let prop in argument) {\n if (Object.prototype.hasOwnProperty.call(argument, prop)) {\n extended[prop] = argument[prop];\n }\n }\n }\n\n return extended;\n};\n\n","class DomObj {\n\n constructor (el) {\n if (typeof el === 'string') el = document.getElementById(el);\n this.el = el;\n }\n\n appendTo (el) {\n if (typeof el === 'string') el = document.getElementById(el);\n el.appendChild(this.el);\n return this;\n }\n\n emit (evname) {\n const ev = document.createEvent('Event');\n ev.initEvent(evname, true, true);\n ev.cropTarget = this;\n this.el.dispatchEvent(ev);\n }\n\n removeClass (cl) {\n this.el.className = this.el.className\n .split(' ').filter(i => cl !== i).join(' ');\n return this;\n }\n\n hasClass (cl) {\n return this.el.className.split(' ').filter(i => cl === i).length;\n }\n\n addClass (cl) {\n if (!this.hasClass(cl)) this.el.className += ' ' + cl;\n return this;\n }\n\n listen (evname,handler) {\n this.el.addEventListener(evname,e => handler(e.cropTarget,e));\n return this;\n }\n\n}\n\nexport default DomObj;\n\n","/* Rect class -- describes a rectangle with two points, usually\n top left and bottom right. It allows the second set of coordinates\n to be described as either w/h or x2/y2 and allows getting and\n setting of those values such that the object values will always be\n consistent with the latest input. It should be noted that it does not\n attempt to keep these points normalized. That is, you should expect\n to see the actual w/h properties to sometimes be negative values.\n To normalize the values, use the normalize method, which will return\n a new Rect object with normalized values.\n*/\nclass Rect {\n\n constructor () {\n this.x = 0;\n this.y = 0;\n this.w = 0;\n this.h = 0;\n }\n\n set x1 (v) {\n this.w = this.x2 - v;\n this.x = v;\n }\n\n set y1 (v) {\n this.h = this.y2 - v;\n this.y = v;\n }\n\n get x2 () {\n return this.x + this.w;\n }\n\n set x2 (x) {\n this.w = x - this.x;\n }\n\n get y2 () {\n return this.y + this.h;\n }\n\n get aspect () {\n return this.w/this.h;\n }\n\n set y2 (y) {\n this.h = y - this.y;\n }\n\n round () {\n return Rect.create(\n Math.round(this.x),\n Math.round(this.y),\n Math.round(this.w),\n Math.round(this.h)\n );\n }\n\n normalize () {\n const [x1,y1,x2,y2] = [\n Math.min(this.x,this.x2),\n Math.min(this.y,this.y2),\n Math.max(this.x,this.x2),\n Math.max(this.y,this.y2)\n ];\n return Rect.create(x1,y1,x2-x1,y2-y1);\n }\n\n rebound (w,h) {\n const rect = this.normalize();\n if (rect.x<0) rect.x = 0;\n if (rect.y<0) rect.y = 0;\n if (rect.x2>w) rect.x = w-rect.w;\n if (rect.y2>h) rect.y = h-rect.h;\n return rect;\n }\n\n scale (x,y) {\n y = y || x;\n return Rect.create(this.x*x,this.y*y,this.w*x,this.h*y);\n }\n\n unscale (x,y) {\n y = y || x;\n return Rect.create(this.x/x,this.y/y,this.w/x,this.h/y);\n }\n\n center (w,h) {\n return Rect.create(\n (w - this.w)/2,\n (h - this.h)/2,\n this.w, this.h\n );\n }\n\n toArray () {\n return [ this.x, this.y, this.w, this.h ];\n }\n}\n\nRect.fromPoints = function (p1,p2) {\n const [x1,y1,x2,y2] = [\n Math.min(p1[0],p2[0]),\n Math.min(p1[1],p2[1]),\n Math.max(p1[0],p2[0]),\n Math.max(p1[1],p2[1])\n ];\n return Rect.create(x1,y1,x2-x1,y2-y1);\n};\n\nRect.create = function (x=0,y=0,w=0,h=0) {\n const c = new Rect();\n c.x = x;\n c.y = y;\n c.w = w;\n c.h = h;\n return c;\n};\n\nRect.from = function (el) {\n if (Array.isArray(el)) return Rect.fromArray(el);\n const c = new Rect();\n c.x = el.offsetLeft;\n c.y = el.offsetTop;\n c.w = el.offsetWidth;\n c.h = el.offsetHeight;\n return c;\n};\n\nRect.fromArray = function (args) {\n if (args.length === 4) return Rect.create.apply(this,args);\n else if (args.length === 2) return Rect.fromPoints(args[0],args[1]);\n else throw new Error('fromArray method problem');\n};\n\nRect.sizeOf = function (el,y) {\n if (y) return Rect.create(0,0,el,y);\n const c = new Rect();\n c.w = el.offsetWidth;\n c.h = el.offsetHeight;\n return c;\n};\n\nRect.getMax = function (w,h,aspect) {\n if ((w/h) > aspect) return [ h*aspect, h ];\n else return [ w, w/aspect ];\n};\n\nRect.fromPoint = function (point,w,h,quad='br') {\n const c = new Rect();\n c.x = point[0];\n c.y = point[1];\n switch (quad) {\n case 'br':\n c.x2 = c.x + w;\n c.y2 = c.y + h;\n break;\n case 'bl':\n c.x2 = c.x - w;\n c.y2 = c.y + h;\n break;\n case 'tl':\n c.x2 = c.x - w;\n c.y2 = c.y - h;\n break;\n case 'tr':\n c.x2 = c.x + w;\n c.y2 = c.y - h;\n break;\n }\n return c;\n};\n\nexport default Rect;\n\n","export default {\n animateEasingFunction: 'swing',\n animateFrames: 30,\n multi: false,\n multiMax: null,\n multiMin: 1,\n cropperClass: 'jcrop-widget',\n disabledClass: 'jcrop-disable',\n canDrag: true,\n canResize: true,\n canSelect: true,\n canRemove: true,\n multiple: false,\n autoFront: true,\n active: true,\n handles: ['n','s','e','w','sw','nw','ne','se'],\n shade: true,\n shadeClass: 'jcrop-shade',\n shadeColor: 'black',\n shadeOpacity: 0.5,\n widgetConstructor: null,\n x: 0,\n y: 0,\n w: 100,\n h: 100\n};\n\n","/*\n Dragger function - sets up dragging callbacks on an element\n*/\n\nconst Dragger = function (el,startcb,movecb,donecb) {\n var ox, oy;\n if (typeof el === 'string') el = document.getElementById(el);\n\n el.addEventListener('mousedown',start);\n el.addEventListener('touchstart',start);\n\n function start (e) {\n const obj = (e.type === 'touchstart')? e.touches[0]: e;\n\n ox = obj.pageX;\n oy = obj.pageY;\n\n e.preventDefault();\n e.stopPropagation();\n\n if (!startcb(ox,oy,obj)) return;\n\n if (e.type === 'mousedown') {\n window.addEventListener('mousemove',move);\n document.addEventListener('mouseup',done);\n } else if (e.type === 'touchstart') {\n document.addEventListener('touchmove',move);\n document.addEventListener('touchend',done);\n }\n }\n\n function move (e) {\n const obj = (e.type === 'touchmove')? e.changedTouches[0]: e;\n e.stopPropagation();\n movecb(obj.pageX - ox,obj.pageY - oy);\n }\n\n function done (e) {\n const obj = (e.type === 'touchend')? e.changedTouches[0]: e;\n\n if (obj.pageX && obj.pageY) movecb(obj.pageX - ox,obj.pageY - oy);\n\n document.removeEventListener('mouseup',done);\n window.removeEventListener('mousemove',move);\n document.removeEventListener('touchmove',move);\n document.removeEventListener('touchend',done);\n\n donecb();\n }\n\n function remove () {\n el.removeEventListener('mousedown',start);\n el.removeEventListener('touchstart',start);\n }\n\n return { remove };\n};\n\nexport default Dragger;\n","/* This class creates a draggable frame by locking the\n corner opposite to the one being dragged */\n\nimport Rect from './rect';\n\nclass Sticker {\n\n constructor (rect,w,h,ord) {\n this.sw = w;\n this.sh = h;\n this.rect = rect;\n this.locked = this.getCornerPoint(this.getOppositeCorner(ord));\n this.stuck = this.getCornerPoint(ord);\n }\n\n move (x,y) {\n return Rect.fromPoints(this.locked, this.translateStuckPoint(x,y));\n }\n\n // Determine \"quadrant\" of handle drag relative to locked point\n // returns string tl = top left, br = bottom right, etc\n getDragQuadrant (x,y) {\n const relx = this.locked[0] - x;\n const rely = this.locked[1] - y;\n if ((relx < 0) && (rely < 0)) return 'br';\n else if ((relx >= 0) && (rely >= 0)) return 'tl';\n else if ((relx < 0) && (rely >= 0)) return 'tr';\n else return 'bl';\n }\n\n // get the maximum aspect ratio rectangle for the current drag\n getMaxRect (x,y,aspect) {\n return Rect.getMax(\n Math.abs(this.locked[0] - x),\n Math.abs(this.locked[1] - y),\n aspect\n );\n }\n\n // given the offset of the drag versus the stuck point,\n // determine the real dragging coordinates\n translateStuckPoint (ox,oy) {\n const [xx,yy,sp] = this.stuck;\n\n var x = (xx === null)? sp: xx + ox;\n var y = (yy === null)? sp: yy + oy;\n\n if (x > this.sw) x = this.sw;\n if (y > this.sh) y = this.sh;\n if (x < 0) x = 0;\n if (y < 0) y = 0;\n\n if (this.aspect) {\n var [w,h] = this.getMaxRect(x,y,this.aspect);\n var quad = this.getDragQuadrant(x,y);\n var res = Rect.fromPoint(this.locked,w,h,quad);\n return [ res.x2, res.y2 ];\n }\n\n return [x,y];\n }\n\n getCornerPoint (h) {\n const p = this.rect;\n switch (h) {\n case 'n': return [ null, p.y, p.x ];\n case 's': return [ null, p.y2, p.x2 ];\n case 'e': return [ p.x2, null, p.y2 ];\n case 'w': return [ p.x, null, p.y ];\n case 'se': return [ p.x2, p.y2 ];\n case 'sw': return [ p.x, p.y2 ];\n case 'ne': return [ p.x2, p.y ];\n case 'nw': return [ p.x, p.y ];\n }\n }\n\n getOppositeCorner (h) {\n switch (h) {\n case 'n': return 'se';\n case 's': return 'nw';\n case 'e': return 'nw';\n case 'w': return 'se';\n case 'se': return 'nw';\n case 'sw': return 'ne';\n case 'ne': return 'sw';\n case 'nw': return 'se';\n }\n }\n\n}\n\nSticker.create = function (rect,w,h,ord) {\n return new Sticker(rect,w,h,ord);\n};\n\nexport default Sticker;\n","import extend from '../util/extend';\nimport Widget from '../widget';\nimport Shade from '../shade';\nimport Dragger from '../dragger';\nimport ConfObj from '../confobj';\nimport Sticker from '../sticker';\n\nclass Stage extends ConfObj {\n\n constructor (el,options) {\n super(el,options);\n this.scalex = 1;\n this.scaley = 1;\n this.crops = new Set();\n this.active = null;\n this.enabled = true;\n this.init();\n }\n\n init () {\n this.initStageDrag();\n Shade.Manager.attach(this);\n }\n\n initOptions () {\n this._optconf['multi'] = v => { if (!v) this.limitWidgets(); };\n }\n\n setEnabled (v=true) {\n const clname = this.options.disabledClass || 'jcrop-disable';\n this[v?'removeClass':'addClass'](clname);\n this.enabled = !!v;\n return this;\n }\n\n focus () {\n if (!this.enabled) return false;\n if (this.active) this.active.el.focus();\n else this.el.focus();\n return this;\n }\n\n limitWidgets (n=1) {\n if (!this.crops || (n<1)) return false;\n const crops = Array.from(this.crops);\n while (crops.length > n) this.removeWidget(crops.shift());\n return this;\n }\n\n canCreate () {\n const n = this.crops.size;\n const o = this.options;\n if (!this.enabled) return false;\n if ((o.multiMax!==null) && (n >= o.multiMax)) return false;\n if (!o.multi && (n >= o.multiMin)) return false;\n return true;\n }\n\n canRemove () {\n const n = this.crops.size;\n const o = this.options;\n if (!this.enabled) return false;\n if (this.active && !this.active.options.canRemove) return false;\n if (!o.canRemove || (n <= o.multiMin)) return false;\n return true;\n }\n\n initStageDrag () {\n var crop, pos, w, h, stick;\n Dragger(this.el,\n (x,y,e) => {\n if (!this.canCreate()) return false;\n crop = (this.options.widgetConstructor || Widget).create(this.options);\n pos = crop.pos;\n pos.x = e.pageX - this.el.offsetParent.offsetLeft - this.el.offsetLeft;\n pos.y = e.pageY - this.el.offsetParent.offsetTop - this.el.offsetTop;\n w = this.el.offsetWidth;\n h = this.el.offsetHeight;\n this.addWidget(crop);\n stick = Sticker.create(pos,w,h,'se');\n if (this.options.aspectRatio) stick.aspect = this.options.aspectRatio;\n crop.render(pos);\n this.focus();\n return true;\n },\n (x,y) => {\n crop.render(stick.move(x,y));\n },\n () => {\n crop.emit('crop.change');\n }\n );\n }\n\n reorderWidgets () {\n var z = 10;\n this.crops.forEach(crop => {\n crop.el.style.zIndex = z++;\n if (this.active === crop) crop.addClass('active');\n else crop.removeClass('active');\n });\n this.refresh();\n }\n\n activate (widget) {\n if (!this.enabled) return this;\n widget = widget || Array.from(this.crops).pop();\n if (widget) {\n if (this.active === widget) return;\n this.active = widget;\n this.crops.delete(widget);\n this.crops.add(widget);\n this.reorderWidgets();\n this.active.el.focus();\n this.options.shade && this.shades.enable();\n widget.emit('crop.activate');\n } else {\n this.shades.disable();\n }\n return this;\n }\n\n addWidget (widget) {\n widget.attachToStage(this);\n widget.appendTo(this.el);\n this.activate(widget);\n return this;\n }\n\n newWidget (rect,options={}) {\n options = extend({},this.options,options);\n const crop = (this.options.widgetConstructor || Widget).create(options);\n crop.render(rect.unscale(this.scalex,this.scaley));\n this.addWidget(crop);\n crop.el.focus();\n return crop;\n }\n\n removeWidget (widget) {\n if (!this.canRemove()) return false;\n widget.emit('crop.remove');\n widget.el.remove();\n this.crops.delete(widget);\n this.activate();\n }\n\n refresh () {\n this.crops.forEach(crop => { crop.render(); });\n this.options.shade && this.active &&\n this.shades.adjust(this.active.pos);\n }\n\n updateShades () {\n if (!this.shades) return;\n\n if (this.options.shade) this.shades.enable();\n else this.shades.disable();\n\n this.options.shade && this.active &&\n this.shades.adjust(this.active.pos);\n\n return this;\n }\n\n setOptions (options={}) {\n super.setOptions(options);\n if (this.crops) Array.from(this.crops).forEach(i => i.setOptions(options));\n }\n\n destroy () {\n }\n\n}\n\nexport default Stage;\n\n","import extend from './util/extend';\nimport Handle from './handle';\nimport Defaults from './defaults';\nimport Dragger from './dragger';\nimport Rect from './rect';\nimport Sticker from './sticker';\nimport ConfObj from './confobj';\nimport Keyboard from './keyboard';\nimport Animate from './animate';\n\nclass Widget extends ConfObj {\n\n constructor (el,options={}) {\n super(el,options);\n this.pos = Rect.from(this.el);\n this.init();\n }\n\n init () {\n this.createHandles();\n this.createMover();\n this.attachFocus();\n Keyboard.attach(this);\n return this;\n }\n\n initOptions () {\n this._optconf['aspectRatio'] = ar => {\n const p = this.pos;\n this.aspect = ar || null;\n if (this.aspect && p) {\n var [w,h] = Rect.getMax(p.w,p.h,ar);\n this.render(Rect.fromPoint([p.x,p.y],w,h));\n }\n };\n }\n\n attachToStage (stage) {\n this.stage = stage;\n this.emit('crop.attach');\n }\n\n attachFocus () {\n this.el.addEventListener('focus',(e) => {\n this.stage.activate(this);\n this.emit('crop.update');\n },false);\n }\n\n animate (rect,frames,efunc) {\n const t = this;\n efunc = efunc || t.options.animateEasingFunction || 'swing';\n frames = frames || t.options.animateFrames || 30;\n return Animate(t.el,t.pos,rect,r => t.render(r.normalize()),frames,efunc)\n .then(() => this.emit('crop.change'));\n }\n\n createMover () {\n var w,h;\n this.pos = Rect.from(this.el);\n var stick;\n Dragger(\n this.el,\n () => {\n const pe = this.el.parentElement;\n if (!this.stage.enabled) return false;\n [w,h] = [ pe.offsetWidth, pe.offsetHeight ];\n stick = Rect.from(this.el);\n this.el.focus();\n this.stage.activate(this);\n return true;\n },\n (x,y) => {\n this.pos.x = stick.x + x;\n this.pos.y = stick.y + y;\n this.render(this.pos.rebound(w,h));\n },\n () => {\n this.emit('crop.change');\n }\n );\n }\n\n nudge (x=0,y=0) {\n const pe = this.el.parentElement;\n const [w,h] = [ pe.offsetWidth, pe.offsetHeight ];\n if (x) this.pos.x += x;\n if (y) this.pos.y += y;\n this.render(this.pos.rebound(w,h));\n this.emit('crop.change');\n }\n\n createHandles () {\n this.options.handles.forEach(c => {\n const handle = Handle.create('jcrop-handle '+c);\n handle.appendTo(this.el);\n\n var stick;\n Dragger(handle.el,\n () => {\n if (!this.stage.enabled) return false;\n const pe = this.el.parentElement;\n const w = pe.offsetWidth;\n const h = pe.offsetHeight;\n stick = Sticker.create(Rect.from(this.el), w, h, c);\n if (this.aspect) stick.aspect = this.aspect;\n this.el.focus();\n this.emit('crop.active');\n return true;\n },\n (x,y) => this.render(stick.move(x,y)),\n () => {\n this.emit('crop.change');\n }\n );\n });\n return this;\n }\n\n isActive () {\n return (this.stage && (this.stage.active === this));\n }\n\n get sel () {\n const s = this.stage;\n return this.pos.scale(s.scalex,s.scaley);\n }\n\n render (r) {\n r = r || this.pos;\n this.el.style.top = Math.round(r.y) + 'px';\n this.el.style.left = Math.round(r.x) + 'px';\n this.el.style.width = Math.round(r.w) + 'px';\n this.el.style.height = Math.round(r.h) + 'px';\n this.pos = r;\n this.emit('crop.update');\n return this;\n }\n\n doneDragging () {\n this.pos = Rect.from(this.el);\n }\n\n}\n\nWidget.create = function (options={}) {\n const el = document.createElement('div');\n const opts = extend({},Defaults,options);\n el.setAttribute('tabindex','0');\n el.className = opts.cropperClass || 'jcrop-widget';\n return new (options.widgetConstructor || Widget)(el,opts);\n};\n\nexport default Widget;\n","import DomObj from './domobj';\n\nclass Handle extends DomObj {\n}\n\nHandle.create = function (clname) {\n const el = document.createElement('div');\n el.className = clname;\n return new Handle(el);\n};\n\nexport default Handle;\n","import extend from './util/extend';\nimport DomObj from './domobj';\nimport Defaults from './defaults';\n\nclass ConfObj extends DomObj {\n\n constructor (el, options = {}) {\n super(el);\n this.options = {};\n Object.defineProperty(this, '_optconf', {\n configurable: false,\n enumerable: false,\n value: {},\n writable: true\n });\n this.initOptions();\n this.setOptions(extend({},Defaults,options));\n }\n\n setOptions (options) {\n this.options = extend({},this.options,options);\n\n Object.keys(options).forEach(key => {\n if (this._optconf[key]) this._optconf[key](options[key]);\n });\n\n return this;\n }\n\n initOptions () { }\n\n}\n\nexport default ConfObj;\n","/* ============================================================\n * Easing functions adapted from jQuery easing library\n * Open source under the BSD License.\n *\n * Copyright © 2008 George McGinley Smith\n * All rights reserved.\n * ======================================================== */\n/* eslint-disable */\n\nconst m = module.exports = {\n // t: current time, b: begInnIng value, c: change In value, d: duration\n def: 'outQuad',\n swing: function (t, b, c, d) {\n return m[m.def](t, b, c, d);\n },\n inQuad: function (t, b, c, d) {\n return c*(t/=d)*t + b;\n },\n outQuad: function (t, b, c, d) {\n return -c *(t/=d)*(t-2) + b;\n },\n inOutQuad: function (t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t + b;\n return -c/2 * ((--t)*(t-2) - 1) + b;\n },\n inCubic: function (t, b, c, d) {\n return c*(t/=d)*t*t + b;\n },\n outCubic: function (t, b, c, d) {\n return c*((t=t/d-1)*t*t + 1) + b;\n },\n inOutCubic: function (t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t*t + b;\n return c/2*((t-=2)*t*t + 2) + b;\n },\n inQuart: function (t, b, c, d) {\n return c*(t/=d)*t*t*t + b;\n },\n outQuart: function (t, b, c, d) {\n return -c * ((t=t/d-1)*t*t*t - 1) + b;\n },\n inOutQuart: function (t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t*t*t + b;\n return -c/2 * ((t-=2)*t*t*t - 2) + b;\n },\n inQuint: function (t, b, c, d) {\n return c*(t/=d)*t*t*t*t + b;\n },\n outQuint: function (t, b, c, d) {\n return c*((t=t/d-1)*t*t*t*t + 1) + b;\n },\n inOutQuint: function (t, b, c, d) {\n if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;\n return c/2*((t-=2)*t*t*t*t + 2) + b;\n },\n inSine: function (t, b, c, d) {\n return -c * Math.cos(t/d * (Math.PI/2)) + c + b;\n },\n outSine: function (t, b, c, d) {\n return c * Math.sin(t/d * (Math.PI/2)) + b;\n },\n inOutSine: function (t, b, c, d) {\n return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;\n },\n inExpo: function (t, b, c, d) {\n return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;\n },\n outExpo: function (t, b, c, d) {\n return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;\n },\n inOutExpo: function (t, b, c, d) {\n if (t==0) return b;\n if (t==d) return b+c;\n if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;\n return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;\n },\n inCirc: function (t, b, c, d) {\n return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;\n },\n outCirc: function (t, b, c, d) {\n return c * Math.sqrt(1 - (t=t/d-1)*t) + b;\n },\n inOutCirc: function (t, b, c, d) {\n if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;\n },\n inElastic: function (t, b, c, d) {\n var s=1.70158;var p=0;var a=c;\n if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n if (a < Math.abs(c)) { a=c; var s=p/4; }\n else var s = p/(2*Math.PI) * Math.asin (c/a);\n return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n },\n outElastic: function (t, b, c, d) {\n var s=1.70158;var p=0;var a=c;\n if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n if (a < Math.abs(c)) { a=c; var s=p/4; }\n else var s = p/(2*Math.PI) * Math.asin (c/a);\n return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;\n },\n inOutElastic: function (t, b, c, d) {\n var s=1.70158;var p=0;var a=c;\n if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);\n if (a < Math.abs(c)) { a=c; var s=p/4; }\n else var s = p/(2*Math.PI) * Math.asin (c/a);\n if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;\n },\n inBack: function (t, b, c, d, s) {\n if (s == undefined) s = 1.70158;\n return c*(t/=d)*t*((s+1)*t - s) + b;\n },\n outBack: function (t, b, c, d, s) {\n if (s == undefined) s = 1.70158;\n return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n },\n inOutBack: function (t, b, c, d, s) {\n if (s == undefined) s = 1.70158; \n if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;\n return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;\n },\n inBounce: function (t, b, c, d) {\n return c - m.outBounce (d-t, 0, c, d) + b;\n },\n outBounce: function (t, b, c, d) {\n if ((t/=d) < (1/2.75)) {\n return c*(7.5625*t*t) + b;\n } else if (t < (2/2.75)) {\n return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;\n } else if (t < (2.5/2.75)) {\n return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;\n } else {\n return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;\n }\n },\n inOutBounce: function (t, b, c, d) {\n if (t < d/2) return m.inBounce (t*2, 0, c, d) * .5 + b;\n return m.outBounce (t*2-d, 0, c, d) * .5 + c*.5 + b;\n }\n};\n\n/*\n * TERMS OF USE - EASING EQUATIONS\n * Open source under the BSD License. \n * \n * Copyright © 2001 Robert Penner All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification, \n * are permitted provided that the following conditions are 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 the author nor the names of contributors may be\n * used to endorse or promote products derived from this software\n * 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\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n */\n","import Rect from './rect';\nimport DomObj from './domobj';\n\nclass Manager {\n constructor (el) {\n if (typeof el === 'string') el = document.getElementById(el);\n this.el = el;\n this.shades = {};\n }\n\n init (options={}) {\n this.active = (options.shade!==undefined)? options.shade: true;\n\n this.keys().forEach(\n key => { this.shades[key] = Shade.create(options,key); }\n );\n\n this.el.addEventListener('crop.update',(e) => {\n if (e.cropTarget.isActive() && e.cropTarget.options.shade) {\n this.adjust(e.cropTarget.pos);\n }\n },false);\n\n this.enable();\n }\n\n adjust (rect) {\n const f = Rect.from(this.el);\n const s = this.shades;\n s.t.h = rect.y;\n s.b.h = f.h - rect.y2;\n s.t.w = s.b.w = Math.floor(rect.w);\n s.l.w = s.t.x = s.b.x = Math.ceil(rect.x);\n s.r.w = f.w - (Math.ceil(rect.x) + Math.floor(rect.w));\n }\n\n keys () {\n return [ 't', 'l', 'r', 'b' ];\n }\n\n enable () {\n const s = this.shades;\n this.keys().forEach(key => s[key].insert(this.el));\n }\n\n disable () {\n const s = this.shades;\n this.keys().forEach(key => s[key].remove());\n }\n\n setStyle (color,opacity) {\n const s = this.shades;\n this.keys().forEach(key => s[key].color(color).opacity(opacity));\n }\n\n}\n\nManager.attach = function (i) {\n const el = i.el;\n const m = new Manager(el);\n m.init(i.options);\n i.shades = m;\n i._optconf['shade'] = v => i.updateShades();\n i._optconf['shadeColor'] = v => m.setStyle(v);\n i._optconf['shadeOpacity'] = v => m.setStyle(null,v);\n return m;\n};\n\nclass Shade extends DomObj {\n insert (el) { el.appendChild(this.el); }\n remove () { this.el.remove(); }\n\n set w (w) { this.el.style.width = w + 'px'; }\n set h (h) { this.el.style.height = h + 'px'; }\n set x (l) { this.el.style.left = l + 'px'; }\n\n color (c) {\n if (c) this.el.style.backgroundColor = c;\n return this;\n }\n\n opacity (o) {\n if (o) this.el.style.opacity = o;\n return this;\n }\n}\n\nShade.create = function (o,key) {\n const el = document.createElement('div');\n const clname = o.shadeClass || 'jcrop-shade';\n el.className = `${clname} ${key}`;\n const obj = new Shade(el);\n return obj.color(o.shadeColor).opacity(o.shadeOpacity);\n};\n\nShade.Manager = Manager;\n\nexport default Shade;\n","import extend from './util/extend';\nimport defaults from './defaults';\nimport Stage from './stage/dom';\nimport ImageStage from './stage/image';\nimport Widget from './widget';\nimport Shade from './shade';\nimport Handle from './handle';\nimport Dragger from './dragger';\nimport Rect from './rect';\nimport Sticker from './sticker';\nimport DomObj from './domobj';\nimport easing from './easing';\nimport load from './loader';\n\nexport function attach (el,options={}) {\n options = extend({},defaults,options);\n\n if (typeof el === 'string') el = document.getElementById(el);\n if (el.tagName === 'IMG') return new ImageStage(el,options);\n\n return new Stage(el,options);\n}\n\nexport { Stage, defaults, Dragger, Widget, Rect, Handle, Sticker, easing, load, Shade, DomObj };\n\nexport default { Stage, defaults, Dragger, Widget, Rect, Handle, Sticker, easing, load, attach, Shade, DomObj };\n","class Keyboard {\n constructor (widget) {\n this.widget = widget;\n this.attach();\n }\n\n attach () {\n const c = this.widget;\n c.el.addEventListener('keydown',(e) => {\n const d = e.shiftKey ? 10 : 1;\n switch (e.key) {\n case 'ArrowRight': c.nudge(d); break;\n case 'ArrowLeft': c.nudge(-d); break;\n case 'ArrowUp': c.nudge(0,-d); break;\n case 'ArrowDown': c.nudge(0,d); break;\n\n case 'Delete':\n case 'Backspace':\n c.stage.removeWidget(c);\n break;\n\n default: return;\n }\n e.preventDefault();\n });\n }\n}\n\nKeyboard.attach = function (widget) {\n return new Keyboard(widget);\n};\n\nexport default Keyboard;\n","import easing from './easing';\n\n// Animate function uses requestAnimationFrame to sequence events\n// Easing functions adapted from jQuery-ui and Robert Penner's equations\n// el - element to animate\n// from and to - \"rect\" objects representing initial and target coordinates\n// cb - callback receives a \"rect\" object for each update/frame\n// frames - number of frames to animate\n// efunc - name of easing function to use\n// returns a Promise that resolves when the animation is complete\n\nfunction Animate (el,from,to,cb,frames=30,efunc='swing') {\n // Set the keys to update, in this case it is our Rect's properties\n // Normalize the initial state as a Rect named \"cur\"\n const p = ['x','y','w','h'];\n const cur = from.normalize();\n\n // Lookup the easing function if it is a string\n efunc = (typeof efunc === 'string')? easing[efunc] : efunc;\n\n var curFrame = 0;\n\n // Return a promise that will resolve when the animation is complete\n return new Promise((resolve,reject) => {\n function step () {\n if (curFrame < frames) {\n // Update each key for this frame\n p.forEach(key => {\n cur[key] = Math.round(efunc(curFrame,from[key],to[key]-from[key],frames));\n });\n\n // Send it to the callback function\n // update the current frame counter\n // and request the next animation frame\n cb(cur);\n curFrame++;\n requestAnimationFrame(step);\n } else {\n // We've reached the end of the animation frames\n cb(to);\n resolve();\n }\n }\n\n requestAnimationFrame(step);\n });\n}\n\nexport default Animate;\n","import Stage from './dom';\nimport ResizeObserver from 'resize-observer-polyfill';\n\nfunction div (clname,el = document.createElement('div')) {\n el.className = clname;\n return el;\n}\n\nclass ImageStage extends Stage {\n constructor (el,options) {\n const wrapper = div('jcrop-stage jcrop-image-stage');\n el.parentNode.insertBefore(wrapper, el);\n // CSS positioning changed\n // wrapper.appendChild(el);\n super(wrapper,options);\n this.srcEl = el;\n el.onload = this.resizeToImage.bind(this);\n this.resizeToImage();\n this.initResizeObserver();\n }\n\n initResizeObserver () {\n const ro = new ResizeObserver((entries, observer) => {\n this.resizeToImage();\n });\n ro.observe(this.srcEl);\n }\n\n resizeToImage () {\n const [w,h] = this.getImageDimensions();\n const [nw,nh] = this.getNaturalDimensions();\n this.el.style.width = w+'px';\n this.el.style.height = h+'px';\n this.rescaleWidgets(w/nw,h/nh);\n this.scalex = nw/w;\n this.scaley = nh/h;\n this.refresh();\n }\n\n rescaleWidgets (x,y) {\n this.crops.forEach(crop => {\n crop.pos = crop.sel.scale(x,y);\n });\n }\n\n getImageDimensions () {\n return [ this.srcEl.width, this.srcEl.height ];\n }\n\n getNaturalDimensions () {\n return [\n this.srcEl.naturalWidth || this.srcEl.width,\n this.srcEl.naturalHeight || this.srcEl.height\n ];\n }\n\n destroy () {\n this.el.remove();\n }\n}\n\nexport default ImageStage;\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\n/* eslint-disable require-jsdoc, valid-jsdoc */\nvar MapShim = (function () {\n if (typeof Map !== 'undefined') {\n return Map;\n }\n\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\n function getIndex(arr, key) {\n var result = -1;\n\n arr.some(function (entry, index) {\n if (entry[0] === key) {\n result = index;\n\n return true;\n }\n\n return false;\n });\n\n return result;\n }\n\n return (function () {\n function anonymous() {\n this.__entries__ = [];\n }\n\n var prototypeAccessors = { size: { configurable: true } };\n\n /**\r\n * @returns {boolean}\r\n */\n prototypeAccessors.size.get = function () {\n return this.__entries__.length;\n };\n\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\n anonymous.prototype.get = function (key) {\n var index = getIndex(this.__entries__, key);\n var entry = this.__entries__[index];\n\n return entry && entry[1];\n };\n\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\n anonymous.prototype.set = function (key, value) {\n var index = getIndex(this.__entries__, key);\n\n if (~index) {\n this.__entries__[index][1] = value;\n } else {\n this.__entries__.push([key, value]);\n }\n };\n\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\n anonymous.prototype.delete = function (key) {\n var entries = this.__entries__;\n var index = getIndex(entries, key);\n\n if (~index) {\n entries.splice(index, 1);\n }\n };\n\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\n anonymous.prototype.has = function (key) {\n return !!~getIndex(this.__entries__, key);\n };\n\n /**\r\n * @returns {void}\r\n */\n anonymous.prototype.clear = function () {\n this.__entries__.splice(0);\n };\n\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\n anonymous.prototype.forEach = function (callback, ctx) {\n var this$1 = this;\n if ( ctx === void 0 ) ctx = null;\n\n for (var i = 0, list = this$1.__entries__; i < list.length; i += 1) {\n var entry = list[i];\n\n callback.call(ctx, entry[1], entry[0]);\n }\n };\n\n Object.defineProperties( anonymous.prototype, prototypeAccessors );\n\n return anonymous;\n }());\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\nvar global$1 = (function () {\n if (typeof global !== 'undefined' && global.Math === Math) {\n return global;\n }\n\n if (typeof self !== 'undefined' && self.Math === Math) {\n return self;\n }\n\n if (typeof window !== 'undefined' && window.Math === Math) {\n return window;\n }\n\n // eslint-disable-next-line no-new-func\n return Function('return this')();\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\nvar requestAnimationFrame$1 = (function () {\n if (typeof requestAnimationFrame === 'function') {\n // It's required to use a bounded function because IE sometimes throws\n // an \"Invalid calling object\" error if rAF is invoked without the global\n // object on the left hand side.\n return requestAnimationFrame.bind(global$1);\n }\n\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\n})();\n\n// Defines minimum timeout before adding a trailing call.\nvar trailingTimeout = 2;\n\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\nvar throttle = function (callback, delay) {\n var leadingCall = false,\n trailingCall = false,\n lastCallTime = 0;\n\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\n function resolvePending() {\n if (leadingCall) {\n leadingCall = false;\n\n callback();\n }\n\n if (trailingCall) {\n proxy();\n }\n }\n\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\n function timeoutCallback() {\n requestAnimationFrame$1(resolvePending);\n }\n\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\n function proxy() {\n var timeStamp = Date.now();\n\n if (leadingCall) {\n // Reject immediately following calls.\n if (timeStamp - lastCallTime < trailingTimeout) {\n return;\n }\n\n // Schedule new call to be in invoked when the pending one is resolved.\n // This is important for \"transitions\" which never actually start\n // immediately so there is a chance that we might miss one if change\n // happens amids the pending invocation.\n trailingCall = true;\n } else {\n leadingCall = true;\n trailingCall = false;\n\n setTimeout(timeoutCallback, delay);\n }\n\n lastCallTime = timeStamp;\n }\n\n return proxy;\n};\n\n// Minimum delay before invoking the update of observers.\nvar REFRESH_DELAY = 20;\n\n// A list of substrings of CSS properties used to find transition events that\n// might affect dimensions of observed elements.\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\n\n// Check if MutationObserver is available.\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\n\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\nvar ResizeObserverController = function() {\n this.connected_ = false;\n this.mutationEventsAdded_ = false;\n this.mutationsObserver_ = null;\n this.observers_ = [];\n\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n};\n\n/**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\n\n\n/**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\n\n\n/**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\n\n/**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\nResizeObserverController.prototype.addObserver = function (observer) {\n if (!~this.observers_.indexOf(observer)) {\n this.observers_.push(observer);\n }\n\n // Add listeners if they haven't been added yet.\n if (!this.connected_) {\n this.connect_();\n }\n};\n\n/**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\nResizeObserverController.prototype.removeObserver = function (observer) {\n var observers = this.observers_;\n var index = observers.indexOf(observer);\n\n // Remove observer if it's present in registry.\n if (~index) {\n observers.splice(index, 1);\n }\n\n // Remove listeners if controller has no connected observers.\n if (!observers.length && this.connected_) {\n this.disconnect_();\n }\n};\n\n/**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\nResizeObserverController.prototype.refresh = function () {\n var changesDetected = this.updateObservers_();\n\n // Continue running updates if changes have been detected as there might\n // be future ones caused by CSS transitions.\n if (changesDetected) {\n this.refresh();\n }\n};\n\n/**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\nResizeObserverController.prototype.updateObservers_ = function () {\n // Collect observers that have active observations.\n var activeObservers = this.observers_.filter(function (observer) {\n return observer.gatherActive(), observer.hasActive();\n });\n\n // Deliver notifications in a separate cycle in order to avoid any\n // collisions between observers, e.g. when multiple instances of\n // ResizeObserver are tracking the same element and the callback of one\n // of them changes content dimensions of the observed target. Sometimes\n // this may result in notifications being blocked for the rest of observers.\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\n\n return activeObservers.length > 0;\n};\n\n/**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\nResizeObserverController.prototype.connect_ = function () {\n // Do nothing if running in a non-browser environment or if listeners\n // have been already added.\n if (!isBrowser || this.connected_) {\n return;\n }\n\n // Subscription to the \"Transitionend\" event is used as a workaround for\n // delayed transitions. This way it's possible to capture at least the\n // final state of an element.\n document.addEventListener('transitionend', this.onTransitionEnd_);\n\n window.addEventListener('resize', this.refresh);\n\n if (mutationObserverSupported) {\n this.mutationsObserver_ = new MutationObserver(this.refresh);\n\n this.mutationsObserver_.observe(document, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n } else {\n document.addEventListener('DOMSubtreeModified', this.refresh);\n\n this.mutationEventsAdded_ = true;\n }\n\n this.connected_ = true;\n};\n\n/**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\nResizeObserverController.prototype.disconnect_ = function () {\n // Do nothing if running in a non-browser environment or if listeners\n // have been already removed.\n if (!isBrowser || !this.connected_) {\n return;\n }\n\n document.removeEventListener('transitionend', this.onTransitionEnd_);\n window.removeEventListener('resize', this.refresh);\n\n if (this.mutationsObserver_) {\n this.mutationsObserver_.disconnect();\n }\n\n if (this.mutationEventsAdded_) {\n document.removeEventListener('DOMSubtreeModified', this.refresh);\n }\n\n this.mutationsObserver_ = null;\n this.mutationEventsAdded_ = false;\n this.connected_ = false;\n};\n\n/**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\nResizeObserverController.prototype.onTransitionEnd_ = function (ref) {\n var propertyName = ref.propertyName; if ( propertyName === void 0 ) propertyName = '';\n\n // Detect whether transition may affect dimensions of an element.\n var isReflowProperty = transitionKeys.some(function (key) {\n return !!~propertyName.indexOf(key);\n });\n\n if (isReflowProperty) {\n this.refresh();\n }\n};\n\n/**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\nResizeObserverController.getInstance = function () {\n if (!this.instance_) {\n this.instance_ = new ResizeObserverController();\n }\n\n return this.instance_;\n};\n\nResizeObserverController.instance_ = null;\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\nvar defineConfigurable = (function (target, props) {\n for (var i = 0, list = Object.keys(props); i < list.length; i += 1) {\n var key = list[i];\n\n Object.defineProperty(target, key, {\n value: props[key],\n enumerable: false,\n writable: false,\n configurable: true\n });\n }\n\n return target;\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\nvar getWindowOf = (function (target) {\n // Assume that the element is an instance of Node, which means that it\n // has the \"ownerDocument\" property from which we can retrieve a\n // corresponding global object.\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\n\n // Return the local global object if it's not possible extract one from\n // provided element.\n return ownerGlobal || global$1;\n});\n\n// Placeholder of an empty content rectangle.\nvar emptyRect = createRectInit(0, 0, 0, 0);\n\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\nfunction toFloat(value) {\n return parseFloat(value) || 0;\n}\n\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\nfunction getBordersSize(styles) {\n var positions = [], len = arguments.length - 1;\n while ( len-- > 0 ) positions[ len ] = arguments[ len + 1 ];\n\n return positions.reduce(function (size, position) {\n var value = styles['border-' + position + '-width'];\n\n return size + toFloat(value);\n }, 0);\n}\n\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\nfunction getPaddings(styles) {\n var positions = ['top', 'right', 'bottom', 'left'];\n var paddings = {};\n\n for (var i = 0, list = positions; i < list.length; i += 1) {\n var position = list[i];\n\n var value = styles['padding-' + position];\n\n paddings[position] = toFloat(value);\n }\n\n return paddings;\n}\n\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\nfunction getSVGContentRect(target) {\n var bbox = target.getBBox();\n\n return createRectInit(0, 0, bbox.width, bbox.height);\n}\n\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\nfunction getHTMLElementContentRect(target) {\n // Client width & height properties can't be\n // used exclusively as they provide rounded values.\n var clientWidth = target.clientWidth;\n var clientHeight = target.clientHeight;\n\n // By this condition we can catch all non-replaced inline, hidden and\n // detached elements. Though elements with width & height properties less\n // than 0.5 will be discarded as well.\n //\n // Without it we would need to implement separate methods for each of\n // those cases and it's not possible to perform a precise and performance\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\n // gives wrong results for elements with width & height less than 0.5.\n if (!clientWidth && !clientHeight) {\n return emptyRect;\n }\n\n var styles = getWindowOf(target).getComputedStyle(target);\n var paddings = getPaddings(styles);\n var horizPad = paddings.left + paddings.right;\n var vertPad = paddings.top + paddings.bottom;\n\n // Computed styles of width & height are being used because they are the\n // only dimensions available to JS that contain non-rounded values. It could\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\n // affected by CSS transformations let alone paddings, borders and scroll bars.\n var width = toFloat(styles.width),\n height = toFloat(styles.height);\n\n // Width & height include paddings and borders when the 'border-box' box\n // model is applied (except for IE).\n if (styles.boxSizing === 'border-box') {\n // Following conditions are required to handle Internet Explorer which\n // doesn't include paddings and borders to computed CSS dimensions.\n //\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\n // properties then it's either IE, and thus we don't need to subtract\n // anything, or an element merely doesn't have paddings/borders styles.\n if (Math.round(width + horizPad) !== clientWidth) {\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\n }\n\n if (Math.round(height + vertPad) !== clientHeight) {\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\n }\n }\n\n // Following steps can't be applied to the document's root element as its\n // client[Width/Height] properties represent viewport area of the window.\n // Besides, it's as well not necessary as the itself neither has\n // rendered scroll bars nor it can be clipped.\n if (!isDocumentElement(target)) {\n // In some browsers (only in Firefox, actually) CSS width & height\n // include scroll bars size which can be removed at this step as scroll\n // bars are the only difference between rounded dimensions + paddings\n // and \"client\" properties, though that is not always true in Chrome.\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\n\n // Chrome has a rather weird rounding of \"client\" properties.\n // E.g. for an element with content width of 314.2px it sometimes gives\n // the client width of 315px and for the width of 314.7px it may give\n // 314px. And it doesn't happen all the time. So just ignore this delta\n // as a non-relevant.\n if (Math.abs(vertScrollbar) !== 1) {\n width -= vertScrollbar;\n }\n\n if (Math.abs(horizScrollbar) !== 1) {\n height -= horizScrollbar;\n }\n }\n\n return createRectInit(paddings.left, paddings.top, width, height);\n}\n\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\nvar isSVGGraphicsElement = (function () {\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\n // interface.\n if (typeof SVGGraphicsElement !== 'undefined') {\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\n }\n\n // If it's so, then check that element is at least an instance of the\n // SVGElement and that it has the \"getBBox\" method.\n // eslint-disable-next-line no-extra-parens\n return function (target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'; };\n})();\n\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\nfunction isDocumentElement(target) {\n return target === getWindowOf(target).document.documentElement;\n}\n\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\nfunction getContentRect(target) {\n if (!isBrowser) {\n return emptyRect;\n }\n\n if (isSVGGraphicsElement(target)) {\n return getSVGContentRect(target);\n }\n\n return getHTMLElementContentRect(target);\n}\n\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\nfunction createReadOnlyRect(ref) {\n var x = ref.x;\n var y = ref.y;\n var width = ref.width;\n var height = ref.height;\n\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\n var rect = Object.create(Constr.prototype);\n\n // Rectangle's properties are not writable and non-enumerable.\n defineConfigurable(rect, {\n x: x, y: y, width: width, height: height,\n top: y,\n right: x + width,\n bottom: height + y,\n left: x\n });\n\n return rect;\n}\n\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\nfunction createRectInit(x, y, width, height) {\n return { x: x, y: y, width: width, height: height };\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\nvar ResizeObservation = function(target) {\n this.broadcastWidth = 0;\n this.broadcastHeight = 0;\n this.contentRect_ = createRectInit(0, 0, 0, 0);\n\n this.target = target;\n};\n\n/**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\n\n\n/**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\n\n\n/**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\nResizeObservation.prototype.isActive = function () {\n var rect = getContentRect(this.target);\n\n this.contentRect_ = rect;\n\n return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;\n};\n\n/**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\nResizeObservation.prototype.broadcastRect = function () {\n var rect = this.contentRect_;\n\n this.broadcastWidth = rect.width;\n this.broadcastHeight = rect.height;\n\n return rect;\n};\n\nvar ResizeObserverEntry = function(target, rectInit) {\n var contentRect = createReadOnlyRect(rectInit);\n\n // According to the specification following properties are not writable\n // and are also not enumerable in the native implementation.\n //\n // Property accessors are not being used as they'd require to define a\n // private WeakMap storage which may cause memory leaks in browsers that\n // don't support this type of collections.\n defineConfigurable(this, { target: target, contentRect: contentRect });\n};\n\nvar ResizeObserverSPI = function(callback, controller, callbackCtx) {\n this.activeObservations_ = [];\n this.observations_ = new MapShim();\n\n if (typeof callback !== 'function') {\n throw new TypeError('The callback provided as parameter 1 is not a function.');\n }\n\n this.callback_ = callback;\n this.controller_ = controller;\n this.callbackCtx_ = callbackCtx;\n};\n\n/**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\n\n\n/**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\n\n\n/**\r\n * Public ResizeObserver instance which will be passed to the callback\r\n * function and used as a value of it's \"this\" binding.\r\n *\r\n * @private {ResizeObserver}\r\n */\n\n/**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\nResizeObserverSPI.prototype.observe = function (target) {\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n }\n\n // Do nothing if current environment doesn't have the Element interface.\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\n return;\n }\n\n if (!(target instanceof getWindowOf(target).Element)) {\n throw new TypeError('parameter 1 is not of type \"Element\".');\n }\n\n var observations = this.observations_;\n\n // Do nothing if element is already being observed.\n if (observations.has(target)) {\n return;\n }\n\n observations.set(target, new ResizeObservation(target));\n\n this.controller_.addObserver(this);\n\n // Force the update of observations.\n this.controller_.refresh();\n};\n\n/**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\nResizeObserverSPI.prototype.unobserve = function (target) {\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n }\n\n // Do nothing if current environment doesn't have the Element interface.\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\n return;\n }\n\n if (!(target instanceof getWindowOf(target).Element)) {\n throw new TypeError('parameter 1 is not of type \"Element\".');\n }\n\n var observations = this.observations_;\n\n // Do nothing if element is not being observed.\n if (!observations.has(target)) {\n return;\n }\n\n observations.delete(target);\n\n if (!observations.size) {\n this.controller_.removeObserver(this);\n }\n};\n\n/**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\nResizeObserverSPI.prototype.disconnect = function () {\n this.clearActive();\n this.observations_.clear();\n this.controller_.removeObserver(this);\n};\n\n/**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\nResizeObserverSPI.prototype.gatherActive = function () {\n var this$1 = this;\n\n this.clearActive();\n\n this.observations_.forEach(function (observation) {\n if (observation.isActive()) {\n this$1.activeObservations_.push(observation);\n }\n });\n};\n\n/**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\nResizeObserverSPI.prototype.broadcastActive = function () {\n // Do nothing if observer doesn't have active observations.\n if (!this.hasActive()) {\n return;\n }\n\n var ctx = this.callbackCtx_;\n\n // Create ResizeObserverEntry instance for every active observation.\n var entries = this.activeObservations_.map(function (observation) {\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\n });\n\n this.callback_.call(ctx, entries, ctx);\n this.clearActive();\n};\n\n/**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\nResizeObserverSPI.prototype.clearActive = function () {\n this.activeObservations_.splice(0);\n};\n\n/**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\nResizeObserverSPI.prototype.hasActive = function () {\n return this.activeObservations_.length > 0;\n};\n\n// Registry of internal observers. If WeakMap is not available use current shim\n// for the Map collection as it has all required methods and because WeakMap\n// can't be fully polyfilled anyway.\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\n\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\nvar ResizeObserver = function(callback) {\n if (!(this instanceof ResizeObserver)) {\n throw new TypeError('Cannot call a class as a function.');\n }\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n }\n\n var controller = ResizeObserverController.getInstance();\n var observer = new ResizeObserverSPI(callback, controller, this);\n\n observers.set(this, observer);\n};\n\n// Expose public methods of ResizeObserver.\n['observe', 'unobserve', 'disconnect'].forEach(function (method) {\n ResizeObserver.prototype[method] = function () {\n return (ref = observers.get(this))[method].apply(ref, arguments);\n var ref;\n };\n});\n\nvar index = (function () {\n // Export existing implementation if available.\n if (typeof global$1.ResizeObserver !== 'undefined') {\n return global$1.ResizeObserver;\n }\n\n return ResizeObserver;\n})();\n\nexport default index;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","// IMAGE LOADING/LOADED FUNCTIONS\n// returns a promise that resolves when image is loaded\n// if it's already loaded, the promise will resolve immediately\nfunction Loader (img) {\n if (typeof img === 'string') img = document.getElementById(img);\n\n return new Promise(function (resolve,reject) {\n if (Loader.check(img)) return resolve(img);\n\n function handler (e) {\n img.removeEventListener('load',handler);\n img.removeEventListener('error',handler);\n (e.type === 'load')? resolve(img): reject(img);\n }\n\n img.addEventListener('load',handler);\n img.addEventListener('error',handler);\n });\n}\n\n// static method to check if image is completely loaded\nLoader.check = function (img) {\n if (!img.complete) return false;\n if (img.naturalWidth === 0) return false;\n return true;\n};\n\nexport default Loader;\n"],"sourceRoot":""}