{"version":3,"sources":["webpack:///./widgets/instagramBlock.js","webpack:///./widgets/quoteBlock.js","webpack:////Users/owenli/Documents/workspace/awi-woolmark-fe/node_modules/instafeed.js/dist/instafeed.es.js"],"names":["InstagramBlock","_createClass","$el","_classCallCheck","this","$","readMore","data","topLogo","sideLogo","isScroll","insToken","Instafeed","get","target","resolution","limit","accessToken","template","run","setTimeout","slick","dots","infinite","autoplay","autoplaySpeed","slidesToShow","slidesToScroll","responsive","breakpoint","settings","show","WG","concat","QuoteBlock","element","$element","$carousel","find","assert","val","msg","Error","options","opts","accessTokenTimeout","after","apiTimeout","apiLimit","before","debug","error","filter","mock","render","sort","success","templateBoundaries","transform","optKey","length","_state","running","node","token","paging","pool","_options","prototype","scope","_debug","_start","document","getElementById","_getAccessToken","err","_fail","message","_showNext","_finish","hasNext","next","callback","url","poolItems","hasLimit","splice","_renderData","renderErr","_makeApiRequest","processed","_success","_processData","unused","i","push","processErr","items","hasTransform","hasFilter","hasSort","transformedFiltered","limitDelta","dataItem","transformedItem","filterResult","unusedItems","_getItemData","slice","_extractTags","str","exp","badChars","tags","match","exec","test","type","image","media_type","media_url","thumbnail_url","caption","id","link","permalink","model","timestamp","username","hasTemplate","hasRender","item","itemHtml","container","html","_basicRender","createElement","innerHTML","childNodes","appendChild","RegExp","output","lastIndex","keyPath","keyPathValue","index","_valueForKeyPath","toString","lastValue","_runHook","console","called","apiRequest","callbackOnce","value","XMLHttpRequest","ontimeout","onerror","onload","event","contentType","getResponseHeader","responseJson","status","indexOf","JSON","parse","responseText","code","open","timeout","send","timeoutCheck","clearTimeout","args","log","call","arguments","hookName"],"mappings":"29BAAA,IAMaA,EAAcC,GAC1B,SAAAD,EAAYE,I,4FAAKC,CAAA,KAAAH,GAEhBI,KAAKF,IAAMG,EAAEH,GAEb,IAAII,EAAWF,KAAKF,IAAIK,KAAK,YACzBC,EAAUJ,KAAKF,IAAIK,KAAK,WACxBE,EAAWL,KAAKF,IAAIK,KAAK,YACzBG,EAAWN,KA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lB,GAAyC,mBAA9BtJ,KAAK+D,SAASlD,YAA4B,CACnDb,KAAKkE,OAAO,iBAAkB,mCAC9BsG,EAAexJ,YAAW,WACxBiD,EAAMC,OAAO,iBAAkB,gBAAiBiF,GAChDE,EAAa,IAAI/G,MAAM,yBAA0B,QAChDtC,KAAK+D,SAAStB,oBACjB,IACEzC,KAAK+D,SAASlD,aAAY,SAA6B0D,EAAK+E,GAC1DrF,EAAMC,OAAO,iBAAkB,gCAAiCiF,EAAQ5E,EAAK+E,GAC7ED,EAAa9E,EAAK+E,MAEpB,MAAO/E,GACPvE,KAAKkE,OAAO,iBAAkB,6CAA8CK,GAC5E8E,EAAa9E,EAAK,YAGpBvE,KAAKkE,OAAO,iBAAkB,wCAAyClE,KAAK+D,SAASlD,aACrFwI,EAAa,KAAMrJ,KAAK+D,SAASlD,cAIrCL,EAAUwD,UAAUE,OAAS,WAC3B,IAAIwG,EAAO,KACP1K,KAAK+D,SAASjB,OAASoG,SAAkC,mBAAhBA,QAAQyB,OACnDD,EAAO,GAAGlE,MAAMoE,KAAKC,YAChB,GAAK,gBAAkBH,EAAK,GAAK,MAK1ClK,EAAUwD,UAAUiF,SAAW,SAAiB6B,EAAU3K,GACxD,IAAIiD,GAAU,EACd,GAAuC,mBAA5BpD,KAAK+D,SAAS+G,GACvB,IACE9K,KAAK+D,SAAS+G,GAAU3K,GACxBiD,GAAU,EACV,MAAOmB,GACPvE,KAAKkE,OAAO,UAAW,qBAAsB4G,EAAUvG,GAG3D,OAAOnB,GAGM","file":"44.js","sourcesContent":["const NS = 'InstagramBlock';\nconst CLS = 'instagramBlock';\nconst WG = '.' + CLS + '-';\n\nimport Instafeed from 'instafeed.js'; //import the instafeed\n\nexport class InstagramBlock {\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadShopProductBlock function\n\t\tthis.$el = $($el);\n\t\t// get the data from epi server\n\t\tvar readMore = this.$el.data(\"readMore\");\n\t\tvar topLogo = this.$el.data(\"topLogo\");\n\t\tvar sideLogo = this.$el.data(\"sideLogo\");\n\t\tvar isScroll = this.$el.data(\"isScroll\");\n\t\tvar insToken = this.$el.data(\"insToken\");\n\t\t// load the instafeed\n\t\tvar userFeed = new Instafeed({\n\t\t\tget: 'user',\n\t\t\ttarget: \"instafeed-container\", // insert instagram into this div\n\t\t\tresolution: 'low_resolution', // using low resolution image\n\t\t\tlimit: 12, // show 12 posts in the carousel\n\t\t\taccessToken: insToken,\n\t\t\t// create custom template\n\t\t\ttemplate:'
thewoolmarkcompany

{{caption}}

' + readMore +'
'\n\t\t});\n\t\tuserFeed.run();\n\n\t\t// load slick slider \n\t\tsetTimeout(slickFunction, 2000); // wait for 2 seconds until instagram feed is fully loaded then load slick slider\n\t\t\tfunction slickFunction() {\n\t\t\t\t$(\"#instafeed-container\").slick({\n\t\t\t\t\t\tdots: true,\n\t\t\t\t\t\tinfinite: true,\n\t\t\t\t\t\tautoplay: isScroll,\n \t\t\t\t\tautoplaySpeed: 4000,\n\t\t\t\t\t\tslidesToShow: 3,\n\t\t\t\t\t\tslidesToScroll: 3,\n\t\t\t\t\t\tresponsive: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreakpoint: 1024,\n\t\t\t\t\t\t\tsettings: {\n\t\t\t\t\t\t\tslidesToShow: 2,\n\t\t\t\t\t\t\tslidesToScroll: 2,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreakpoint: 600,\n\t\t\t\t\t\t\tsettings: {\n\t\t\t\t\t\t\tslidesToShow: 2,\n\t\t\t\t\t\t\tslidesToScroll: 2\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreakpoint: 480,\n\t\t\t\t\t\t\tsettings: {\n\t\t\t\t\t\t\tslidesToShow: 1,\n\t\t\t\t\t\t\tslidesToScroll: 1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t});\n\t\t\t\t$('#instafeed-container').show();\n\t\t\t}\n\t}\n\t// Add more functions like on above here\n}\n","const NS = 'QuoteBlock';\nconst CLS = 'quoteBlock';\nconst WG = `.${CLS}-`;\n\nexport class QuoteBlock {\n\tconstructor(element) {\n\t\tthis.element = element;\n\t\tthis.$element = $(element);\n\n\t\tthis.$carousel = this.$element.find(`${WG}carousel`);\n\t\tconsole.log(this.$carousel);\n\t\tthis.$carousel.slick({\n\t\t\tautoplay:true,\n\t\t\tautoplaySpeed:4000,\n\t\t\tdots: true\n\t\t});\n\t}\n}","/* instafeed.js | v2.0.0 | https://github.com/stevenschobert/instafeed.js | License: MIT */\nfunction assert(val, msg) {\n if (!val) {\n throw new Error(msg);\n }\n}\n\nfunction Instafeed(options) {\n assert(!options || typeof options === \"object\", \"options must be an object, got \" + options + \" (\" + typeof options + \")\");\n var opts = {\n accessToken: null,\n accessTokenTimeout: 1e4,\n after: null,\n apiTimeout: 1e4,\n apiLimit: null,\n before: null,\n debug: false,\n error: null,\n filter: null,\n limit: null,\n mock: false,\n render: null,\n sort: null,\n success: null,\n target: \"instafeed\",\n template: '',\n templateBoundaries: [ \"{{\", \"}}\" ],\n transform: null\n };\n var state = {\n running: false,\n node: null,\n token: null,\n paging: null,\n pool: []\n };\n if (options) {\n for (var optKey in opts) {\n if (typeof options[optKey] !== \"undefined\") {\n opts[optKey] = options[optKey];\n }\n }\n }\n assert(typeof opts.target === \"string\" || typeof opts.target === \"object\", \"target must be a string or DOM node, got \" + opts.target + \" (\" + typeof opts.target + \")\");\n assert(typeof opts.accessToken === \"string\" || typeof opts.accessToken === \"function\", \"accessToken must be a string or function, got \" + opts.accessToken + \" (\" + typeof opts.accessToken + \")\");\n assert(typeof opts.accessTokenTimeout === \"number\", \"accessTokenTimeout must be a number, got \" + opts.accessTokenTimeout + \" (\" + typeof opts.accessTokenTimeout + \")\");\n assert(typeof opts.apiTimeout === \"number\", \"apiTimeout must be a number, got \" + opts.apiTimeout + \" (\" + typeof opts.apiTimeout + \")\");\n assert(typeof opts.debug === \"boolean\", \"debug must be true or false, got \" + opts.debug + \" (\" + typeof opts.debug + \")\");\n assert(typeof opts.mock === \"boolean\", \"mock must be true or false, got \" + opts.mock + \" (\" + typeof opts.mock + \")\");\n assert(typeof opts.templateBoundaries === \"object\" && opts.templateBoundaries.length === 2 && typeof opts.templateBoundaries[0] === \"string\" && typeof opts.templateBoundaries[1] === \"string\", \"templateBoundaries must be an array of 2 strings, got \" + opts.templateBoundaries + \" (\" + typeof opts.templateBoundaries + \")\");\n assert(!opts.template || typeof opts.template === \"string\", \"template must null or string, got \" + opts.template + \" (\" + typeof opts.template + \")\");\n assert(!opts.error || typeof opts.error === \"function\", \"error must be null or function, got \" + opts.error + \" (\" + typeof opts.error + \")\");\n assert(!opts.before || typeof opts.before === \"function\", \"before must be null or function, got \" + opts.before + \" (\" + typeof opts.before + \")\");\n assert(!opts.after || typeof opts.after === \"function\", \"after must be null or function, got \" + opts.after + \" (\" + typeof opts.after + \")\");\n assert(!opts.success || typeof opts.success === \"function\", \"success must be null or function, got \" + opts.success + \" (\" + typeof opts.success + \")\");\n assert(!opts.filter || typeof opts.filter === \"function\", \"filter must be null or function, got \" + opts.filter + \" (\" + typeof opts.filter + \")\");\n assert(!opts.transform || typeof opts.transform === \"function\", \"transform must be null or function, got \" + opts.transform + \" (\" + typeof opts.transform + \")\");\n assert(!opts.sort || typeof opts.sort === \"function\", \"sort must be null or function, got \" + opts.sort + \" (\" + typeof opts.sort + \")\");\n assert(!opts.render || typeof opts.render === \"function\", \"render must be null or function, got \" + opts.render + \" (\" + typeof opts.render + \")\");\n assert(!opts.limit || typeof opts.limit === \"number\", \"limit must be null or number, got \" + opts.limit + \" (\" + typeof opts.limit + \")\");\n assert(!opts.apiLimit || typeof opts.apiLimit === \"number\", \"apiLimit must null or number, got \" + opts.apiLimit + \" (\" + typeof opts.apiLimit + \")\");\n this._state = state;\n this._options = opts;\n}\n\nInstafeed.prototype.run = function run() {\n var scope = this;\n this._debug(\"run\", \"options\", this._options);\n this._debug(\"run\", \"state\", this._state);\n if (this._state.running) {\n this._debug(\"run\", \"already running, skipping\");\n return false;\n }\n this._start();\n this._debug(\"run\", \"getting dom node\");\n if (typeof this._options.target === \"string\") {\n this._state.node = document.getElementById(this._options.target);\n } else {\n this._state.node = this._options.target;\n }\n if (!this._state.node) {\n this._fail(new Error(\"no element found with ID \" + this._options.target));\n return false;\n }\n this._debug(\"run\", \"got dom node\", this._state.node);\n this._debug(\"run\", \"getting access token\");\n this._getAccessToken(function onTokenReceived(err, token) {\n if (err) {\n scope._debug(\"onTokenReceived\", \"error\", err);\n scope._fail(new Error(\"error getting access token: \" + err.message));\n return;\n }\n scope._debug(\"onTokenReceived\", \"got token\", token);\n scope._state.token = token;\n scope._showNext(function onNextShown(err) {\n if (err) {\n scope._debug(\"onNextShown\", \"error\", err);\n scope._fail(err);\n return;\n }\n scope._finish();\n });\n });\n return true;\n};\n\nInstafeed.prototype.hasNext = function hasNext() {\n var paging = this._state.paging;\n var pool = this._state.pool;\n this._debug(\"hasNext\", \"paging\", paging);\n this._debug(\"hasNext\", \"pool\", pool.length, pool);\n return pool.length > 0 || paging && typeof paging.next === \"string\";\n};\n\nInstafeed.prototype.next = function next() {\n var scope = this;\n if (!scope.hasNext()) {\n scope._debug(\"next\", \"hasNext is false, skipping\");\n return false;\n }\n if (scope._state.running) {\n scope._debug(\"next\", \"already running, skipping\");\n return false;\n }\n scope._start();\n scope._showNext(function onNextShown(err) {\n if (err) {\n scope._debug(\"onNextShown\", \"error\", err);\n scope._fail(err);\n return;\n }\n scope._finish();\n });\n};\n\nInstafeed.prototype._showNext = function showNext(callback) {\n var scope = this;\n var url = null;\n var poolItems = null;\n var hasLimit = typeof this._options.limit === \"number\";\n scope._debug(\"showNext\", \"pool\", scope._state.pool.length, scope._state.pool);\n if (scope._state.pool.length > 0) {\n if (hasLimit) {\n poolItems = scope._state.pool.splice(0, scope._options.limit);\n } else {\n poolItems = scope._state.pool.splice(0);\n }\n scope._debug(\"showNext\", \"items from pool\", poolItems.length, poolItems);\n scope._debug(\"showNext\", \"updated pool\", scope._state.pool.length, scope._state.pool);\n if (scope._options.mock) {\n scope._debug(\"showNext\", \"mock enabled, skipping render\");\n } else {\n try {\n scope._renderData(poolItems);\n } catch (renderErr) {\n callback(renderErr);\n return;\n }\n }\n callback(null);\n } else {\n if (scope._state.paging && typeof scope._state.paging.next === \"string\") {\n url = scope._state.paging.next;\n } else {\n url = \"https://graph.instagram.com/me/media?fields=caption,id,media_type,media_url,permalink,thumbnail_url,timestamp,username&access_token=\" + scope._state.token;\n if (!scope._options.apiLimit && typeof scope._options.limit === \"number\") {\n scope._debug(\"showNext\", \"no apiLimit set, falling back to limit\", scope._options.apiLimit, scope._options.limit);\n url = url + \"&limit=\" + scope._options.limit;\n } else if (typeof scope._options.apiLimit === \"number\") {\n scope._debug(\"showNext\", \"apiLimit set, overriding limit\", scope._options.apiLimit, scope._options.limit);\n url = url + \"&limit=\" + scope._options.apiLimit;\n }\n }\n scope._debug(\"showNext\", \"making request\", url);\n scope._makeApiRequest(url, function onResponseReceived(err, data) {\n var processed = null;\n if (err) {\n scope._debug(\"onResponseReceived\", \"error\", err);\n callback(new Error(\"api request error: \" + err.message));\n return;\n }\n scope._debug(\"onResponseReceived\", \"data\", data);\n scope._success(data);\n scope._debug(\"onResponseReceived\", \"setting paging\", data.paging);\n scope._state.paging = data.paging;\n try {\n processed = scope._processData(data);\n scope._debug(\"onResponseReceived\", \"processed data\", processed);\n if (processed.unused && processed.unused.length > 0) {\n scope._debug(\"onResponseReceived\", \"saving unused to pool\", processed.unused.length, processed.unused);\n for (var i = 0; i < processed.unused.length; i++) {\n scope._state.pool.push(processed.unused[i]);\n }\n }\n } catch (processErr) {\n callback(processErr);\n return;\n }\n if (scope._options.mock) {\n scope._debug(\"onResponseReceived\", \"mock enabled, skipping append\");\n } else {\n try {\n scope._renderData(processed.items);\n } catch (renderErr) {\n callback(renderErr);\n return;\n }\n }\n callback(null);\n });\n }\n};\n\nInstafeed.prototype._processData = function processData(data) {\n var hasTransform = typeof this._options.transform === \"function\";\n var hasFilter = typeof this._options.filter === \"function\";\n var hasSort = typeof this._options.sort === \"function\";\n var hasLimit = typeof this._options.limit === \"number\";\n var transformedFiltered = [];\n var limitDelta = null;\n var dataItem = null;\n var transformedItem = null;\n var filterResult = null;\n var unusedItems = null;\n this._debug(\"processData\", \"hasFilter\", hasFilter, \"hasTransform\", hasTransform, \"hasSort\", hasSort, \"hasLimit\", hasLimit);\n if (typeof data !== \"object\" || typeof data.data !== \"object\" || data.data.length <= 0) {\n return null;\n }\n for (var i = 0; i < data.data.length; i++) {\n dataItem = this._getItemData(data.data[i]);\n if (hasTransform) {\n try {\n transformedItem = this._options.transform(dataItem);\n this._debug(\"processData\", \"transformed item\", dataItem, transformedItem);\n } catch (err) {\n this._debug(\"processData\", \"error calling transform\", err);\n throw new Error(\"error in transform: \" + err.message);\n }\n } else {\n transformedItem = dataItem;\n }\n if (hasFilter) {\n try {\n filterResult = this._options.filter(transformedItem);\n this._debug(\"processData\", \"filter item result\", transformedItem, filterResult);\n } catch (err) {\n this._debug(\"processData\", \"error calling filter\", err);\n throw new Error(\"error in filter: \" + err.message);\n }\n if (filterResult) {\n transformedFiltered.push(transformedItem);\n }\n } else {\n transformedFiltered.push(transformedItem);\n }\n }\n if (hasSort) {\n try {\n transformedFiltered.sort(this._options.sort);\n } catch (err) {\n this._debug(\"processData\", \"error calling sort\", err);\n throw new Error(\"error in sort: \" + err.message);\n }\n }\n if (hasLimit) {\n limitDelta = transformedFiltered.length - this._options.limit;\n this._debug(\"processData\", \"checking limit\", transformedFiltered.length, this._options.limit, limitDelta);\n if (limitDelta > 0) {\n unusedItems = transformedFiltered.slice(transformedFiltered.length - limitDelta);\n this._debug(\"processData\", \"unusedItems\", unusedItems.length, unusedItems);\n transformedFiltered.splice(transformedFiltered.length - limitDelta, limitDelta);\n }\n }\n return {\n items: transformedFiltered,\n unused: unusedItems\n };\n};\n\nInstafeed.prototype._extractTags = function extractTags(str) {\n var exp = /#([^\\s]+)/gi;\n var badChars = /[~`!@#$%^&*\\(\\)\\-\\+={}\\[\\]:;\"'<>\\?,\\./|\\\\\\s]+/i;\n var tags = [];\n var match = null;\n if (typeof str === \"string\") {\n while ((match = exp.exec(str)) !== null) {\n if (badChars.test(match[1]) === false) {\n tags.push(match[1]);\n }\n }\n }\n return tags;\n};\n\nInstafeed.prototype._getItemData = function getItemData(data) {\n var type = null;\n var image = null;\n switch (data.media_type) {\n case \"IMAGE\":\n type = \"image\";\n image = data.media_url;\n break;\n\n case \"VIDEO\":\n type = \"video\";\n image = data.thumbnail_url;\n break;\n\n case \"CAROUSEL_ALBUM\":\n type = \"album\";\n image = data.media_url;\n break;\n }\n return {\n caption: data.caption,\n tags: this._extractTags(data.caption),\n id: data.id,\n image: image,\n link: data.permalink,\n model: data,\n timestamp: data.timestamp,\n type: type,\n username: data.username\n };\n};\n\nInstafeed.prototype._renderData = function renderData(items) {\n var hasTemplate = typeof this._options.template === \"string\";\n var hasRender = typeof this._options.render === \"function\";\n var item = null;\n var itemHtml = null;\n var container = null;\n var html = \"\";\n this._debug(\"renderData\", \"hasTemplate\", hasTemplate, \"hasRender\", hasRender);\n if (typeof items !== \"object\" || items.length <= 0) {\n return;\n }\n for (var i = 0; i < items.length; i++) {\n item = items[i];\n if (hasRender) {\n try {\n itemHtml = this._options.render(item, this._options);\n this._debug(\"renderData\", \"custom render result\", item, itemHtml);\n } catch (err) {\n this._debug(\"renderData\", \"error calling render\", err);\n throw new Error(\"error in render: \" + err.message);\n }\n } else if (hasTemplate) {\n itemHtml = this._basicRender(item);\n }\n if (itemHtml) {\n html = html + itemHtml;\n } else {\n this._debug(\"renderData\", \"render item did not return any content\", item);\n }\n }\n this._debug(\"renderData\", \"html content\", html);\n container = document.createElement(\"div\");\n container.innerHTML = html;\n this._debug(\"renderData\", \"container\", container, container.childNodes.length, container.childNodes);\n while (container.childNodes.length > 0) {\n this._debug(\"renderData\", \"appending child\", container.childNodes[0]);\n this._state.node.appendChild(container.childNodes[0]);\n }\n};\n\nInstafeed.prototype._basicRender = function basicRender(data) {\n var exp = new RegExp(this._options.templateBoundaries[0] + \"([\\\\s\\\\w.]+)\" + this._options.templateBoundaries[1], \"gm\");\n var template = this._options.template;\n var match = null;\n var output = \"\";\n var substr = null;\n var lastIndex = 0;\n var keyPath = null;\n var keyPathValue = null;\n while ((match = exp.exec(template)) !== null) {\n keyPath = match[1];\n substr = template.slice(lastIndex, match.index);\n output = output + substr;\n keyPathValue = this._valueForKeyPath(keyPath, data);\n if (keyPathValue) {\n output = output + keyPathValue.toString();\n }\n lastIndex = exp.lastIndex;\n }\n if (lastIndex < template.length) {\n substr = template.slice(lastIndex, template.length);\n output = output + substr;\n }\n return output;\n};\n\nInstafeed.prototype._valueForKeyPath = function valueForKeyPath(keyPath, data) {\n var exp = /([\\w]+)/gm;\n var match = null;\n var key = null;\n var lastValue = data;\n while ((match = exp.exec(keyPath)) !== null) {\n if (typeof lastValue !== \"object\") {\n return null;\n }\n key = match[1];\n lastValue = lastValue[key];\n }\n return lastValue;\n};\n\nInstafeed.prototype._fail = function fail(err) {\n var didHook = this._runHook(\"error\", err);\n if (!didHook && console && typeof console.error === \"function\") {\n console.error(err);\n }\n this._state.running = false;\n};\n\nInstafeed.prototype._start = function start() {\n this._state.running = true;\n this._runHook(\"before\");\n};\n\nInstafeed.prototype._finish = function finish() {\n this._runHook(\"after\");\n this._state.running = false;\n};\n\nInstafeed.prototype._success = function success(data) {\n this._runHook(\"success\", data);\n this._state.running = false;\n};\n\nInstafeed.prototype._makeApiRequest = function makeApiRequest(url, callback) {\n var called = false;\n var scope = this;\n var apiRequest = null;\n var callbackOnce = function callbackOnce(err, value) {\n if (!called) {\n called = true;\n callback(err, value);\n }\n };\n apiRequest = new XMLHttpRequest();\n apiRequest.ontimeout = function apiRequestTimedOut() {\n callbackOnce(new Error(\"api request timed out\"));\n };\n apiRequest.onerror = function apiRequestOnError() {\n callbackOnce(new Error(\"api connection error\"));\n };\n apiRequest.onload = function apiRequestOnLoad(event) {\n var contentType = apiRequest.getResponseHeader(\"Content-Type\");\n var responseJson = null;\n scope._debug(\"apiRequestOnLoad\", \"loaded\", event);\n scope._debug(\"apiRequestOnLoad\", \"response status\", apiRequest.status);\n scope._debug(\"apiRequestOnLoad\", \"response content type\", contentType);\n if (contentType.indexOf(\"application/json\") >= 0) {\n try {\n responseJson = JSON.parse(apiRequest.responseText);\n } catch (err) {\n scope._debug(\"apiRequestOnLoad\", \"json parsing error\", err, apiRequest.responseText);\n callbackOnce(new Error(\"error parsing response json\"));\n return;\n }\n }\n if (apiRequest.status !== 200) {\n if (responseJson && responseJson.error) {\n callbackOnce(new Error(responseJson.error.code + \" \" + responseJson.error.message));\n } else {\n callbackOnce(new Error(\"status code \" + apiRequest.status));\n }\n return;\n }\n callbackOnce(null, responseJson);\n };\n apiRequest.open(\"GET\", url, true);\n apiRequest.timeout = this._options.apiTimeout;\n apiRequest.send();\n};\n\nInstafeed.prototype._getAccessToken = function getAccessToken(callback) {\n var called = false;\n var scope = this;\n var timeoutCheck = null;\n var callbackOnce = function callbackOnce(err, value) {\n if (!called) {\n called = true;\n clearTimeout(timeoutCheck);\n callback(err, value);\n }\n };\n if (typeof this._options.accessToken === \"function\") {\n this._debug(\"getAccessToken\", \"calling accessToken as function\");\n timeoutCheck = setTimeout(function accessTokenTimeoutCheck() {\n scope._debug(\"getAccessToken\", \"timeout check\", called);\n callbackOnce(new Error(\"accessToken timed out\"), null);\n }, this._options.accessTokenTimeout);\n try {\n this._options.accessToken(function accessTokenReceiver(err, value) {\n scope._debug(\"getAccessToken\", \"received accessToken callback\", called, err, value);\n callbackOnce(err, value);\n });\n } catch (err) {\n this._debug(\"getAccessToken\", \"error invoking the accessToken as function\", err);\n callbackOnce(err, null);\n }\n } else {\n this._debug(\"getAccessToken\", \"treating accessToken as static\", typeof this._options.accessToken);\n callbackOnce(null, this._options.accessToken);\n }\n};\n\nInstafeed.prototype._debug = function debug() {\n var args = null;\n if (this._options.debug && console && typeof console.log === \"function\") {\n args = [].slice.call(arguments);\n args[0] = \"[Instafeed] [\" + args[0] + \"]\";\n console.log.apply(null, args);\n }\n};\n\nInstafeed.prototype._runHook = function runHook(hookName, data) {\n var success = false;\n if (typeof this._options[hookName] === \"function\") {\n try {\n this._options[hookName](data);\n success = true;\n } catch (err) {\n this._debug(\"runHook\", \"error calling hook\", hookName, err);\n }\n }\n return success;\n};\n\nexport default Instafeed;"],"sourceRoot":""}