This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
oliverdavies.uk-old-sculpin/resources/js/vendor/tweets.js

10 lines
87 KiB
JavaScript
Raw Normal View History

2016-03-18 02:29:59 +00:00
!function(){Function&&Function.prototype&&Function.prototype.bind&&(/MSIE [678]/.test(navigator.userAgent)||(window.__twttr&&window.__twttr.widgets&&window.__twttr.widgets.loaded&&window.twttr.widgets.load&&window.twttr.widgets.load(),window.__twttr&&window.__twttr.widgets&&window.__twttr.widgets.init||!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n=window.__twttrll;window.__twttrll=function(r,o){for(var a,s,u=0,c=[];u<r.length;u++)s=r[u],i[s]&&c.push.apply(c,i[s]),i[s]=0;for(a in o)t[a]=o[a];for(n&&n(r,o);c.length;)c.shift().call(null,null,e)};var r={},i={0:0};return e.e=function(t,e){},e.e=function(t,n){if(0===i[t])return n.call(null,null,e);if(void 0!==i[t])i[t].push(n);else{i[t]=[n];var r=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.onerror=function(){var e=i[t];for(o.onerror=null,delete i[t];e.length;)e.shift().call(null,new Error("failed to load chunk"))},o.src=e.p+"js/"+({1:"button",2:"grid",3:"moment",4:"periscope_on_air",5:"timeline",6:"tweet"}[t]||t)+"."+{1:"0308b81ff1714e446f674b5b9793f2cd",2:"1fa128383bdd8af67ce0cdc9a469ddaa",3:"f4bf3babfa22a537b5d02331280e3883",4:"e158f34e73111f999d67f75e522e0576",5:"d11f7a3b3287fb94220e8ee6d03cc772",6:"2c548e167cf5bdb0bd941e41896f257d"}[t]+".js",r.appendChild(o)}},e.m=t,e.c=r,e.p="https://platform.twitter.com/",e(0)}([function(t,e,n){var r,i=n(1),o=n(9),a=n(19),s=n(17),u=n(21),s=n(17),c=n(22),f=n(34),d=n(32),l=n(43),h=n(212),p=n(37),m=n(11),v="_e";s.set("widgets.init",!0),u.set("init",!0),r=new i,a.exposeReadyPromise(r.promise,u.base,v),u.set("widgets",h),u.set("widgets.load",l.load),u.set("events",d),s.init("host","platform.twitter.com"),m(function(){r.resolve(u.base),c.attachTo(o),f.start("widgets-js-load"),l.loadPage().then(function(){f.endAndTrack("render","widgets-js-load","page",{widget_origin:p.rootDocumentLocation(),widget_frame:p.isFramed()&&p.currentDocumentLocation()})})})},function(t,e,n){function r(){var t=this;this.promise=new i(function(e,n){t.resolve=e,t.reject=n})}var i=n(2);t.exports=r},function(t,e,n){var r=n(3).Promise,i=n(7),o=n(8);t.exports=o.hasPromiseSupport()?i.Promise:r},function(t,e,n){var r;(function(t){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* @version 2.3.0
*/
(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function a(t){return"object"==typeof t&&null!==t}function s(t){H=t}function u(t){J=t}function c(){var t=process.nextTick,e=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate),function(){t(p)}}function f(){return function(){V(p)}}function d(){var t=0,e=new Z(p),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function l(){var t=new MessageChannel;return t.port1.onmessage=p,function(){t.port2.postMessage(0)}}function h(){return function(){setTimeout(p,1)}}function p(){for(var t=0;K>t;t+=2){var e=et[t],n=et[t+1];e(n),et[t]=void 0,et[t+1]=void 0}K=0}function m(){try{var t=n(5);return V=t.runOnLoop||t.runOnContext,f()}catch(e){return h()}}function v(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function w(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(e){return ot.error=e,ot}}function b(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function _(t,e,n){J(function(t){var r=!1,i=b(n,e,function(n){r||(r=!0,e!==n?A(t,n):C(t,n))},function(e){r||(r=!0,I(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,I(t,i))},t)}function E(t,e){e._state===rt?C(t,e._result):e._state===it?I(t,e._result):N(e,void 0,function(e){A(t,e)},function(e){I(t,e)})}function x(t,e){if(e.constructor===t.constructor)E(t,e);else{var n=y(e);n===ot?I(t,ot.error):void 0===n?C(t,e):o(n)?_(t,e,n):C(t,e)}}function A(t,e){t===e?I(t,g()):i(e)?x(t,e):C(t,e)}function T(t){t._onerror&&t._onerror(t._result),R(t)}function C(t,e){t._state===nt&&(t._result=e,t._state=rt,0!==t._subscribers.length&&J(R,t))}function I(t,e){t._state===nt&&(t._state=it,t._result=e,J(T,t))}function N(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+rt]=n,i[o+it]=r,0===o&&t._state&&J(R,t)}function R(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?P(n,r,i,o):i(o);t._subscribers.length=0}}function j(){this.error=null}function S(t,e){try{return t(e)}catch(n){return at.error=n,at}}function P(t,e,n,r){var i,a,s,u,c=o(n);if(c){if(i=S(n,r),i===at?(u=!0,a=i.error,i=null):s=!0,e===i)return void I(e,w())}else i=r,s=!0;e._state!==nt||(c&&s?A(e,i):u?I(e,a):t===rt?C(e,i):t===it&&I(e,i))}function O(t,e){try{e(function(e){A(t,e)},function(e){I(t,e)})}catch(n){I(t,n)}}function k(t,e){var n=this;n._instanceConstructor=t,n.promise=new t(v),n._validateInput(e)?(n._input=e,n.length=e.length,n._remaining=e.length,n._init(),0===n.length?C(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&C(n.promise,n._result))):I(n.promise,n._validationError())}function D(t){return new st(this,t).promise}function L(t){function e(t){A(i,t)}function n(t){I(i,t)}var r=this,i=new r(v);if(!Q(t))return I(i,new TypeError("You must pass an array to race.")),i;for(var o=t.length,a=0;i._state===nt&&o>a;a++)N(r.resolve(t[a]),void 0,e,n);return i}function z(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(v);return A(n,t),n}function F(t){var e=this,n=new e(v);return I(n,t),n}function M(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function B(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this._id=lt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(o(t)||M(),this instanceof U||B(),O(this,t))}function W(){var t;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(t.Promise=ht)}var q;q=Array.isAr
function r(t,e){return function(){try{e.resolve(t.call(this))}catch(n){e.reject(n)}}}function i(t,e){t.call(e)}function o(t,e){var n=new c;return u.read(r(t,n),e),n.promise}function a(t,e){var n=new c;return u.write(r(t,n),e),n.promise}function s(t,e,n){var i=new c;return f.isType("function",t)&&(n=e,e=t,t=1),u.defer(t,r(e,i),n),i.promise}var u=n(48),c=n(1),f=n(14);t.exports={sync:i,read:o,write:a,defer:s}},function(t,e,n){var r;!function(i){"use strict";function o(){this.frames=[],this.lastId=0,this.raf=a,this.batch={hash:{},read:[],write:[],mode:null}}var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};o.prototype.read=function(t,e){var n=this.add("read",t,e),r=n.id;this.batch.read.push(n.id);var i="reading"===this.batch.mode||this.batch.scheduled;return i?r:(this.scheduleBatch(),r)},o.prototype.write=function(t,e){var n=this.add("write",t,e),r=this.batch.mode,i=n.id;this.batch.write.push(n.id);var o="writing"===r||"reading"===r||this.batch.scheduled;return o?i:(this.scheduleBatch(),i)},o.prototype.defer=function(t,e,n){"function"==typeof t&&(n=e,e=t,t=1);var r=this,i=t-1;return this.schedule(i,function(){r.run({fn:e,ctx:n})})},o.prototype.clear=function(t){if("function"==typeof t)return this.clearFrame(t);t=Number(t);var e=this.batch.hash[t];if(e){var n=this.batch[e.type],r=n.indexOf(t);delete this.batch.hash[t],~r&&n.splice(r,1)}},o.prototype.clearFrame=function(t){var e=this.frames.indexOf(t);~e&&this.frames.splice(e,1)},o.prototype.scheduleBatch=function(){var t=this;this.schedule(0,function(){t.batch.scheduled=!1,t.runBatch()}),this.batch.scheduled=!0},o.prototype.uniqueId=function(){return++this.lastId},o.prototype.flush=function(t){for(var e;e=t.shift();)this.run(this.batch.hash[e])},o.prototype.runBatch=function(){try{this.batch.mode="reading",this.flush(this.batch.read),this.batch.mode="writing",this.flush(this.batch.write),this.batch.mode=null}catch(t){throw this.runBatch(),t}},o.prototype.add=function(t,e,n){var r=this.uniqueId();return this.batch.hash[r]={id:r,fn:e,ctx:n,type:t}},o.prototype.run=function(t){var e=t.ctx||this,n=t.fn;if(delete this.batch.hash[t.id],!this.onError)return n.call(e);try{n.call(e)}catch(r){this.onError(r)}},o.prototype.loop=function(){var t=this,e=this.raf;this.looping||(e(function n(){var r=t.frames.shift();t.frames.length?e(n):t.looping=!1,r&&r()}),this.looping=!0)},o.prototype.schedule=function(t,e){return this.frames[t]?this.schedule(t+1,e):(this.loop(),this.frames[t]=e)},i=i||new o,"undefined"!=typeof t&&t.exports?t.exports=i:(r=function(){return i}.call(e,n,e,t),!(void 0!==r&&(t.exports=r)))}(window.fastdom)},function(t,e,n){function r(t){return i.write(function(){t&&t.parentNode&&t.parentNode.removeChild(t)})}var i=n(47);t.exports=r},function(t,e,n){function r(t){this._inputsQueue=[],this._task=t,this._hasFlushBeenScheduled=!1}var i=n(1),o=n(51),a=n(20);r.prototype.add=function(t){var e=new i;return this._inputsQueue.push({input:t,taskDoneDeferred:e}),this._hasFlushBeenScheduled||(this._hasFlushBeenScheduled=!0,o(a(this._flush,this))),e.promise},r.prototype._flush=function(){try{this._task.call(null,this._inputsQueue)}catch(t){this._inputsQueue.forEach(function(e){e.taskDoneDeferred.reject(t)})}this._inputsQueue=[],this._hasFlushBeenScheduled=!1},t.exports=r},function(t,e,n){var r=n(3).Promise;t.exports=r._asap},function(t,e,n){function r(t){t.forEach(function(t){var e=t.input.namespace,n=t.input.data,r=t.input.offsite,i=t.input.version;f.clientEvent(e,n,r,i),t.taskDoneDeferred.resolve()})}function i(t){function e(){t.forEach(function(t){t.taskDoneDeferred.resolve()})}function n(){t.forEach(function(t){t.taskDoneDeferred.reject()})}c.init(),t.forEach(function(t){var e=t.input.namespace,n=t.input.data,r=t.input.offsite,i=t.input.version;c.clientEvent(e,n,r,i)}),c.flush().then(e,n)}function o(t){(1===t.length?r:i)(t)}function a(t,e,n,r){return l.add({namespace:t,data:e,offsite:n,version:r})}function s(){l.pause()}function u(){l.resume()}var c=n
target_id:n}),t},{})):{}}var i=n(114);t.exports=r},function(t,e){t.exports={TWEET:0,RETWEET:10,CUSTOM_TIMELINE:17}},function(t,e,n){var r=n(9),i=n(15),o=r.createElement("div");t.exports=function(t){return i.isNumber(t)&&(t+="px"),o.style.width="",o.style.width=t,o.style.width||null}},function(t,e,n){function r(t){var e=t.getBoundingClientRect(),n=i.innerWidth,r=i.innerHeight,o=e.top>r,a=e.bottom<0,s=e.left>n,u=e.right<0;return!(o||a||s||u)}var i=n(7);t.exports=r},function(t,e,n){function r(t){t.after("prepForInsertion",function(t){o.sizeIframes(t,this.sandbox.width,a,i.sync)}),t.after("resize",function(){o.sizeIframes(this.el,this.sandbox.width,a,i.write)})}var i=n(47),o=n(118),a=375;t.exports=r},function(t,e,n){function r(t){var e=t.split(" ");this.url=decodeURIComponent(e[0].trim()),this.width=+e[1].replace(/w$/,"").trim()}function i(t,e,n){var i,o,a,s;if(t=m.devicePixelRatio?t*m.devicePixelRatio:t,o=e.split(",").map(function(t){return new r(t.trim())}),n)for(s=0;s<o.length;s++)o[s].url===n&&(i=o[s]);return a=o.reduce(function(e,n){return n.width<e.width&&n.width>=t?n:e},o[0]),i&&i.width>a.width?i:a}function o(t,e){var n,r=t.getAttribute("data-srcset"),o=t.src;r&&(n=i(e,r,o),t.src=n.url)}function a(t,e){e=void 0!==e?!!e:g.retina(),v.toRealArray(t.getElementsByTagName("IMG")).forEach(function(t){var n=t.getAttribute("data-src-1x")||t.getAttribute("src"),r=t.getAttribute("data-src-2x");e&&r?t.src=r:n&&(t.src=n)})}function s(t,e,n){t&&(v.toRealArray(t.querySelectorAll(".NaturalImage-image")).forEach(function(t){n(function(){o(t,e)})}),v.toRealArray(t.querySelectorAll(".CroppedImage-image")).forEach(function(t){n(function(){o(t,e/2)})}),v.toRealArray(t.querySelectorAll("img.autosized-media")).forEach(function(t){n(function(){o(t,e),t.removeAttribute("width"),t.removeAttribute("height")})}))}function u(t,e){t&&(g.ios()||g.android())&&v.toRealArray(t.querySelectorAll(".FilledIframe")).forEach(function(t){e(function(){l(t,{width:t.offsetWidth,height:t.offsetHeight})})})}function c(t,e,n,r){t&&(u(t,r),v.toRealArray(t.querySelectorAll("iframe.autosized-media, .wvp-player-container")).forEach(function(t){var i=d(t.getAttribute("data-width"),t.getAttribute("data-height"),y.effectiveWidth(t.parentElement)||e,n);r(function(){t.setAttribute("width",i.width),t.setAttribute("height",i.height),b.present(t,"wvp-player-container")?(t.style.width=i.width,t.style.height=i.height):(t.width=i.width,t.height=i.height,l(t,i))})}))}function f(t,e,n,r){s(t,e,r),c(t,e,n,r)}function d(t,e,n,r,i,o){return n=n||t,r=r||e,i=i||0,o=o||0,t>n&&(e*=n/t,t=n),e>r&&(t*=r/e,e=r),i>t&&(e*=i/t,t=i),o>e&&(t*=o/e,e=o),{width:Math.floor(t),height:Math.floor(e)}}function l(t,e){function n(){var t={name:"tfw:resize",dimensions:e};i.postMessage(t,"*")}var r,i,o,a,s;t&&(i=t.contentWindow,r=t.ownerDocument&&t.ownerDocument.defaultView,o=g.ios()||g.android(),a=w.isTwitterURL(t.src),s=i&&g.canPostMessage(i),o&&a&&s&&(n(),r&&r.addEventListener("message",function(t){"tfw:requestsize"===t.data&&n()},!1)))}function h(t,e,n,r){v.toRealArray(t.querySelectorAll(e)).forEach(function(t){var e=t.getAttribute("style")||t.getAttribute("data-style"),i=r.test(e)&&RegExp.$1;i&&(t.setAttribute("data-csp-fix",!0),t.style[n]=i)})}function p(t){g.cspEnabled()&&(h(t,".MediaCard-widthConstraint","maxWidth",_),h(t,".MediaCard-mediaContainer","paddingBottom",A),h(t,".CroppedImage-image","top",E),h(t,".CroppedImage-image","left",x))}var m=n(7),v=n(14),g=n(8),w=n(27),y=n(119),b=n(24),_=/max-width:\s*([\d\.]+px)/,E=/top:\s*(\-?[\d\.]+%)/,x=/left:\s*(\-?[\d\.]+%)/,A=/padding-bottom:\s*([\d\.]+%)/;t.exports={scaleDimensions:d,retinize:a,setSrcForImgs:s,sizeIframes:c,broadcastIframeResize:u,constrainMedia:f,fixMediaCardLayout:p,__setSrcFromSet:o}},function(t,e){function n(t){return t&&1===t.nodeType?t.offsetWidth||n(t.parentNode):0}t.exports={effectiveWidth:n}},function(t,e,n){function r(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function i(t){return(t||"").split(";").reduce(function(t,e){var n,i;return c.test(e.trim())&&(n=RegExp.$1,i=RegExp.$2,t[r(n)]=i),t},{})}function o(