From e19068b88a52c03a3a5bf3663d8f904c1fde89d5 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Fri, 17 Jun 2016 12:29:39 +0530 Subject: [PATCH 01/62] fix(destroy): fixed .load of undefined when tweetsEmbed was turned off. --- dist/embed.min.js | 2 +- src/embed.es2015.js | 3 ++- src/embed.es2015.js.map | 2 +- src/embed.js | 2 +- src/embed.js.map | 2 +- src/js/main.js | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/embed.min.js b/dist/embed.min.js index b389c02..0a308e4 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -7,4 +7,4 @@ * Under MIT License */ !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,la),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return-1===a.indexOf("//")?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":ma["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return a.replace(oa.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})}function s(a,b){var c=b.customFontIcons.length?b.customFontIcons:pa,d=c.map(function(a){return e(a.text)}),f=new RegExp("(^|\\s)("+d.join("|")+")(?=\\s|$)","gi");return a.replace(f,function(a,f,g){var h=d.indexOf(e(g)),i=c[h].code;return b.template.smiley(g,f,i,b)})}function t(a,b){var c=b.linkOptions;return a.replace(m(),function(a){if(")"===p(a))return a;var d=p(a.split("."));return"/"===p(a)&&(a=a.slice(0,-1)),-1===c.exclude.indexOf(d)?b.template.url(a,b):a})}function u(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function v(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,u);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return-1===a.options.served.indexOf(c)?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function B(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(-1!==a.options.served.indexOf(c)||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function C(a){return j(a.options,a.service)?A(a):B(a)}function D(a,b,c,d,e,f){var g={input:a,output:b,options:d,embeds:c,regex:e,service:f,template:function(a){return this.options.template[this.service](a,this.options)}};return C(g)}function E(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?D(a,b,c,d,e,f):[b,c]}function F(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function G(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(F(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function H(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function I(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(H(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function J(a,b){return new Promise(function(c){j(a.options,a.service)?G(a,b).then(function(b){return c([b,a.embeds])}):I(a,b).then(function(b){return c([a.output,b])})})}function K(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function L(a,b,c,d){var e=M(a);return d.template.gmap(b,c,e,d)}function M(a){return a.split("(")[1].split(")")[0]}function N(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(oa.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?K(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=ma.slicedToArray(e[k],2),f=a[0],h=a[1],l=L(g[k][0],f,h,c);j(c,i)?b=b.replace(oa.gmap,function(a){return''+M(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(oa.gmap,function(a){return''+M(a)+""}))};for(var k in f)h();a([b,d])})})}function O(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return-1===a.indexOf("</a")?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)}function P(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function Q(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function R(a,b){return'
'+(a.value||a)+"
"}function S(a,b){return a=a.replace(oa.inlineCode,function(a,b,c){return""+c+""}),a.replace(oa.highlightCode,function(a,c,d,e){var f=e;f=Q(f),f=P(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),R(h,g)})}function T(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function U(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function V(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){U(e,a.options).then(function(c){return b(w(T(c),c,f,a.options))})}):new Promise(function(b){return b(u(f,a.options))})}function W(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.youtube,service:"youtube"};return new Promise(function(a){return J(e,V).then(function(b){return a(b)})})}function X(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function Y(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function Z(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){Y(f).then(function(d){return c(w(X(d,b),d,g,a.options))})}):new Promise(function(b){return b(u(g,a.options))})}}function $(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.vimeo,service:"vimeo"};return new Promise(function(a){return J(e,Z).then(function(b){return a(b)})})}function _(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){ra(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function aa(a,b,c){return new Promise(function(b){_(a,c).then(function(c){return b(a.template(c))})})}function ba(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return J(e,aa).then(function(b){return a(b)})})}function ca(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function da(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){ca(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function ea(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return J(e,da).then(function(b){return a(b)})})}function fa(a,b){return b.template.github(a,b)}function ga(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function ha(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){ga(e).then(function(c){return b(fa(c,a.options))})})}function ia(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:oa.github};return new Promise(function(a){return J(e,ha).then(function(b){return a(b)})})}function ja(a,b){var c=oa.mentions;return a.replace(c,function(a){var c=a.split("@")[1];return b.mentionsUrl(c)})}function ka(a,b){var c=oa.hashtag;return a.replace(c,function(a){var c=a.split("#")[1];return b.hashtagUrl(c)})}var la="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,ma={};ma["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},ma.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},ma.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n \n
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=-1!==a.indexOf("//")?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},oa={mentions:/\B@[a-z0-9_-]+/gi,hashtag:/\B#[a-z0-9_-]+/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},pa=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=a.getAllResponseHeaders().trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(-1===q.indexOf(b))throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest;g.onload=function(){var a=1223===g.status?204:g.status;if(100>a||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:this);var ta=function(){function a(b,c,d,e){var f=this;ma.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=oa.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return ma.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return C(this)}}]),a}(),ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){ma.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||na,!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return ma.createClass(a,[{key:"process",value:function(){var a=this,b=this.input,c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=t(b,c));var h=c.openGraphEndpoint?ea(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=S(e,c)),c.marked&&(e=O(e,c)),c.emoji&&(e=r(e,c)),c.fontIcons&&(e=s(e,c)),c.mentions&&(e=ja(e,c)),c.hashtag&&(e=ka(e,c));var g=E(b,e,f,c,oa.ideone,"ideone"),h=ma.slicedToArray(g,2);e=h[0],f=h[1];var j=E(b,e,f,c,oa.plunker,"plunker"),k=ma.slicedToArray(j,2);e=k[0],f=k[1];var l=E(b,e,f,c,oa.jsbin,"jsbin"),m=ma.slicedToArray(l,2);e=m[0],f=m[1];var n=E(b,e,f,c,oa.codepen,"codepen"),o=ma.slicedToArray(n,2);e=o[0],f=o[1];var p=E(b,e,f,c,oa.jsfiddle,"jsfiddle"),q=ma.slicedToArray(p,2);e=q[0],f=q[1];var t=E(b,e,f,c,oa.ted,"ted"),u=ma.slicedToArray(t,2);e=u[0],f=u[1];var v=E(b,e,f,c,oa.dailymotion,"dailymotion"),w=ma.slicedToArray(v,2);e=w[0],f=w[1];var x=E(b,e,f,c,oa.ustream,"ustream"),y=ma.slicedToArray(x,2);e=y[0],f=y[1];var z=E(b,e,f,c,oa.liveleak,"liveleak"),A=ma.slicedToArray(z,2);e=A[0],f=A[1];var B=E(b,e,f,c,oa.basicVideo,"video",c.videoEmbed),C=ma.slicedToArray(B,2);e=C[0],f=C[1];var D=E(b,e,f,c,oa.vine,"vine"),F=ma.slicedToArray(D,2);e=F[0],f=F[1];var G=E(b,e,f,c,oa.soundCloud,"soundcloud"),H=ma.slicedToArray(G,2);e=H[0],f=H[1];var I=E(b,e,f,c,oa.spotify,"spotify"),J=ma.slicedToArray(I,2);e=J[0],f=J[1];var K=E(b,e,f,c,oa.basicAudio,"audio",c.audioEmbed),L=ma.slicedToArray(K,2);e=L[0],f=L[1];var M=E(b,e,f,c,oa.flickr,"flickr"),N=ma.slicedToArray(M,2);e=N[0],f=N[1];var P=E(b,e,f,c,oa.instagram,"instagram"),Q=ma.slicedToArray(P,2);e=Q[0],f=Q[1];var R=E(b,e,f,c,oa.basicImage,"image",c.imageEmbed),T=ma.slicedToArray(R,2);if(e=T[0],f=T[1],i(c,"gist")){var U=new ta(b,e,c,f).process(),V=ma.slicedToArray(U,2);e=V[0],f=V[1]}return i(c,"youtube")?W(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?$(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ia(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?N(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?ba(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=ma.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new sa(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=ma.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){y(this.options),x(this.options),v(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==ma["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");z("ejs-video-thumb"),this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?na:arguments[2],e=document.querySelectorAll(b),f=0;f-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=a.getAllResponseHeaders().trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(-1===q.indexOf(b))throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest;g.onload=function(){var a=1223===g.status?204:g.status;if(100>a||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:this);var ta=function(){function a(b,c,d,e){var f=this;ma.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=oa.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return ma.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return C(this)}}]),a}(),ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){ma.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||na,!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return ma.createClass(a,[{key:"process",value:function(){var a=this,b=this.input,c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=t(b,c));var h=c.openGraphEndpoint?ea(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=S(e,c)),c.marked&&(e=O(e,c)),c.emoji&&(e=r(e,c)),c.fontIcons&&(e=s(e,c)),c.mentions&&(e=ja(e,c)),c.hashtag&&(e=ka(e,c));var g=E(b,e,f,c,oa.ideone,"ideone"),h=ma.slicedToArray(g,2);e=h[0],f=h[1];var j=E(b,e,f,c,oa.plunker,"plunker"),k=ma.slicedToArray(j,2);e=k[0],f=k[1];var l=E(b,e,f,c,oa.jsbin,"jsbin"),m=ma.slicedToArray(l,2);e=m[0],f=m[1];var n=E(b,e,f,c,oa.codepen,"codepen"),o=ma.slicedToArray(n,2);e=o[0],f=o[1];var p=E(b,e,f,c,oa.jsfiddle,"jsfiddle"),q=ma.slicedToArray(p,2);e=q[0],f=q[1];var t=E(b,e,f,c,oa.ted,"ted"),u=ma.slicedToArray(t,2);e=u[0],f=u[1];var v=E(b,e,f,c,oa.dailymotion,"dailymotion"),w=ma.slicedToArray(v,2);e=w[0],f=w[1];var x=E(b,e,f,c,oa.ustream,"ustream"),y=ma.slicedToArray(x,2);e=y[0],f=y[1];var z=E(b,e,f,c,oa.liveleak,"liveleak"),A=ma.slicedToArray(z,2);e=A[0],f=A[1];var B=E(b,e,f,c,oa.basicVideo,"video",c.videoEmbed),C=ma.slicedToArray(B,2);e=C[0],f=C[1];var D=E(b,e,f,c,oa.vine,"vine"),F=ma.slicedToArray(D,2);e=F[0],f=F[1];var G=E(b,e,f,c,oa.soundCloud,"soundcloud"),H=ma.slicedToArray(G,2);e=H[0],f=H[1];var I=E(b,e,f,c,oa.spotify,"spotify"),J=ma.slicedToArray(I,2);e=J[0],f=J[1];var K=E(b,e,f,c,oa.basicAudio,"audio",c.audioEmbed),L=ma.slicedToArray(K,2);e=L[0],f=L[1];var M=E(b,e,f,c,oa.flickr,"flickr"),N=ma.slicedToArray(M,2);e=N[0],f=N[1];var P=E(b,e,f,c,oa.instagram,"instagram"),Q=ma.slicedToArray(P,2);e=Q[0],f=Q[1];var R=E(b,e,f,c,oa.basicImage,"image",c.imageEmbed),T=ma.slicedToArray(R,2);if(e=T[0],f=T[1],i(c,"gist")){var U=new ta(b,e,c,f).process(),V=ma.slicedToArray(U,2);e=V[0],f=V[1]}return i(c,"youtube")?W(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?$(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ia(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?N(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?ba(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=ma.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new sa(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=ma.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){y(this.options),x(this.options),v(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==ma["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");z("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?na:arguments[2],e=document.querySelectorAll(b),f=0;f n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;AAED,AAkBA;;;;AAIA,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;SACvD,MAAM;YACH,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC5C;KACJ;IACD,OAAO,WAAW,CAAC;CACtB;;AAED,AAAO,SAAS,YAAY,CAAC,GAA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;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":"embed.es2015.js","sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,E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AC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js index e60470a..2b09efa 100644 --- a/src/embed.js +++ b/src/embed.js @@ -2294,7 +2294,7 @@ value: function destroy() { if (babelHelpers.typeof(this.options.input) !== 'object') throw new Error('destroy() method only works if an element had been passed in the options object'); destroyVideos('ejs-video-thumb'); - this.options.input.removeEventListener('rendered', this.twitter.load(), false); + if (this.options.tweetsEmbed) this.options.input.removeEventListener('rendered', this.twitter.load(), false); this.options.input.innerHTML = this.input; } diff --git a/src/embed.js.map b/src/embed.js.map index e7f9c26..213e6d9 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":"embed.js","sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","template","formatData","data","urlToText","fetchData"],"mappings":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AAb,EAAgB,OAAhB,GAD6C;QAA9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA2BiB;AACjB,IAAA,UAAO,QAAP,CADiB;;;YA5RE;;;;;"} \ No newline at end of file +{"version":3,"file":"embed.js","sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAO,SAAS,QAAT,CAAkB,MAAlB,EAA0B,CAA1B,EAA6B;AAChC,IAAA,WAAO,OAAO,MAAP,CAAc,CAAd,EAAiB,IAAI,CAAJ,CAAjB,IAA2B,OAAO,MAAP,GAAgB,CAAhB,GAAoB,KAApB,GAA4B,EAA5B,CAA3B,CADyB;KAA7B;;;;;;AA0BP,IAAO,SAAS,KAAT,CAAe,MAAf,EAAuB;AAC1B,IAAA,WAAO,MAAC,CAAO,OAAP,CAAe,IAAf,MAAyB,CAAC,CAAD,GAAO,OAAO,MAAP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AAX,CADgE;AAEpE,IAAA,QAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,SAAS,MAAT,EAAiB,GAArC,EAA0C;AACzC,IAAA,YAAQ,KAAR,GAAgB,SAAS,CAAT,CAAhB,CADyC;AAEzC,IAAA,cAAU,CAAV,IAAgB,IAAI,OAAJ,CAAY,OAAZ,EAAqB,QAArB,CAAhB,CAFyC;AAGzC,IAAA,aAAS,CAAT,IAAgB,UAAU,CAAV,EAAa,MAAb,EAAhB,CAHyC;QAA1C;AAKA,IAAA,UAAO,IAAI,OAAJ,CAAY,UAAU,OAAV,EAAmB;AACrC,IAAA,YAAQ,GAAR,CAAY,QAAZ,EAAsB,IAAtB,CAA2B,UAAU,GAAV,EAAe;AACzC,IAAA,aAAQ,GAAR,EADyC;SAAf,CAA3B,CADqC;QAAnB,CAAnB,CAPoE;;;;;;;;;;uCAkB7C;AACvB,IAAA,QAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,UAAU,MAAV,EAAkB,GAAtC,EAA2C;AAC1C,IAAA,cAAU,CAAV,EAAa,OAAb,GAD0C;QAA3C;;;;;;;;;;mCASmB;AACnB,IAAA,QAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,aAAa,MAAb,EAAqB,GAAzC,EAA8C;AAC7C,IAAA,iBAAa,CAAb,EAAgB,OAAhB,GAD6C;QAA9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA2BiB;AACjB,IAAA,UAAO,QAAP,CADiB;;;YA7RE;;;;;"} \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index d03d6cc..f54b9ab 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -343,7 +343,8 @@ export default class EmbedJS { destroy() { if (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`); destroyVideos('ejs-video-thumb'); - this.options.input.removeEventListener('rendered', this.twitter.load(), false); + if (this.options.tweetsEmbed) + this.options.input.removeEventListener('rendered', this.twitter.load(), false); this.options.input.innerHTML = this.input } From 18267268c5d83593c345a5c4f3d61e78af86be48 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Tue, 12 Jul 2016 22:11:07 +0530 Subject: [PATCH 02/62] fix(smiley): fixed smiley, hashtag and mention conflict --- demo/index.html | 61 +++++++++++++++--------------- dist/embed.min.js | 4 +- rollup.es2015.config.js | 2 +- src/embed.es2015.js | 22 ++++++----- src/embed.es2015.js.map | 2 +- src/embed.js | 22 ++++++----- src/embed.js.map | 2 +- src/js/modules/emoticons/smiley.js | 4 ++ src/js/modules/hashtag.js | 6 +-- src/js/modules/mentions.js | 6 +-- src/js/modules/regex.js | 4 +- 11 files changed, 73 insertions(+), 62 deletions(-) diff --git a/demo/index.html b/demo/index.html index e782944..093d810 100644 --- a/demo/index.html +++ b/demo/index.html @@ -33,31 +33,30 @@

Emojis

-
-@a @b #kjh :bowtie: :smile: :laughing: :blush: :smiley: :relaxed: :smirk: :heart_eyes: :kissing_heart: :kissing_closed_eyes: :flushed: :relieved: :satisfied: :grin: :wink: :stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes: :grinning: :kissing: :winky_face: :kissing_smiling_eyes: :stuck_out_tongue: :sleeping: :worried: :frowning: :anguished: :open_mouth: :grimacing: :confused: :hushed: :expressionless: :unamused: :sweat_smile: :sweat: :wow: :disappointed_relieved: :weary: :pensive: :disappointed: :confounded: :fearful: :cold_sweat: :persevere: :cry: :sob: :joy: :astonished: :scream: :neckbeard: :tired_face: :angry: :rage: :triumph: :sleepy: :yum: :mask: :sunglasses: :dizzy_face: :imp: :smiling_imp: :neutral_face: :no_mouth: :innocent: :alien: :yellow_heart: :blue_heart: :purple_heart: :heart: :green_heart: :broken_heart: :heartbeat: :heartpulse: :two_hearts: :revolving_hearts: :cupid: :sparkling_heart: :sparkles: :star: :star2: :dizzy: :boom: :collision: :anger: :exclamation: :question: :grey_exclamation: :grey_question: :zzz: :dash: :sweat_drops: :notes: :musical_note: :fire: :hankey: :poop: :shit: :+1: :thumbsup: :-1: :thumbsdown: :ok_hand: :punch: :facepunch: :fist: :v: :wave: :hand: :raised_hand: :open_hands: :point_up: :point_down: :point_left: :point_right: :raised_hands: :pray: :point_up_2: :clap: :muscle: :metal: :fu: :walking: :runner: :running: :couple: :family: :two_men_holding_hands: :two_women_holding_hands: :dancer: :dancers: :ok_woman: :no_good: :information_desk_person: :raising_hand: :bride_with_veil: :person_with_pouting_face: :person_frowning: :bow: :couplekiss: :couple_with_heart: :massage: :haircut: :nail_care: :boy: :girl: :woman: :man: :baby: :older_woman: :older_man: :person_with_blond_hair: :man_with_gua_pi_mao: :man_with_turban: :construction_worker: :cop: :angel: :princess: :smiley_cat: :smile_cat: :heart_eyes_cat: :kissing_cat: :smirk_cat: :scream_cat: :crying_cat_face: :joy_cat: :pouting_cat: :japanese_ogre: :japanese_goblin: :see_no_evil: :hear_no_evil: :speak_no_evil: :guardsman: :skull: :feet: :lips: :kiss: :droplet: :ear: :eyes: :nose: :tongue: :love_letter: :bust_in_silhouette: :busts_in_silhouette: :speech_balloon: :thought_balloon: :feelsgood: :finnadie: :goberserk: :godmode: :hurtrealbad: :rage1: :rage2: :rage3: :rage4: :suspect: :trollface: :sunny: :umbrella: :cloud: :snowflake: :snowman: :zap: :cyclone: :foggy: :ocean: :cat: :dog: :mouse: :hamster: :rabbit: :wolf: :frog: :tiger: :koala: :bear: :pig: :pig_nose: :cow: :boar: :monkey_face: :monkey: :horse: :racehorse: :camel: :sheep: :elephant: :panda_face: :snake: :bird: :baby_chick: :hatched_chick: :hatching_chick: :chicken: :penguin: :turtle: :bug: :honeybee: :ant: :beetle: :snail: :octopus: :tropical_fish: :fish: :whale: :whale2: :dolphin: :cow2: :ram: :rat: :water_buffalo: :tiger2: :rabbit2: :dragon: :goat: :rooster: :dog2: :pig2: :mouse2: :ox: :dragon_face: :blowfish: :crocodile: :dromedary_camel: :leopard: :cat2: :poodle: :paw_prints: :bouquet: :cherry_blossom: :tulip: :four_leaf_clover: :rose: :sunflower: :hibiscus: :maple_leaf: :leaves: :fallen_leaf: :herb: :mushroom: :cactus: :palm_tree: :evergreen_tree: :deciduous_tree: :chestnut: :seedling: :blossom: :ear_of_rice: :shell: :globe_with_meridians: :sun_with_face: :full_moon_with_face: :new_moon_with_face: :new_moon: :waxing_crescent_moon: :first_quarter_moon: :waxing_gibbous_moon: :full_moon: :waning_gibbous_moon: :last_quarter_moon: :waning_crescent_moon: :last_quarter_moon_with_face: :first_quarter_moon_with_face: :moon: :earth_africa: :earth_americas: :earth_asia: :volcano: :milky_way: :partly_sunny: :octocat: :squirrel: :bamboo: :gift_heart: :dolls: :school_satchel: :mortar_board: :flags: :fireworks: :sparkler: :wind_chime: :rice_scene: :jack_o_lantern: :ghost: :santa: :christmas_tree: :gift: :bell: :no_bell: :tanabata_tree: :tada: :confetti_ball: :balloon: :crystal_ball: :cd: :dvd: :floppy_disk: :camera: :video_camera: :movie_camera: :computer: :tv: :iphone: :phone: :telephone: :telephone_receiver: :pager: :fax: :minidisc: :vhs: :sound: :speaker: :mute: :loudspeaker: :mega: :hourglass: :hourglass_flowing_sand: :alarm_clock: :watch: :radio: :satellite: :loop: :mag: :mag_right: :unlock: :lock: :lock_with_ink_pen: :closed_lock_with_key: :key: :bulb: :flashlight: :high_brightness: :low_brightness: :electric_plug: :battery: :calling: :email: :mailbox: :postbox: :bath: :bathtub: :shower: :toilet: :wrench: :nut_and_bolt: :hammer: :seat: :moneybag: :yen: :dollar: :pound: :euro: :credit_card: :money_with_wings: :e-mail: :inbox_tray: :outbox_tray: :envelope: :incoming_envelope: :postal_horn: :mailbox_closed: :mailbox_with_mail: :mailbox_with_no_mail: :door: :smoking: :bomb: :gun: :hocho: :pill: :syringe: :page_facing_up: :page_with_curl: :bookmark_tabs: :bar_chart: :chart_with_upwards_trend: :chart_with_downwards_trend: :scroll: :clipboard: :calendar: :date: :card_index: :file_folder: :open_file_folder: :scissors: :pushpin: :paperclip: :black_nib: :pencil2: :straight_ruler: :triangular_ruler: :closed_book: :green_book: :blue_book: :orange_book: :notebook: :notebook_with_decorative_cover: :ledger: :books: :bookmark: :name_badge: :microscope: :telescope: :newspaper: :football: :basketball: :soccer: :baseball: :tennis: :8ball: :rugby_football: :bowling: :golf: :mountain_bicyclist: :bicyclist: :horse_racing: :snowboarder: :swimmer: :surfer: :ski: :spades: :hearts: :clubs: :diamonds: :gem: :ring: :trophy: :musical_score: :musical_keyboard: :violin: :space_invader: :video_game: :black_joker: :flower_playing_cards: :game_die: :dart: :mahjong: :clapper: :memo: :pencil: :book: :art: :microphone: :headphones: :trumpet: :saxophone: :guitar: :shoe: :sandal: :high_heel: :lipstick: :boot: :shirt: :tshirt: :necktie: :womans_clothes: :dress: :running_shirt_with_sash: :jeans: :kimono: :bikini: :ribbon: :tophat: :crown: :womans_hat: :mans_shoe: :closed_umbrella: :briefcase: :handbag: :pouch: :purse: :eyeglasses: :fishing_pole_and_fish: :coffee: :tea: :sake: :baby_bottle: :beer: :beers: :cocktail: :tropical_drink: :wine_glass: :fork_and_knife: :pizza: :hamburger: :fries: :poultry_leg: :meat_on_bone: :spaghetti: :curry: :fried_shrimp: :bento: :sushi: :fish_cake: :rice_ball: :rice_cracker: :rice: :ramen: :stew: :oden: :dango: :egg: :bread: :doughnut: :custard: :icecream: :ice_cream: :shaved_ice: :birthday: :cake: :cookie: :chocolate_bar: :candy: :lollipop: :honey_pot: :apple: :green_apple: :tangerine: :lemon: :cherries: :grapes: :watermelon: :strawberry: :peach: :melon: :banana: :pear: :pineapple: :sweet_potato: :eggplant: :tomato: :corn: :house: :house_with_garden: :school: :office: :post_office: :hospital: :bank: :convenience_store: :love_hotel: :hotel: :wedding: :church: :department_store: :european_post_office: :city_sunrise: :city_sunset: :japanese_castle: :european_castle: :tent: :factory: :tokyo_tower: :japan: :mount_fuji: :sunrise_over_mountains: :sunrise: :stars: :themoreyouknow: :tmyk: :statue_of_liberty: :bridge_at_night: :carousel_horse: :rainbow: :ferris_wheel: :fountain: :roller_coaster: :ship: :speedboat: :boat: :sailboat: :rowboat: :anchor: :rocket: :airplane: :helicopter: :steam_locomotive: :tram: :mountain_railway: :bike: :aerial_tramway: :suspension_railway: :mountain_cableway: :tractor: :blue_car: :oncoming_automobile: :car: :red_car: :taxi: :oncoming_taxi: :articulated_lorry: :bus: :oncoming_bus: :rotating_light: :police_car: :oncoming_police_car: :fire_engine: :ambulance: :minibus: :truck: :train: :station: :train2: :bullettrain_front: :bullettrain_side: :light_rail: :monorail: :railway_car: :trolleybus: :ticket: :fuelpump: :vertical_traffic_light: :traffic_light: :warning: :construction: :beginner: :atm: :slot_machine: :busstop: :barber: :hotsprings: :checkered_flag: :crossed_flags: :izakaya_lantern: :moyai: :circus_tent: :performing_arts: :round_pushpin: :triangular_flag_on_post: :jp: :kr: :cn: :us: :fr: :es: :it: :ru: :gb: :uk: :de: :one: :two: :three: :four: :five: :six: :seven: :eight: :nine: :keycap_ten: :1234: :zero: :hash: :symbols: :arrow_backward: :arrow_down: :arrow_forward: :arrow_left: :capital_abcd: :abcd: :abc: :arrow_lower_left: :arrow_lower_right: :arrow_right: :arrow_up: :arrow_upper_left: :arrow_upper_right: :arrow_double_down: :arrow_double_up: :arrow_down_small: :arrow_heading_down: :arrow_heading_up: :leftwards_arrow_with_hook: :arrow_right_hook: :left_right_arrow: :arrow_up_down: :arrow_up_small: :arrows_clockwise: :arrows_counterclockwise: :rewind: :fast_forward: :information_source: :ok: :twisted_rightwards_arrows: :repeat: :repeat_one: :new: :top: :up: :cool: :free: :ng: :cinema: :koko: :signal_strength: :u5272: :u5408: :u55b6: :u6307: :u6708: :u6709: :u6e80: :u7121: :u7533: :u7a7a: :u7981: :sa: :restroom: :mens: :womens: :baby_symbol: :no_smoking: :parking: :wheelchair: :metro: :baggage_claim: :accept: :wc: :potable_water: :put_litter_in_its_place: :secret: :congratulations: :m: :passport_control: :left_luggage: :customs: :ideograph_advantage: :cl: :sos: :id: :no_entry_sign: :underage: :no_mobile_phones: :do_not_litter: :non-potable_water: :no_bicycles: :no_pedestrians: :children_crossing: :no_entry: :eight_spoked_asterisk: :eight_pointed_black_star: :heart_decoration: :vs: :vibration_mode: :mobile_phone_off: :chart: :currency_exchange: :aries: :taurus: :gemini: :cancer: :leo: :virgo: :libra: :scorpius: :sagittarius: :capricorn: :aquarius: :pisces: :ophiuchus: :six_pointed_star: :negative_squared_cross_mark: :a: :b: :ab: :o2: :diamond_shape_with_a_dot_inside: :recycle: :end: :on: :soon: :clock1: :clock130: :clock10: :clock1030: :clock11: :clock1130: :clock12: :clock1230: :clock2: :clock230: :clock3: :clock330: :clock4: :clock430: :clock5: :clock530: :clock6: :clock630: :clock7: :clock730: :clock8: :clock830: :clock9: :clock930: :heavy_dollar_sign: :copyright: :registered: :tm: :x: :heavy_exclamation_mark: :bangbang: :interrobang: :o: :heavy_multiplication_x: :heavy_plus_sign: :heavy_minus_sign: :heavy_division_sign: :white_flower: :100: :heavy_check_mark: :ballot_box_with_check: :radio_button: :link: :curly_loop: :wavy_dash: :part_alternation_mark: :trident: :black_square: :white_square: :white_check_mark: :black_square_button: :white_square_button: :black_circle: :white_circle: :red_circle: :large_blue_circle: :large_blue_diamond: :large_orange_diamond: :small_blue_diamond: :small_orange_diamond: :small_red_triangle: :small_red_triangle_down: :shipit: +
":P :O :D :)" @a @b #kjh :bowtie: :smile: :laughing: :blush: :smiley: :relaxed: :smirk: :heart_eyes: :kissing_heart: :kissing_closed_eyes: :flushed: :relieved: :satisfied: :grin: :wink: :stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes: :grinning: :kissing: :winky_face: :kissing_smiling_eyes: :stuck_out_tongue: :sleeping: :worried: :frowning: :anguished: :open_mouth: :grimacing: :confused: :hushed: :expressionless: :unamused: :sweat_smile: :sweat: :wow: :disappointed_relieved: :weary: :pensive: :disappointed: :confounded: :fearful: :cold_sweat: :persevere: :cry: :sob: :joy: :astonished: :scream: :neckbeard: :tired_face: :angry: :rage: :triumph: :sleepy: :yum: :mask: :sunglasses: :dizzy_face: :imp: :smiling_imp: :neutral_face: :no_mouth: :innocent: :alien: :yellow_heart: :blue_heart: :purple_heart: :heart: :green_heart: :broken_heart: :heartbeat: :heartpulse: :two_hearts: :revolving_hearts: :cupid: :sparkling_heart: :sparkles: :star: :star2: :dizzy: :boom: :collision: :anger: :exclamation: :question: :grey_exclamation: :grey_question: :zzz: :dash: :sweat_drops: :notes: :musical_note: :fire: :hankey: :poop: :shit: :+1: :thumbsup: :-1: :thumbsdown: :ok_hand: :punch: :facepunch: :fist: :v: :wave: :hand: :raised_hand: :open_hands: :point_up: :point_down: :point_left: :point_right: :raised_hands: :pray: :point_up_2: :clap: :muscle: :metal: :fu: :walking: :runner: :running: :couple: :family: :two_men_holding_hands: :two_women_holding_hands: :dancer: :dancers: :ok_woman: :no_good: :information_desk_person: :raising_hand: :bride_with_veil: :person_with_pouting_face: :person_frowning: :bow: :couplekiss: :couple_with_heart: :massage: :haircut: :nail_care: :boy: :girl: :woman: :man: :baby: :older_woman: :older_man: :person_with_blond_hair: :man_with_gua_pi_mao: :man_with_turban: :construction_worker: :cop: :angel: :princess: :smiley_cat: :smile_cat: :heart_eyes_cat: :kissing_cat: :smirk_cat: :scream_cat: :crying_cat_face: :joy_cat: :pouting_cat: :japanese_ogre: :japanese_goblin: :see_no_evil: :hear_no_evil: :speak_no_evil: :guardsman: :skull: :feet: :lips: :kiss: :droplet: :ear: :eyes: :nose: :tongue: :love_letter: :bust_in_silhouette: :busts_in_silhouette: :speech_balloon: :thought_balloon: :feelsgood: :finnadie: :goberserk: :godmode: :hurtrealbad: :rage1: :rage2: :rage3: :rage4: :suspect: :trollface: :sunny: :umbrella: :cloud: :snowflake: :snowman: :zap: :cyclone: :foggy: :ocean: :cat: :dog: :mouse: :hamster: :rabbit: :wolf: :frog: :tiger: :koala: :bear: :pig: :pig_nose: :cow: :boar: :monkey_face: :monkey: :horse: :racehorse: :camel: :sheep: :elephant: :panda_face: :snake: :bird: :baby_chick: :hatched_chick: :hatching_chick: :chicken: :penguin: :turtle: :bug: :honeybee: :ant: :beetle: :snail: :octopus: :tropical_fish: :fish: :whale: :whale2: :dolphin: :cow2: :ram: :rat: :water_buffalo: :tiger2: :rabbit2: :dragon: :goat: :rooster: :dog2: :pig2: :mouse2: :ox: :dragon_face: :blowfish: :crocodile: :dromedary_camel: :leopard: :cat2: :poodle: :paw_prints: :bouquet: :cherry_blossom: :tulip: :four_leaf_clover: :rose: :sunflower: :hibiscus: :maple_leaf: :leaves: :fallen_leaf: :herb: :mushroom: :cactus: :palm_tree: :evergreen_tree: :deciduous_tree: :chestnut: :seedling: :blossom: :ear_of_rice: :shell: :globe_with_meridians: :sun_with_face: :full_moon_with_face: :new_moon_with_face: :new_moon: :waxing_crescent_moon: :first_quarter_moon: :waxing_gibbous_moon: :full_moon: :waning_gibbous_moon: :last_quarter_moon: :waning_crescent_moon: :last_quarter_moon_with_face: :first_quarter_moon_with_face: :moon: :earth_africa: :earth_americas: :earth_asia: :volcano: :milky_way: :partly_sunny: :octocat: :squirrel: :bamboo: :gift_heart: :dolls: :school_satchel: :mortar_board: :flags: :fireworks: :sparkler: :wind_chime: :rice_scene: :jack_o_lantern: :ghost: :santa: :christmas_tree: :gift: :bell: :no_bell: :tanabata_tree: :tada: :confetti_ball: :balloon: :crystal_ball: :cd: :dvd: :floppy_disk: :camera: :video_camera: :movie_camera: :computer: :tv: :iphone: :phone: :telephone: :telephone_receiver: :pager: :fax: :minidisc: :vhs: :sound: :speaker: :mute: :loudspeaker: :mega: :hourglass: :hourglass_flowing_sand: :alarm_clock: :watch: :radio: :satellite: :loop: :mag: :mag_right: :unlock: :lock: :lock_with_ink_pen: :closed_lock_with_key: :key: :bulb: :flashlight: :high_brightness: :low_brightness: :electric_plug: :battery: :calling: :email: :mailbox: :postbox: :bath: :bathtub: :shower: :toilet: :wrench: :nut_and_bolt: :hammer: :seat: :moneybag: :yen: :dollar: :pound: :euro: :credit_card: :money_with_wings: :e-mail: :inbox_tray: :outbox_tray: :envelope: :incoming_envelope: :postal_horn: :mailbox_closed: :mailbox_with_mail: :mailbox_with_no_mail: :door: :smoking: :bomb: :gun: :hocho: :pill: :syringe: :page_facing_up: :page_with_curl: :bookmark_tabs: :bar_chart: :chart_with_upwards_trend: :chart_with_downwards_trend: :scroll: :clipboard: :calendar: :date: :card_index: :file_folder: :open_file_folder: :scissors: :pushpin: :paperclip: :black_nib: :pencil2: :straight_ruler: :triangular_ruler: :closed_book: :green_book: :blue_book: :orange_book: :notebook: :notebook_with_decorative_cover: :ledger: :books: :bookmark: :name_badge: :microscope: :telescope: :newspaper: :football: :basketball: :soccer: :baseball: :tennis: :8ball: :rugby_football: :bowling: :golf: :mountain_bicyclist: :bicyclist: :horse_racing: :snowboarder: :swimmer: :surfer: :ski: :spades: :hearts: :clubs: :diamonds: :gem: :ring: :trophy: :musical_score: :musical_keyboard: :violin: :space_invader: :video_game: :black_joker: :flower_playing_cards: :game_die: :dart: :mahjong: :clapper: :memo: :pencil: :book: :art: :microphone: :headphones: :trumpet: :saxophone: :guitar: :shoe: :sandal: :high_heel: :lipstick: :boot: :shirt: :tshirt: :necktie: :womans_clothes: :dress: :running_shirt_with_sash: :jeans: :kimono: :bikini: :ribbon: :tophat: :crown: :womans_hat: :mans_shoe: :closed_umbrella: :briefcase: :handbag: :pouch: :purse: :eyeglasses: :fishing_pole_and_fish: :coffee: :tea: :sake: :baby_bottle: :beer: :beers: :cocktail: :tropical_drink: :wine_glass: :fork_and_knife: :pizza: :hamburger: :fries: :poultry_leg: :meat_on_bone: :spaghetti: :curry: :fried_shrimp: :bento: :sushi: :fish_cake: :rice_ball: :rice_cracker: :rice: :ramen: :stew: :oden: :dango: :egg: :bread: :doughnut: :custard: :icecream: :ice_cream: :shaved_ice: :birthday: :cake: :cookie: :chocolate_bar: :candy: :lollipop: :honey_pot: :apple: :green_apple: :tangerine: :lemon: :cherries: :grapes: :watermelon: :strawberry: :peach: :melon: :banana: :pear: :pineapple: :sweet_potato: :eggplant: :tomato: :corn: :house: :house_with_garden: :school: :office: :post_office: :hospital: :bank: :convenience_store: :love_hotel: :hotel: :wedding: :church: :department_store: :european_post_office: :city_sunrise: :city_sunset: :japanese_castle: :european_castle: :tent: :factory: :tokyo_tower: :japan: :mount_fuji: :sunrise_over_mountains: :sunrise: :stars: :themoreyouknow: :tmyk: :statue_of_liberty: :bridge_at_night: :carousel_horse: :rainbow: :ferris_wheel: :fountain: :roller_coaster: :ship: :speedboat: :boat: :sailboat: :rowboat: :anchor: :rocket: :airplane: :helicopter: :steam_locomotive: :tram: :mountain_railway: :bike: :aerial_tramway: :suspension_railway: :mountain_cableway: :tractor: :blue_car: :oncoming_automobile: :car: :red_car: :taxi: :oncoming_taxi: :articulated_lorry: :bus: :oncoming_bus: :rotating_light: :police_car: :oncoming_police_car: :fire_engine: :ambulance: :minibus: :truck: :train: :station: :train2: :bullettrain_front: :bullettrain_side: :light_rail: :monorail: :railway_car: :trolleybus: :ticket: :fuelpump: :vertical_traffic_light: :traffic_light: :warning: :construction: :beginner: :atm: :slot_machine: :busstop: :barber: :hotsprings: :checkered_flag: :crossed_flags: :izakaya_lantern: :moyai: :circus_tent: :performing_arts: :round_pushpin: :triangular_flag_on_post: :jp: :kr: :cn: :us: :fr: :es: :it: :ru: :gb: :uk: :de: :one: :two: :three: :four: :five: :six: :seven: :eight: :nine: :keycap_ten: :1234: :zero: :hash: :symbols: :arrow_backward: :arrow_down: :arrow_forward: :arrow_left: :capital_abcd: :abcd: :abc: :arrow_lower_left: :arrow_lower_right: :arrow_right: :arrow_up: :arrow_upper_left: :arrow_upper_right: :arrow_double_down: :arrow_double_up: :arrow_down_small: :arrow_heading_down: :arrow_heading_up: :leftwards_arrow_with_hook: :arrow_right_hook: :left_right_arrow: :arrow_up_down: :arrow_up_small: :arrows_clockwise: :arrows_counterclockwise: :rewind: :fast_forward: :information_source: :ok: :twisted_rightwards_arrows: :repeat: :repeat_one: :new: :top: :up: :cool: :free: :ng: :cinema: :koko: :signal_strength: :u5272: :u5408: :u55b6: :u6307: :u6708: :u6709: :u6e80: :u7121: :u7533: :u7a7a: :u7981: :sa: :restroom: :mens: :womens: :baby_symbol: :no_smoking: :parking: :wheelchair: :metro: :baggage_claim: :accept: :wc: :potable_water: :put_litter_in_its_place: :secret: :congratulations: :m: :passport_control: :left_luggage: :customs: :ideograph_advantage: :cl: :sos: :id: :no_entry_sign: :underage: :no_mobile_phones: :do_not_litter: :non-potable_water: :no_bicycles: :no_pedestrians: :children_crossing: :no_entry: :eight_spoked_asterisk: :eight_pointed_black_star: :heart_decoration: :vs: :vibration_mode: :mobile_phone_off: :chart: :currency_exchange: :aries: :taurus: :gemini: :cancer: :leo: :virgo: :libra: :scorpius: :sagittarius: :capricorn: :aquarius: :pisces: :ophiuchus: :six_pointed_star: :negative_squared_cross_mark: :a: :b: :ab: :o2: :diamond_shape_with_a_dot_inside: :recycle: :end: :on: :soon: :clock1: :clock130: :clock10: :clock1030: :clock11: :clock1130: :clock12: :clock1230: :clock2: :clock230: :clock3: :clock330: :clock4: :clock430: :clock5: :clock530: :clock6: :clock630: :clock7: :clock730: :clock8: :clock830: :clock9: :clock930: :heavy_dollar_sign: :copyright: :registered: :tm: :x: :heavy_exclamation_mark: :bangbang: :interrobang: :o: :heavy_multiplication_x: :heavy_plus_sign: :heavy_minus_sign: :heavy_division_sign: :white_flower: :100: :heavy_check_mark: :ballot_box_with_check: :radio_button: :link: :curly_loop: :wavy_dash: :part_alternation_mark: :trident: :black_square: :white_square: :white_check_mark: :black_square_button: :white_square_button: :black_circle: :white_circle: :red_circle: :large_blue_circle: :large_blue_diamond: :large_orange_diamond: :small_blue_diamond: :small_orange_diamond: :small_red_triangle: :small_red_triangle_down: :shipit:

Loading embed.js in a block

-
-Lorem ipsum dolor sit amet https://jsfiddle.net/ritz078/n5dL6ogd/4/, consectetur http://1.2.3.4:555/qweqwe?foo=1.5&bar="lalala" adipisicing elit. Itaque consectetur http://whatever.com?x={thisfails} iure culpa reiciendis repudiandae https://españa.com vitae quae temporibus eum fugit, porro accusamus https://github.com/ritz078/embed.js quis quas sapiente, deleniti! Suscipit excepturi ipsa nobis corrupti https://[123:456:abcd::3]:5555/foo. -
-
-#embed.js -Lorem ipsum dolor sit amet, :smile: consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. http://riteshkr.com/embed.js/ Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor **sit amet, consectetur adipisicing** elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos ~~animi beatae~~. Eius, ipsum. Lorem ipsum :+1: dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque ![abcdefg](https://images.unsplash.com/photo-1443527216320-7e744084f5a7?dpr=2&fit=crop&fm=jpg&h=500&ixlib=rb-0.3.5&q=50&w=1450) , incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus https://www.youtube.com/watch?v=bQRLVxZHKPs recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, https://gist.github.com/jeremiahlee/1748966 consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_50mb.mp4 cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur https://twitter.com/IGN/status/652941146054881281 adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, + + + + + + -```coffeescript -grade = (student, period=(if b? then 7 else 6)) -> - if student.excellentWork - "A+" - else if student.okayStuff - if student.triedHard then "B" else "B-" else "C" -``` + + + + + + + - consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus https://github.com/ritz078/embed.js/issues/82 , voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto https://soundcloud.com/the-bugle/bugle-179-playas-gon-play minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora http://open.spotify.com/track/4th1RQAelzqgY7wL53UGQt doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium https://vine.co/v/bjHh0zHdgZT molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est nobis vero incidunt quod earum totam, corporis voluptatibus https://vimeo.com/119199079 ab voluptate nesciunt consequuntur eligendi natus voluptatem obcaecati quo. Dolor nostrum vel commodi! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia velit ipsam eos facere http://www.dailymotion.com/video/x2k8un2_2015-wc-nz-vs-wi-holder-reacts-on-guptills-237_sport molestias explicabo quia odit dignissimos ipsa iusto enim, harum debitis neque amet, optio voluptatum odio nisi eius. -
-
-Cur rumor nocere?Emeritis adelphis satis perderes domina est.Gloss cadunt in bi-color brema! @(IIT Roorkee) Bi-color habitio virtualiter imitaris amicitia est.Teres tatas ducunt ad racana.Genetrixs prarere in rugensis civitas! :) Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut numquam asperiores nobis repellat modi iusto, possimus excepturi atque, quae doloribus nihil corrupti minima quasi, sed? Vero labore cumque laudantium quisquam! https://www.instagram.com/p/_JHaOcjJ7h/?taken-by=9gag Lorem ipsum dolor sit amet, consectetur adipisicing elit. Similique blanditiis architecto tempore minima vero adipisci reiciendis ratione numquam quas perferendis maxime iste, commodi cumque quis praesentium quasi, a neque temporibus? https://www.instagram.com/p/-mIWFsIVV-/?taken-by=natgeo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto quis vitae cupiditate quam accusamus facere maxime ab distinctio tempore, voluptates itaque culpa amet placeat alias provident corporis, blanditiis explicabo perspiciatis. https://www.flickr.com/photos/43301211@N03/23331635460/in/explore-2015-12-09/ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum quasi sit et nam magni ab asperiores tempore, http://www.slideshare.net/haraldf/business-quotes-for-2011 impedit, tempora officiis rerum modi labore vitae explicabo eos aperiam sequi facilis neque. -
+ + + + +
@@ -96,17 +95,17 @@

Loading embed.js in a block

}); - var x = new EmbedJS({ - input: document.getElementById('block'), - tweetsEmbed: true - }); - x.render().then(function(data) { - console.log(data); - }); - - x.text(function(data) { - console.log(data) - }); +// var x = new EmbedJS({ +// input: document.getElementById('block'), +// tweetsEmbed: true +// }); +// x.render().then(function(data) { +// console.log(data); +// }); +// +// x.text(function(data) { +// console.log(data) +// }); EmbedJS.applyEmbedJS(".block").then(function(data) { diff --git a/dist/embed.min.js b/dist/embed.min.js index 0a308e4..c19b296 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -6,5 +6,5 @@ * Made by Ritesh Kumar * Under MIT License */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,la),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return-1===a.indexOf("//")?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":ma["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return a.replace(oa.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})}function s(a,b){var c=b.customFontIcons.length?b.customFontIcons:pa,d=c.map(function(a){return e(a.text)}),f=new RegExp("(^|\\s)("+d.join("|")+")(?=\\s|$)","gi");return a.replace(f,function(a,f,g){var h=d.indexOf(e(g)),i=c[h].code;return b.template.smiley(g,f,i,b)})}function t(a,b){var c=b.linkOptions;return a.replace(m(),function(a){if(")"===p(a))return a;var d=p(a.split("."));return"/"===p(a)&&(a=a.slice(0,-1)),-1===c.exclude.indexOf(d)?b.template.url(a,b):a})}function u(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function v(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,u);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return-1===a.options.served.indexOf(c)?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function B(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(-1!==a.options.served.indexOf(c)||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function C(a){return j(a.options,a.service)?A(a):B(a)}function D(a,b,c,d,e,f){var g={input:a,output:b,options:d,embeds:c,regex:e,service:f,template:function(a){return this.options.template[this.service](a,this.options)}};return C(g)}function E(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?D(a,b,c,d,e,f):[b,c]}function F(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function G(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(F(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function H(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function I(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(H(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function J(a,b){return new Promise(function(c){j(a.options,a.service)?G(a,b).then(function(b){return c([b,a.embeds])}):I(a,b).then(function(b){return c([a.output,b])})})}function K(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function L(a,b,c,d){var e=M(a);return d.template.gmap(b,c,e,d)}function M(a){return a.split("(")[1].split(")")[0]}function N(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(oa.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?K(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=ma.slicedToArray(e[k],2),f=a[0],h=a[1],l=L(g[k][0],f,h,c);j(c,i)?b=b.replace(oa.gmap,function(a){return''+M(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(oa.gmap,function(a){return''+M(a)+""}))};for(var k in f)h();a([b,d])})})}function O(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return-1===a.indexOf("</a")?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)}function P(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function Q(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function R(a,b){return'
'+(a.value||a)+"
"}function S(a,b){return a=a.replace(oa.inlineCode,function(a,b,c){return""+c+""}),a.replace(oa.highlightCode,function(a,c,d,e){var f=e;f=Q(f),f=P(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),R(h,g)})}function T(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function U(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function V(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){U(e,a.options).then(function(c){return b(w(T(c),c,f,a.options))})}):new Promise(function(b){return b(u(f,a.options))})}function W(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.youtube,service:"youtube"};return new Promise(function(a){return J(e,V).then(function(b){return a(b)})})}function X(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function Y(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function Z(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){Y(f).then(function(d){return c(w(X(d,b),d,g,a.options))})}):new Promise(function(b){return b(u(g,a.options))})}}function $(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.vimeo,service:"vimeo"};return new Promise(function(a){return J(e,Z).then(function(b){return a(b)})})}function _(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){ra(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function aa(a,b,c){return new Promise(function(b){_(a,c).then(function(c){return b(a.template(c))})})}function ba(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return J(e,aa).then(function(b){return a(b)})})}function ca(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function da(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){ca(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function ea(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return J(e,da).then(function(b){return a(b)})})}function fa(a,b){return b.template.github(a,b)}function ga(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function ha(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){ga(e).then(function(c){return b(fa(c,a.options))})})}function ia(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:oa.github};return new Promise(function(a){return J(e,ha).then(function(b){return a(b)})})}function ja(a,b){var c=oa.mentions;return a.replace(c,function(a){var c=a.split("@")[1];return b.mentionsUrl(c)})}function ka(a,b){var c=oa.hashtag;return a.replace(c,function(a){var c=a.split("#")[1];return b.hashtagUrl(c)})}var la="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,ma={};ma["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},ma.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},ma.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n \n
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=-1!==a.indexOf("//")?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},oa={mentions:/\B@[a-z0-9_-]+/gi,hashtag:/\B#[a-z0-9_-]+/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},pa=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=a.getAllResponseHeaders().trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(-1===q.indexOf(b))throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest;g.onload=function(){var a=1223===g.status?204:g.status;if(100>a||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:this);var ta=function(){function a(b,c,d,e){var f=this;ma.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=oa.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return ma.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return C(this)}}]),a}(),ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){ma.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||na,!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return ma.createClass(a,[{key:"process",value:function(){var a=this,b=this.input,c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=t(b,c));var h=c.openGraphEndpoint?ea(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=S(e,c)),c.marked&&(e=O(e,c)),c.emoji&&(e=r(e,c)),c.fontIcons&&(e=s(e,c)),c.mentions&&(e=ja(e,c)),c.hashtag&&(e=ka(e,c));var g=E(b,e,f,c,oa.ideone,"ideone"),h=ma.slicedToArray(g,2);e=h[0],f=h[1];var j=E(b,e,f,c,oa.plunker,"plunker"),k=ma.slicedToArray(j,2);e=k[0],f=k[1];var l=E(b,e,f,c,oa.jsbin,"jsbin"),m=ma.slicedToArray(l,2);e=m[0],f=m[1];var n=E(b,e,f,c,oa.codepen,"codepen"),o=ma.slicedToArray(n,2);e=o[0],f=o[1];var p=E(b,e,f,c,oa.jsfiddle,"jsfiddle"),q=ma.slicedToArray(p,2);e=q[0],f=q[1];var t=E(b,e,f,c,oa.ted,"ted"),u=ma.slicedToArray(t,2);e=u[0],f=u[1];var v=E(b,e,f,c,oa.dailymotion,"dailymotion"),w=ma.slicedToArray(v,2);e=w[0],f=w[1];var x=E(b,e,f,c,oa.ustream,"ustream"),y=ma.slicedToArray(x,2);e=y[0],f=y[1];var z=E(b,e,f,c,oa.liveleak,"liveleak"),A=ma.slicedToArray(z,2);e=A[0],f=A[1];var B=E(b,e,f,c,oa.basicVideo,"video",c.videoEmbed),C=ma.slicedToArray(B,2);e=C[0],f=C[1];var D=E(b,e,f,c,oa.vine,"vine"),F=ma.slicedToArray(D,2);e=F[0],f=F[1];var G=E(b,e,f,c,oa.soundCloud,"soundcloud"),H=ma.slicedToArray(G,2);e=H[0],f=H[1];var I=E(b,e,f,c,oa.spotify,"spotify"),J=ma.slicedToArray(I,2);e=J[0],f=J[1];var K=E(b,e,f,c,oa.basicAudio,"audio",c.audioEmbed),L=ma.slicedToArray(K,2);e=L[0],f=L[1];var M=E(b,e,f,c,oa.flickr,"flickr"),N=ma.slicedToArray(M,2);e=N[0],f=N[1];var P=E(b,e,f,c,oa.instagram,"instagram"),Q=ma.slicedToArray(P,2);e=Q[0],f=Q[1];var R=E(b,e,f,c,oa.basicImage,"image",c.imageEmbed),T=ma.slicedToArray(R,2);if(e=T[0],f=T[1],i(c,"gist")){var U=new ta(b,e,c,f).process(),V=ma.slicedToArray(U,2);e=V[0],f=V[1]}return i(c,"youtube")?W(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?$(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ia(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?N(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?ba(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=ma.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new sa(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=ma.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){y(this.options),x(this.options),v(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==ma["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");z("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?na:arguments[2],e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return-1===a.indexOf("//")?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":ma["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return a.replace(oa.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})}function s(a,b){var c=b.customFontIcons.length?b.customFontIcons:pa,d=c.map(function(a){return e(a.text)}),f=new RegExp("(^|\\s)("+d.join("|")+")(?=\\s|$)","gi");return a.replace(f,function(a,f,g){var h=d.indexOf(e(g));if(-1===h)return a;var i=c[h].code;return b.template.smiley(g,f,i,b)})}function t(a,b){var c=b.linkOptions;return a.replace(m(),function(a){if(")"===p(a))return a;var d=p(a.split("."));return"/"===p(a)&&(a=a.slice(0,-1)),-1===c.exclude.indexOf(d)?b.template.url(a,b):a})}function u(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function v(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,u);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return-1===a.options.served.indexOf(c)?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function B(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(-1!==a.options.served.indexOf(c)||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function C(a){return j(a.options,a.service)?A(a):B(a)}function D(a,b,c,d,e,f){var g={input:a,output:b,options:d,embeds:c,regex:e,service:f,template:function(a){return this.options.template[this.service](a,this.options)}};return C(g)}function E(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?D(a,b,c,d,e,f):[b,c]}function F(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function G(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(F(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function H(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function I(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(H(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function J(a,b){return new Promise(function(c){j(a.options,a.service)?G(a,b).then(function(b){return c([b,a.embeds])}):I(a,b).then(function(b){return c([a.output,b])})})}function K(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function L(a,b,c,d){var e=M(a);return d.template.gmap(b,c,e,d)}function M(a){return a.split("(")[1].split(")")[0]}function N(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(oa.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?K(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=ma.slicedToArray(e[k],2),f=a[0],h=a[1],l=L(g[k][0],f,h,c);j(c,i)?b=b.replace(oa.gmap,function(a){return''+M(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(oa.gmap,function(a){return''+M(a)+""}))};for(var k in f)h();a([b,d])})})}function O(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return-1===a.indexOf("</a")?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)}function P(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function Q(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function R(a,b){return'
'+(a.value||a)+"
"}function S(a,b){return a=a.replace(oa.inlineCode,function(a,b,c){return""+c+""}),a.replace(oa.highlightCode,function(a,c,d,e){var f=e;f=Q(f),f=P(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),R(h,g)})}function T(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function U(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function V(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){U(e,a.options).then(function(c){return b(w(T(c),c,f,a.options))})}):new Promise(function(b){return b(u(f,a.options))})}function W(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.youtube,service:"youtube"};return new Promise(function(a){return J(e,V).then(function(b){return a(b)})})}function X(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function Y(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function Z(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){Y(f).then(function(d){return c(w(X(d,b),d,g,a.options))})}):new Promise(function(b){return b(u(g,a.options))})}}function $(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.vimeo,service:"vimeo"};return new Promise(function(a){return J(e,Z).then(function(b){return a(b)})})}function _(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){ra(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function aa(a,b,c){return new Promise(function(b){_(a,c).then(function(c){return b(a.template(c))})})}function ba(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return J(e,aa).then(function(b){return a(b)})})}function ca(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function da(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){ca(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function ea(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return J(e,da).then(function(b){return a(b)})})}function fa(a,b){return b.template.github(a,b)}function ga(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function ha(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){ga(e).then(function(c){return b(fa(c,a.options))})})}function ia(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:oa.github};return new Promise(function(a){return J(e,ha).then(function(b){return a(b)})})}function ja(a,b){var c=oa.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})}function ka(a,b){var c=oa.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})}var la="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,ma={};ma["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},ma.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},ma.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n \n
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=-1!==a.indexOf("//")?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},oa={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},pa=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=a.getAllResponseHeaders().trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(-1===q.indexOf(b))throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest;g.onload=function(){var a=1223===g.status?204:g.status;if(100>a||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ta=function(){function a(b,c,d,e){var f=this;ma.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=oa.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return ma.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return C(this)}}]),a}(),ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){ma.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||na,!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return ma.createClass(a,[{key:"process",value:function(){var a=this,b=this.input,c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=t(b,c));var h=c.openGraphEndpoint?ea(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=S(e,c)),c.marked&&(e=O(e,c)),c.emoji&&(e=r(e,c)),c.fontIcons&&(e=s(e,c)),c.mentions&&(e=ja(e,c)),c.hashtag&&(e=ka(e,c));var g=E(b,e,f,c,oa.ideone,"ideone"),h=ma.slicedToArray(g,2);e=h[0],f=h[1];var j=E(b,e,f,c,oa.plunker,"plunker"),k=ma.slicedToArray(j,2);e=k[0],f=k[1];var l=E(b,e,f,c,oa.jsbin,"jsbin"),m=ma.slicedToArray(l,2);e=m[0],f=m[1];var n=E(b,e,f,c,oa.codepen,"codepen"),o=ma.slicedToArray(n,2);e=o[0],f=o[1];var p=E(b,e,f,c,oa.jsfiddle,"jsfiddle"),q=ma.slicedToArray(p,2);e=q[0],f=q[1];var t=E(b,e,f,c,oa.ted,"ted"),u=ma.slicedToArray(t,2);e=u[0],f=u[1];var v=E(b,e,f,c,oa.dailymotion,"dailymotion"),w=ma.slicedToArray(v,2);e=w[0],f=w[1];var x=E(b,e,f,c,oa.ustream,"ustream"),y=ma.slicedToArray(x,2);e=y[0],f=y[1];var z=E(b,e,f,c,oa.liveleak,"liveleak"),A=ma.slicedToArray(z,2);e=A[0],f=A[1];var B=E(b,e,f,c,oa.basicVideo,"video",c.videoEmbed),C=ma.slicedToArray(B,2);e=C[0],f=C[1];var D=E(b,e,f,c,oa.vine,"vine"),F=ma.slicedToArray(D,2);e=F[0],f=F[1];var G=E(b,e,f,c,oa.soundCloud,"soundcloud"),H=ma.slicedToArray(G,2);e=H[0],f=H[1];var I=E(b,e,f,c,oa.spotify,"spotify"),J=ma.slicedToArray(I,2);e=J[0],f=J[1];var K=E(b,e,f,c,oa.basicAudio,"audio",c.audioEmbed),L=ma.slicedToArray(K,2);e=L[0],f=L[1];var M=E(b,e,f,c,oa.flickr,"flickr"),N=ma.slicedToArray(M,2);e=N[0],f=N[1];var P=E(b,e,f,c,oa.instagram,"instagram"),Q=ma.slicedToArray(P,2);e=Q[0],f=Q[1];var R=E(b,e,f,c,oa.basicImage,"image",c.imageEmbed),T=ma.slicedToArray(R,2);if(e=T[0],f=T[1],i(c,"gist")){var U=new ta(b,e,c,f).process(),V=ma.slicedToArray(U,2);e=V[0],f=V[1]}return i(c,"youtube")?W(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?$(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ia(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?N(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?ba(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=ma.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new sa(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=ma.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){y(this.options),x(this.options),v(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==ma["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");z("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?na:arguments[2],e=document.querySelectorAll(b),f=0;f { let index = escapedSymbols.indexOf(escapeRegExp(text)); + if (index === -1) return match; let code = icons[index].code; return options.template.smiley(text, pre, code, options); }); @@ -1233,7 +1237,7 @@ class Twitter { }) } self.fetch.polyfill = true -})(typeof self !== 'undefined' ? self : this); +})(typeof self !== 'undefined' ? self : undefined); /** * Takes the location name and returns the coordinates of that location using the Google @@ -1694,17 +1698,17 @@ function github (input, output, options, embeds) { function mentions (input, options) { const mRegex = regex.mentions; - return input.replace(mRegex,(match) => { - const username = match.split('@')[1]; - return options.mentionsUrl(username); + return input.replace(mRegex,(match, $1, $2) => { + const username = $2.split('@')[1]; + return $1 + options.mentionsUrl(username); }) } function hashtag (input, options) { const hRegex = regex.hashtag; - return input.replace(hRegex,(match)=>{ - const username = match.split('#')[1]; - return options.hashtagUrl(username); + return input.replace(hRegex,(match, $1, $2)=>{ + const username = $2.split('#')[1]; + return $1 + options.hashtagUrl(username); }) } diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map index 231ba8f..5ad951d 100644 --- a/src/embed.es2015.js.map +++ b/src/embed.es2015.js.map @@ -1 +1 @@ -{"version":3,"file":"embed.es2015.js","sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;AAED,AAkBA;;;;AAIA,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,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MAAM,EAAE,CAAC,EAAE,EAAE;GACzC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;GAC5B,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;GAC/C,QAAQ,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;GACrC;EACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE;GACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;AAED,AAkBA;;;;AAIA,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC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AK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GACzC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;GAC5B,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;GAC/C,QAAQ,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;GACrC;EACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE;GACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js index 2b09efa..c1d56df 100644 --- a/src/embed.js +++ b/src/embed.js @@ -346,8 +346,8 @@ }; var regex = { - mentions: /\B@[a-z0-9_-]+/gi, - hashtag: /\B#[a-z0-9_-]+/gi, + mentions: /(^|\s)(@[a-z0-9_-]+)/gi, + hashtag: /(^|\s)(#[a-z\d-]+)/gi, basicAudio: /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, soundCloud: /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, spotify: /spotify.com\/track\/[a-zA-Z0-9_]+/gi, @@ -425,6 +425,9 @@ }, { 'text': ':o', 'code': '' + }, { + 'text': ':O', + 'code': '' }, { 'text': '-_-', 'code': '' @@ -474,6 +477,7 @@ return input.replace(smileyRegex, function (match, pre, text) { var index = escapedSymbols.indexOf(escapeRegExp(text)); + if (index === -1) return match; var code = icons[index].code; return options.template.smiley(text, pre, code, options); }); @@ -1292,7 +1296,7 @@ }); }; self.fetch.polyfill = true; - })(typeof self !== 'undefined' ? self : this); + })(typeof self !== 'undefined' ? self : undefined); /** * Takes the location name and returns the coordinates of that location using the Google @@ -1811,17 +1815,17 @@ function mentions (input, options) { var mRegex = regex.mentions; - return input.replace(mRegex, function (match) { - var username = match.split('@')[1]; - return options.mentionsUrl(username); + return input.replace(mRegex, function (match, $1, $2) { + var username = $2.split('@')[1]; + return $1 + options.mentionsUrl(username); }); } function hashtag (input, options) { var hRegex = regex.hashtag; - return input.replace(hRegex, function (match) { - var username = match.split('#')[1]; - return options.hashtagUrl(username); + return input.replace(hRegex, function (match, $1, $2) { + var username = $2.split('#')[1]; + return $1 + options.hashtagUrl(username); }); } diff --git a/src/embed.js.map b/src/embed.js.map index 213e6d9..3f19081 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":"embed.js","sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /\\B@[a-z0-9_-]+/gi,\n\thashtag : /\\B#[a-z0-9_-]+/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match) => {\n\t\tconst username = match.split('@')[1];\n\t\treturn options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match)=>{\n\t\tconst username = match.split('#')[1];\n\t\treturn options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAO,SAAS,QAAT,CAAkB,MAAlB,EAA0B,CAA1B,EAA6B;AAChC,IAAA,WAAO,OAAO,MAAP,CAAc,CAAd,EAAiB,IAAI,CAAJ,CAAjB,IAA2B,OAAO,MAAP,GAAgB,CAAhB,GAAoB,KAApB,GAA4B,EAA5B,CAA3B,CADyB;KAA7B;;;;;;AA0BP,IAAO,SAAS,KAAT,CAAe,MAAf,EAAuB;AAC1B,IAAA,WAAO,MAAC,CAAO,OAAP,CAAe,IAAf,MAAyB,CAAC,CAAD,GAAO,OAAO,MAAP,GAAiB,MAAlD,CADmB;KAAvB;;;;;;;;AAUP,IAAO,SAAS,UAAT,CAAoB,WAApB,EAAiC,MAAjC,EAAyC;AAC5C,IAAA,SAAK,IAAI,QAAJ,IAAgB,MAArB,EAA6B;AACzB,IAAA,YAAI,OAAO,cAAP,CAAsB,QAAtB,KAAmC,OAAO,QAAP,CAAnC,IAAuD,OAAO,QAAP,EAAiB,WAAjB,KAAiC,MAAjC,EAAyC;AAChG,IAAA,wBAAY,QAAZ,IAAwB,YAAY,QAAZ,KAAyB,EAAzB,CADwE;AAEhG,IAAA,uBAAW,YAAY,QAAZ,CAAX,EAAkC,OAAO,QAAP,CAAlC,EAFgG;aAApG,MAGO;AACH,IAAA,wBAAY,QAAZ,IAAwB,OAAO,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Q,GAAR,EADyC;SAAf,CAA3B,CADqC;QAAnB,CAAnB,CAPoE;;;;;;;;;;uCAkB7C;AACvB,IAAA,QAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,UAAU,MAAV,EAAkB,GAAtC,EAA2C;AAC1C,IAAA,cAAU,CAAV,EAAa,OAAb,GAD0C;QAA3C;;;;;;;;;;mCASmB;AACnB,IAAA,QAAK,IAAI,IAAI,CAAJ,EAAO,IAAI,aAAa,MAAb,EAAqB,GAAzC,EAA8C;AAC7C,IAAA,iBAAa,CAAb,EAAgB,OAAhB,GAD6C;QAA9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA2BiB;AACjB,IAAA,UAAO,QAAP,CADiB;;;YA7RE;;;;;"} \ No newline at end of file +{"version":3,"file":null,"sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/js/modules/emoticons/smiley.js b/src/js/modules/emoticons/smiley.js index 9637bd7..eff0ef4 100644 --- a/src/js/modules/emoticons/smiley.js +++ b/src/js/modules/emoticons/smiley.js @@ -34,6 +34,9 @@ const defaultIcons = [{ }, { 'text': ':o', 'code': '' +}, { + 'text': ':O', + 'code': '' }, { 'text': '-_-', 'code': '' @@ -81,6 +84,7 @@ export default function (input, options) { return input.replace(smileyRegex, (match, pre, text) => { let index = escapedSymbols.indexOf(escapeRegExp(text)); + if (index === -1) return match; let code = icons[index].code; return options.template.smiley(text, pre, code, options); }); diff --git a/src/js/modules/hashtag.js b/src/js/modules/hashtag.js index 146aa2a..7cfb8e0 100644 --- a/src/js/modules/hashtag.js +++ b/src/js/modules/hashtag.js @@ -2,8 +2,8 @@ import regex from './regex'; export default function (input, options) { const hRegex = regex.hashtag; - return input.replace(hRegex,(match)=>{ - const username = match.split('#')[1]; - return options.hashtagUrl(username); + return input.replace(hRegex,(match, $1, $2)=>{ + const username = $2.split('#')[1]; + return $1 + options.hashtagUrl(username); }) } diff --git a/src/js/modules/mentions.js b/src/js/modules/mentions.js index 430b96d..ca5cb9e 100644 --- a/src/js/modules/mentions.js +++ b/src/js/modules/mentions.js @@ -2,8 +2,8 @@ import regex from './regex'; export default function (input, options) { const mRegex = regex.mentions; - return input.replace(mRegex,(match) => { - const username = match.split('@')[1]; - return options.mentionsUrl(username); + return input.replace(mRegex,(match, $1, $2) => { + const username = $2.split('@')[1]; + return $1 + options.mentionsUrl(username); }) } diff --git a/src/js/modules/regex.js b/src/js/modules/regex.js index 5efafd4..df51e59 100644 --- a/src/js/modules/regex.js +++ b/src/js/modules/regex.js @@ -1,6 +1,6 @@ const regex = { - mentions : /\B@[a-z0-9_-]+/gi, - hashtag : /\B#[a-z0-9_-]+/gi, + mentions : /(^|\s)(@[a-z0-9_-]+)/gi, + hashtag : /(^|\s)(#[a-z\d-]+)/gi, basicAudio : /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, soundCloud : /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, spotify : /spotify.com\/track\/[a-zA-Z0-9_]+/gi, From a8c44d2f9de0f1e849ce8591e2792dc423405709 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Thu, 14 Jul 2016 18:56:35 +0530 Subject: [PATCH 03/62] Release v4.1.4 --- CHANGELOG.md | 11 +++++++++++ bower.json | 2 +- dist/embed.min.js | 2 +- package.json | 2 +- src/embed.es2015.js | 2 +- src/embed.js | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46fc236..df778fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [4.1.4](https://github.com/ritz078/embed.js/compare/v4.1.3...v4.1.4) (2016-07-14) + + +### Bug Fixes + +* **destroy:** fixed .load of undefined when tweetsEmbed was turned off. ([e19068b](https://github.com/ritz078/embed.js/commit/e19068b)) +* **smiley:** fixed smiley, hashtag and mention conflict ([1826726](https://github.com/ritz078/embed.js/commit/1826726)) + + + ## [4.1.3](https://github.com/ritz078/embed.js/compare/v4.1.2...v4.1.3) (2016-06-16) diff --git a/bower.json b/bower.json index 9294110..28036dd 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.3", + "version": "4.1.4", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "main": [ "./src/embed.css", diff --git a/dist/embed.min.js b/dist/embed.min.js index c19b296..cd655db 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.3 + * embed-js - v4.1.4 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/package.json b/package.json index 9deb723..8fd0921 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.3", + "version": "4.1.4", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "keywords": [ "JavaScript-plugin", diff --git a/src/embed.es2015.js b/src/embed.es2015.js index db31981..aa73f02 100644 --- a/src/embed.es2015.js +++ b/src/embed.es2015.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.3 + * embed-js - v4.1.4 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/src/embed.js b/src/embed.js index c1d56df..4777833 100644 --- a/src/embed.js +++ b/src/embed.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.3 + * embed-js - v4.1.4 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * From 3535d7536f758661fe2fca73468f38872e4aef95 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Sun, 16 Oct 2016 12:25:32 +0530 Subject: [PATCH 04/62] fix(string): allow empty string as input fixes #181 --- demo/index.html | 56 +- dist/embed.min.js | 4 +- src/embed.es2015.js | 291 +-- src/embed.es2015.js.map | 2 +- src/embed.js | 4430 ++++++++++++++++++++------------------- src/embed.js.map | 2 +- src/js/main.js | 192 +- src/js/modules/url.js | 1 - 8 files changed, 2496 insertions(+), 2482 deletions(-) diff --git a/demo/index.html b/demo/index.html index 093d810..ad0fbdb 100644 --- a/demo/index.html +++ b/demo/index.html @@ -37,25 +37,25 @@

Emojis

Loading embed.js in a block

- - - - - - +
+Lorem ipsum dolor sit amet https://jsfiddle.net/ritz078/n5dL6ogd/4/, consectetur http://1.2.3.4:555/qweqwe?foo=1.5&bar="lalala" adipisicing elit. Itaque consectetur http://whatever.com?x={thisfails} iure culpa reiciendis repudiandae https://españa.com vitae quae temporibus eum fugit, porro accusamus https://github.com/ritz078/embed.js quis quas sapiente, deleniti! Suscipit excepturi ipsa nobis corrupti https://[123:456:abcd::3]:5555/foo. +
+
+#embed.js +Lorem ipsum dolor sit amet, :smile: consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. http://riteshkr.com/embed.js/ Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor **sit amet, consectetur adipisicing** elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos ~~animi beatae~~. Eius, ipsum. Lorem ipsum :+1: dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque ![abcdefg](https://images.unsplash.com/photo-1443527216320-7e744084f5a7?dpr=2&fit=crop&fm=jpg&h=500&ixlib=rb-0.3.5&q=50&w=1450) , incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus https://www.youtube.com/watch?v=bQRLVxZHKPs recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, https://gist.github.com/jeremiahlee/1748966 consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_50mb.mp4 cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur https://twitter.com/IGN/status/652941146054881281 adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, - - - - - - - +```coffeescript +grade = (student, period=(if b? then 7 else 6)) -> + if student.excellentWork + "A+" + else if student.okayStuff + if student.triedHard then "B" else "B-" else "C" +``` - - - - + consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus https://github.com/ritz078/embed.js/issues/82 , voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto https://soundcloud.com/the-bugle/bugle-179-playas-gon-play minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora http://open.spotify.com/track/4th1RQAelzqgY7wL53UGQt doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium https://vine.co/v/bjHh0zHdgZT molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est nobis vero incidunt quod earum totam, corporis voluptatibus https://vimeo.com/119199079 ab voluptate nesciunt consequuntur eligendi natus voluptatem obcaecati quo. Dolor nostrum vel commodi! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia velit ipsam eos facere http://www.dailymotion.com/video/x2k8un2_2015-wc-nz-vs-wi-holder-reacts-on-guptills-237_sport molestias explicabo quia odit dignissimos ipsa iusto enim, harum debitis neque amet, optio voluptatum odio nisi eius. +
+
+Cur rumor nocere?Emeritis adelphis satis perderes domina est.Gloss cadunt in bi-color brema! @(IIT Roorkee) Bi-color habitio virtualiter imitaris amicitia est.Teres tatas ducunt ad racana.Genetrixs prarere in rugensis civitas! :) Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut numquam asperiores nobis repellat modi iusto, possimus excepturi atque, quae doloribus nihil corrupti minima quasi, sed? Vero labore cumque laudantium quisquam! https://www.instagram.com/p/_JHaOcjJ7h/?taken-by=9gag Lorem ipsum dolor sit amet, consectetur adipisicing elit. Similique blanditiis architecto tempore minima vero adipisci reiciendis ratione numquam quas perferendis maxime iste, commodi cumque quis praesentium quasi, a neque temporibus? https://www.instagram.com/p/-mIWFsIVV-/?taken-by=natgeo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto quis vitae cupiditate quam accusamus facere maxime ab distinctio tempore, voluptates itaque culpa amet placeat alias provident corporis, blanditiis explicabo perspiciatis. https://www.flickr.com/photos/43301211@N03/23331635460/in/explore-2015-12-09/ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum quasi sit et nam magni ab asperiores tempore, http://www.slideshare.net/haraldf/business-quotes-for-2011 impedit, tempora officiis rerum modi labore vitae explicabo eos aperiam sequi facilis neque.
@@ -95,17 +95,17 @@

Loading embed.js in a block

}); -// var x = new EmbedJS({ -// input: document.getElementById('block'), -// tweetsEmbed: true -// }); -// x.render().then(function(data) { -// console.log(data); -// }); -// -// x.text(function(data) { -// console.log(data) -// }); + var x = new EmbedJS({ + input: document.getElementById('block'), + tweetsEmbed: true + }); + x.render().then(function(data) { + console.log(data); + }); + + x.text(function(data) { + console.log(data) + }); EmbedJS.applyEmbedJS(".block").then(function(data) { diff --git a/dist/embed.min.js b/dist/embed.min.js index cd655db..7c915a7 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -6,5 +6,5 @@ * Made by Ritesh Kumar * Under MIT License */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,la),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return-1===a.indexOf("//")?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":ma["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return a.replace(oa.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})}function s(a,b){var c=b.customFontIcons.length?b.customFontIcons:pa,d=c.map(function(a){return e(a.text)}),f=new RegExp("(^|\\s)("+d.join("|")+")(?=\\s|$)","gi");return a.replace(f,function(a,f,g){var h=d.indexOf(e(g));if(-1===h)return a;var i=c[h].code;return b.template.smiley(g,f,i,b)})}function t(a,b){var c=b.linkOptions;return a.replace(m(),function(a){if(")"===p(a))return a;var d=p(a.split("."));return"/"===p(a)&&(a=a.slice(0,-1)),-1===c.exclude.indexOf(d)?b.template.url(a,b):a})}function u(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function v(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,u);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return-1===a.options.served.indexOf(c)?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function B(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(-1!==a.options.served.indexOf(c)||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function C(a){return j(a.options,a.service)?A(a):B(a)}function D(a,b,c,d,e,f){var g={input:a,output:b,options:d,embeds:c,regex:e,service:f,template:function(a){return this.options.template[this.service](a,this.options)}};return C(g)}function E(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?D(a,b,c,d,e,f):[b,c]}function F(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function G(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(F(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function H(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function I(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(H(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function J(a,b){return new Promise(function(c){j(a.options,a.service)?G(a,b).then(function(b){return c([b,a.embeds])}):I(a,b).then(function(b){return c([a.output,b])})})}function K(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function L(a,b,c,d){var e=M(a);return d.template.gmap(b,c,e,d)}function M(a){return a.split("(")[1].split(")")[0]}function N(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(oa.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?K(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=ma.slicedToArray(e[k],2),f=a[0],h=a[1],l=L(g[k][0],f,h,c);j(c,i)?b=b.replace(oa.gmap,function(a){return''+M(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(oa.gmap,function(a){return''+M(a)+""}))};for(var k in f)h();a([b,d])})})}function O(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return-1===a.indexOf("</a")?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)}function P(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function Q(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function R(a,b){return'
'+(a.value||a)+"
"}function S(a,b){return a=a.replace(oa.inlineCode,function(a,b,c){return""+c+""}),a.replace(oa.highlightCode,function(a,c,d,e){var f=e;f=Q(f),f=P(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),R(h,g)})}function T(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function U(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function V(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){U(e,a.options).then(function(c){return b(w(T(c),c,f,a.options))})}):new Promise(function(b){return b(u(f,a.options))})}function W(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.youtube,service:"youtube"};return new Promise(function(a){return J(e,V).then(function(b){return a(b)})})}function X(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function Y(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function Z(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){Y(f).then(function(d){return c(w(X(d,b),d,g,a.options))})}):new Promise(function(b){return b(u(g,a.options))})}}function $(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.vimeo,service:"vimeo"};return new Promise(function(a){return J(e,Z).then(function(b){return a(b)})})}function _(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){ra(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function aa(a,b,c){return new Promise(function(b){_(a,c).then(function(c){return b(a.template(c))})})}function ba(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:oa.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return J(e,aa).then(function(b){return a(b)})})}function ca(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function da(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){ca(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function ea(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return J(e,da).then(function(b){return a(b)})})}function fa(a,b){return b.template.github(a,b)}function ga(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function ha(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){ga(e).then(function(c){return b(fa(c,a.options))})})}function ia(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:oa.github};return new Promise(function(a){return J(e,ha).then(function(b){return a(b)})})}function ja(a,b){var c=oa.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})}function ka(a,b){var c=oa.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})}var la="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,ma={};ma["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},ma.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},ma.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n \n
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=-1!==a.indexOf("//")?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},oa={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},pa=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=a.getAllResponseHeaders().trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(-1===q.indexOf(b))throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest;g.onload=function(){var a=1223===g.status?204:g.status;if(100>a||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ta=function(){function a(b,c,d,e){var f=this;ma.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=oa.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return ma.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return C(this)}}]),a}(),ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){ma.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||na,!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return ma.createClass(a,[{key:"process",value:function(){var a=this,b=this.input,c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=t(b,c));var h=c.openGraphEndpoint?ea(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=S(e,c)),c.marked&&(e=O(e,c)),c.emoji&&(e=r(e,c)),c.fontIcons&&(e=s(e,c)),c.mentions&&(e=ja(e,c)),c.hashtag&&(e=ka(e,c));var g=E(b,e,f,c,oa.ideone,"ideone"),h=ma.slicedToArray(g,2);e=h[0],f=h[1];var j=E(b,e,f,c,oa.plunker,"plunker"),k=ma.slicedToArray(j,2);e=k[0],f=k[1];var l=E(b,e,f,c,oa.jsbin,"jsbin"),m=ma.slicedToArray(l,2);e=m[0],f=m[1];var n=E(b,e,f,c,oa.codepen,"codepen"),o=ma.slicedToArray(n,2);e=o[0],f=o[1];var p=E(b,e,f,c,oa.jsfiddle,"jsfiddle"),q=ma.slicedToArray(p,2);e=q[0],f=q[1];var t=E(b,e,f,c,oa.ted,"ted"),u=ma.slicedToArray(t,2);e=u[0],f=u[1];var v=E(b,e,f,c,oa.dailymotion,"dailymotion"),w=ma.slicedToArray(v,2);e=w[0],f=w[1];var x=E(b,e,f,c,oa.ustream,"ustream"),y=ma.slicedToArray(x,2);e=y[0],f=y[1];var z=E(b,e,f,c,oa.liveleak,"liveleak"),A=ma.slicedToArray(z,2);e=A[0],f=A[1];var B=E(b,e,f,c,oa.basicVideo,"video",c.videoEmbed),C=ma.slicedToArray(B,2);e=C[0],f=C[1];var D=E(b,e,f,c,oa.vine,"vine"),F=ma.slicedToArray(D,2);e=F[0],f=F[1];var G=E(b,e,f,c,oa.soundCloud,"soundcloud"),H=ma.slicedToArray(G,2);e=H[0],f=H[1];var I=E(b,e,f,c,oa.spotify,"spotify"),J=ma.slicedToArray(I,2);e=J[0],f=J[1];var K=E(b,e,f,c,oa.basicAudio,"audio",c.audioEmbed),L=ma.slicedToArray(K,2);e=L[0],f=L[1];var M=E(b,e,f,c,oa.flickr,"flickr"),N=ma.slicedToArray(M,2);e=N[0],f=N[1];var P=E(b,e,f,c,oa.instagram,"instagram"),Q=ma.slicedToArray(P,2);e=Q[0],f=Q[1];var R=E(b,e,f,c,oa.basicImage,"image",c.imageEmbed),T=ma.slicedToArray(R,2);if(e=T[0],f=T[1],i(c,"gist")){var U=new ta(b,e,c,f).process(),V=ma.slicedToArray(U,2);e=V[0],f=V[1]}return i(c,"youtube")?W(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?$(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ia(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?N(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=ma.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?ba(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=ma.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new sa(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=ma.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){y(this.options),x(this.options),v(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==ma["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===ma["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==ma["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");z("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?na:arguments[2],e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(q.indexOf(b)===-1)throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest; +g.onload=function(){var a=1223===g.status?204:g.status;if(a<100||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;f n ? '...' : ''); } +/** + * Returns an array after removing the duplicates. + * @param array The array containing the duplicates + * @returns {Array} Array with unique values. + */ + + /** * Converts a string into legitimate url. * @param string @@ -342,7 +349,7 @@ function getEmoji(match) { return match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1) } -function emoji (output, options) { +var emoji = function (output, options) { return output.replace(regex.smileys, function (match) { const emoji = getEmoji(match); if (emoji) { @@ -427,7 +434,7 @@ const defaultIcons = [{ 'code': '' }]; -function smiley (input, options) { +var smiley = function (input, options) { const icons = options.customFontIcons.length ? options.customFontIcons : defaultIcons; const escapedSymbols = icons.map((val) => escapeRegExp(val.text)); @@ -442,10 +449,9 @@ function smiley (input, options) { }); } -function url (input, options) { +var url = function (input, options) { const config = options.linkOptions; return input.replace(urlRegex(), function(match) { - console.log(arguments); if(lastElement(match) === ')') return match; //hack for markdown image let extension = lastElement(match.split('.')); if ((lastElement(match) === '/')) @@ -482,7 +488,8 @@ var fetchJsonp = __commonjs(function (module, exports, global) { return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); } - // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout + // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' + // error if request timeout function clearFunction(functionName) { // IE8 throws an exception when you try to delete a property on window // http://stackoverflow.com/a/1824228/751089 @@ -498,16 +505,19 @@ var fetchJsonp = __commonjs(function (module, exports, global) { document.getElementsByTagName('head')[0].removeChild(script); } - var fetchJsonp = function fetchJsonp(url) { - var options = arguments[1] === undefined ? {} : arguments[1]; + function fetchJsonp(_url) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout; - var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback; + // to avoid param reassign + var url = _url; + var timeout = options.timeout || defaultOptions.timeout; + var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback; var timeoutId = undefined; return new Promise(function (resolve, reject) { var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction(); + var scriptId = jsonpCallback + '_' + callbackFunction; window[callbackFunction] = function (response) { resolve({ @@ -520,7 +530,7 @@ var fetchJsonp = __commonjs(function (module, exports, global) { if (timeoutId) clearTimeout(timeoutId); - removeScript(jsonpCallback + '_' + callbackFunction); + removeScript(scriptId); clearFunction(callbackFunction); }; @@ -529,18 +539,18 @@ var fetchJsonp = __commonjs(function (module, exports, global) { url += url.indexOf('?') === -1 ? '?' : '&'; var jsonpScript = document.createElement('script'); - jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction); - jsonpScript.id = jsonpCallback + '_' + callbackFunction; + jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction); + jsonpScript.id = scriptId; document.getElementsByTagName('head')[0].appendChild(jsonpScript); timeoutId = setTimeout(function () { reject(new Error('JSONP request to ' + url + ' timed out')); clearFunction(callbackFunction); - removeScript(jsonpCallback + '_' + callbackFunction); + removeScript(scriptId); }, timeout); }); - }; + } // export as global function /* @@ -556,7 +566,6 @@ var fetchJsonp = __commonjs(function (module, exports, global) { throw new Error('polyfill failed because global object is unavailable in this environment'); } } - local.fetchJsonp = fetchJsonp; */ @@ -595,7 +604,7 @@ function playVideo(options) { } } -function getDetailsTemplate (data, fullData, embedUrl, options) { +var getDetailsTemplate = function (data, fullData, embedUrl, options) { if (data.host === 'vimeo') { return options.template.detailsVimeo(data, fullData, embedUrl, options) } else if (data.host === 'youtube') { @@ -608,7 +617,7 @@ function getDetailsTemplate (data, fullData, embedUrl, options) { * @param {object} options Options object * @return {null} */ -function applyPlyr (options) { +var applyPlyr = function (options) { if (options.plyr) { if (!options.plugins.plyr) throw new ReferenceError("You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/"); let plyr = options.plugins.plyr; @@ -639,7 +648,7 @@ function applyVideoJS(options) { * @param {className} className * @return {null} */ -function destroyVideos (className) { +var destroyVideos = function (className) { const classes = document.getElementsByClassName(className); for (let i = 0; i < classes.length; i++) { classes[i].onclick = null @@ -683,7 +692,7 @@ function embed(_){ return (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_) } -function base (input, output, embeds, options, regex, service) { +var base = function (input, output, embeds, options, regex, service) { const args = { input, output, @@ -961,7 +970,7 @@ class Twitter { var support = { blob: 'FileReader' in self && 'Blob' in self && (function() { try { - new Blob(); + new Blob() return true } catch(e) { return false @@ -1118,7 +1127,7 @@ class Twitter { function headers(xhr) { var head = new Headers() - var pairs = xhr.getAllResponseHeaders().trim().split('\n') + var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n') pairs.forEach(function(header) { var split = header.trim().split(':') var key = split.shift().trim() @@ -1171,9 +1180,9 @@ class Twitter { return new Response(null, {status: status, headers: {location: url}}) } - self.Headers = Headers; - self.Request = Request; - self.Response = Response; + self.Headers = Headers + self.Request = Request + self.Response = Response self.fetch = function(input, init) { return new Promise(function(resolve, reject) { @@ -1196,7 +1205,7 @@ class Twitter { return xhr.getResponseHeader('X-Request-URL') } - return; + return } xhr.onload = function() { @@ -1211,7 +1220,7 @@ class Twitter { headers: headers(xhr), url: responseURL() } - var body = 'response' in xhr ? xhr.response : xhr.responseText; + var body = 'response' in xhr ? xhr.response : xhr.responseText resolve(new Response(body, options)) } @@ -1219,6 +1228,10 @@ class Twitter { reject(new TypeError('Network request failed')) } + xhr.ontimeout = function() { + reject(new TypeError('Network request failed')) + } + xhr.open(request.method, request.url, true) if (request.credentials === 'include') { @@ -1277,7 +1290,7 @@ function locationText(match) { return match.split('(')[1].split(')')[0] } -function gmap (input, output, options, embeds) { +var gmap = function (input, output, options, embeds) { let match, promises = [], allMatches = []; const service = 'map'; @@ -1313,7 +1326,7 @@ function gmap (input, output, options, embeds) { }) } -function markdown (output, options) { +var markdown = function (output, options) { if (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`); const Marked = options.plugins.marked; @@ -1399,7 +1412,7 @@ function addTemplate(processedCode, language) { * => Replaces the code string in the template with the formatted string * @return {string} The string in which the code is formatted */ -function highlight (output, options) { +var highlight = function (output, options) { output = output.replace(regex.inlineCode, function (match, group1, group2) { return `${group2}` }); @@ -1520,7 +1533,7 @@ function urlToText(args, match, url, normalEmbed) { } } -function youtube (input, output, options, embeds) { +var youtube = function (input, output, options, embeds) { const args = { input, output, @@ -1533,14 +1546,14 @@ function youtube (input, output, options, embeds) { return new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data))) } -function formatData$1(data, truncate) { +function formatData$1(data, truncate$$1) { return { title : data.title, thumbnail : data.thumbnail_medium, rawDescription: data.description.replace(/\n/g, '
').replace(/ /g, '
'), views : data.stats_number_of_plays, likes : data.stats_number_of_likes, - description : truncate(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), + description : truncate$$1(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), url : data.url, id : data.id, host : 'vimeo' @@ -1575,7 +1588,7 @@ function urlToText$1(args, match, url, normalEmbed) { } -function vimeo (input, output, options, embeds) { +var vimeo = function (input, output, options, embeds) { const args = { input, output, @@ -1603,7 +1616,7 @@ function urlToText$2(args, match, url) { }) } -function slideShare (input, output, options, embeds) { +var slideShare = function (input, output, options, embeds) { const args = { input, output, options, embeds, regex: regex.slideShare, @@ -1634,7 +1647,7 @@ function urlToText$3(_, match, url) { }) } -function openGraph (input, output, options, embeds) { +var openGraph = function (input, output, options, embeds) { const args = { input, output, @@ -1686,7 +1699,7 @@ function urlToText$4(_this, match, url, normalEmbed) { }) } -function github (input, output, options, embeds) { +var github = function (input, output, options, embeds) { const args = { input, output, options, embeds, service: 'github', @@ -1696,7 +1709,7 @@ function github (input, output, options, embeds) { return new Promise((resolve) => asyncEmbed(args, urlToText$4).then((data) => resolve(data))) } -function mentions (input, options) { +var mentions = function (input, options) { const mRegex = regex.mentions; return input.replace(mRegex,(match, $1, $2) => { const username = $2.split('@')[1]; @@ -1704,7 +1717,7 @@ function mentions (input, options) { }) } -function hashtag (input, options) { +var hashtag = function (input, options) { const hRegex = regex.hashtag; return input.replace(hRegex,(match, $1, $2)=>{ const username = $2.split('#')[1]; @@ -1712,111 +1725,111 @@ function hashtag (input, options) { }) } -var globalOptions = {}; +let globalOptions = {}; -var defaultOptions = { - marked : false, - markedOptions : {}, - link : true, - linkOptions : { - target : 'self', +const defaultOptions = { + marked: false, + markedOptions: {}, + link: true, + linkOptions: { + target: 'self', exclude: ['pdf'], - rel : '' + rel: '' }, - emoji : true, - customEmoji : [], - fontIcons : true, - customFontIcons : [], - highlightCode : false, - mentions : false, - hashtag : false, - videoJS : false, - videojsOptions : { - fluid : true, + emoji: true, + customEmoji: [], + fontIcons: true, + customFontIcons: [], + highlightCode: false, + mentions: false, + hashtag: false, + videoJS: false, + videojsOptions: { + fluid: true, preload: 'metadata' }, - plyr : false, - plyrOptions : {}, - locationEmbed : true, - mapOptions : { + plyr: false, + plyrOptions: {}, + locationEmbed: true, + mapOptions: { mode: 'place' }, - tweetsEmbed : false, - tweetOptions : { - maxWidth : 550, - hideMedia : false, + tweetsEmbed: false, + tweetOptions: { + maxWidth: 550, + hideMedia: false, hideThread: false, - align : 'none', - lang : 'en' + align: 'none', + lang: 'en' }, - singleEmbed : false, - openGraphEndpoint : null, - openGraphExclude : [], - videoEmbed : true, - videoHeight : null, - videoWidth : null, - videoDetails : true, - audioEmbed : true, - imageEmbed : true, - excludeEmbed : [], - inlineEmbed : [], - inlineText : true, - codeEmbedHeight : 500, - vineOptions : { - maxWidth : null, - type : 'postcard', //'postcard' or 'simple' embedding + singleEmbed: false, + openGraphEndpoint: null, + openGraphExclude: [], + videoEmbed: true, + videoHeight: null, + videoWidth: null, + videoDetails: true, + audioEmbed: true, + imageEmbed: true, + excludeEmbed: [], + inlineEmbed: [], + inlineText: true, + codeEmbedHeight: 500, + vineOptions: { + maxWidth: null, + type: 'postcard', //'postcard' or 'simple' embedding responsive: true, - width : 350, - height : 460 + width: 350, + height: 460 }, - plugins : { - marked : window.marked, - videojs : window.videojs, - plyr : window.plyr, + plugins: { + marked: window.marked, + videojs: window.videojs, + plyr: window.plyr, highlightjs: window.hljs, - prismjs : window.Prism, - twitter : window.twttr + prismjs: window.Prism, + twitter: window.twttr }, - googleAuthKey : '', - soundCloudOptions : { - height : 160, - themeColor : 'f50000', //Hex Code of the player theme color - autoPlay : false, - hideRelated : false, + googleAuthKey: '', + soundCloudOptions: { + height: 160, + themeColor: 'f50000', //Hex Code of the player theme color + autoPlay: false, + hideRelated: false, showComments: true, - showUser : true, - showReposts : false, - visual : false, //Show/hide the big preview image - download : false //Show/Hide download buttons + showUser: true, + showReposts: false, + visual: false, //Show/hide the big preview image + download: false //Show/Hide download buttons }, - videoClickClass : 'ejs-video-thumb', + videoClickClass: 'ejs-video-thumb', customVideoClickHandler: false, - mentionsUrl : function () { + mentionsUrl: function () { }, - hashtagUrl : function () { + hashtagUrl: function () { }, - beforeEmbedJSApply : function () { + beforeEmbedJSApply: function () { }, - afterEmbedJSApply : function () { + afterEmbedJSApply: function () { }, - onVideoShow : function () { + onVideoShow: function () { }, - onTweetsLoad : function () { + onTweetsLoad: function () { }, - videojsCallback : function () { + videojsCallback: function () { }, - onOpenGraphFetch : function () { + onOpenGraphFetch: function () { }, - onOpenGraphFail : function () { + onOpenGraphFail: function () { }, - videoClickHandler : function () { + videoClickHandler: function () { }, - served : [] //Private variable used to store processed urls so that they are not processed multiple times. + served: [] //Private variable used to store processed urls so that they are not processed multiple times. }; -let instances = []; +let instances = []; let allInstances = []; -let promises = []; +let promises = []; class EmbedJS { /** @@ -1829,12 +1842,12 @@ class EmbedJS { * @param template * @return {null} */ - constructor(options, template) { + constructor(options, template$$1) { /** * We have created a clone of the original options to make sure that the original object * isn't altered. */ - let defOpts = cloneObject(defaultOptions); + let defOpts = cloneObject(defaultOptions); let globOpts = cloneObject(globalOptions); //merge global options with the default options @@ -1844,9 +1857,9 @@ class EmbedJS { //object while creating a new instance of embed.js this.options = deepExtend(globOptions, options); - this.options.template = template || renderer; + this.options.template = template$$1 || renderer; - if (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); + if (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); this.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input @@ -1858,10 +1871,13 @@ class EmbedJS { * @return {Promise} The processes resulting string */ process() { - const input = this.input; + const input = this.input; + + if (input === '') return Promise.resolve(''); + const options = processOptions(this.options); - let embeds = []; - let output = input; + let embeds = []; + let output = input; this.options.beforeEmbedJSApply(); @@ -1931,19 +1947,12 @@ class EmbedJS { } }).then(([output, embeds]) => { this.data = { - input : options.input, - output : output, - options : options, + input: options.input, + output, + options, inputString: this.input, - /** - - TODO: - - Restructure served urls structure with services name - - */ - - services : options.served, - template : options.template + services: options.served, + template: options.template }; resolve(createText(output, embeds)) @@ -1998,13 +2007,13 @@ class EmbedJS { * @param options New updated options object. will be extended with the older options * @param template [optional] the new template instance */ - update(options, template) { + update(options, template$$1) { if (options) this.options = deepExtend(this.options, options); - if (template) - this.options.template = template; + if (template$$1) + this.options.template = template$$1; if (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); @@ -2016,7 +2025,7 @@ class EmbedJS { * @return Promise */ text(callback) { - this.process().then((data)=> callback(data, this.input)) + this.process().then((data) => callback(data, this.input)) } /** @@ -2047,12 +2056,12 @@ class EmbedJS { * @param options * @param template */ - static applyEmbedJS(selectorName, options = {}, template = renderer) { + static applyEmbedJS(selectorName, options = {}, template$$1 = renderer) { let elements = document.querySelectorAll(selectorName); for (let i = 0; i < elements.length; i++) { options.input = elements[i]; - instances[i] = new EmbedJS(options, template); - promises[i] = instances[i].render() + instances[i] = new EmbedJS(options, template$$1); + promises[i] = instances[i].render() } return new Promise(function (resolve) { Promise.all(promises).then(function (val) { @@ -2109,4 +2118,4 @@ class EmbedJS { } export default EmbedJS; -//# sourceMappingURL=embed.es2015.js.map \ No newline at end of file +//# sourceMappingURL=embed.es2015.js.map diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map index 5ad951d..1ae2956 100644 --- a/src/embed.es2015.js.map +++ b/src/embed.es2015.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tconsole.log(arguments);\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n var fetchJsonp = function fetchJsonp(url) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(jsonpCallback + '_' + callbackFunction);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = jsonpCallback + '_' + callbackFunction;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(jsonpCallback + '_' + callbackFunction);\n }, timeout);\n });\n };\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n \n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers'\n\nvar globalOptions = {};\n\nvar defaultOptions = {\n\tmarked : false,\n\tmarkedOptions : {},\n\tlink : true,\n\tlinkOptions : {\n\t\ttarget : 'self',\n\t\texclude: ['pdf'],\n\t\trel : ''\n\t},\n\temoji : true,\n\tcustomEmoji : [],\n\tfontIcons : true,\n\tcustomFontIcons : [],\n\thighlightCode : false,\n\tmentions : false,\n\thashtag : false,\n\tvideoJS : false,\n\tvideojsOptions : {\n\t\tfluid : true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr : false,\n\tplyrOptions : {},\n\tlocationEmbed : true,\n\tmapOptions : {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed : false,\n\ttweetOptions : {\n\t\tmaxWidth : 550,\n\t\thideMedia : false,\n\t\thideThread: false,\n\t\talign : 'none',\n\t\tlang : 'en'\n\t},\n\tsingleEmbed : false,\n\topenGraphEndpoint : null,\n\topenGraphExclude : [],\n\tvideoEmbed : true,\n\tvideoHeight : null,\n\tvideoWidth : null,\n\tvideoDetails : true,\n\taudioEmbed : true,\n\timageEmbed : true,\n\texcludeEmbed : [],\n\tinlineEmbed : [],\n\tinlineText : true,\n\tcodeEmbedHeight : 500,\n\tvineOptions : {\n\t\tmaxWidth : null,\n\t\ttype : 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth : 350,\n\t\theight : 460\n\t},\n\tplugins : {\n\t\tmarked : window.marked,\n\t\tvideojs : window.videojs,\n\t\tplyr : window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs : window.Prism,\n\t\ttwitter : window.twttr\n\t},\n\tgoogleAuthKey : '',\n\tsoundCloudOptions : {\n\t\theight : 160,\n\t\tthemeColor : 'f50000', //Hex Code of the player theme color\n\t\tautoPlay : false,\n\t\thideRelated : false,\n\t\tshowComments: true,\n\t\tshowUser : true,\n\t\tshowReposts : false,\n\t\tvisual : false, //Show/hide the big preview image\n\t\tdownload : false //Show/Hide download buttons\n\t},\n\tvideoClickClass : 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl : function () {\n\t},\n\thashtagUrl : function () {\n\t},\n\tbeforeEmbedJSApply : function () {\n\t},\n\tafterEmbedJSApply : function () {\n\t},\n\tonVideoShow : function () {\n\t},\n\tonTweetsLoad : function () {\n\t},\n\tvideojsCallback : function () {\n\t},\n\tonOpenGraphFetch : function () {\n\t},\n\tonOpenGraphFail : function () {\n\t},\n\tvideoClickHandler : function () {\n\t},\n\tserved : [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput : options.input,\n\t\t\t\t\toutput : output,\n\t\t\t\t\toptions : options,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\t/**\n\n\t\t\t\t\t TODO:\n\t\t\t\t\t - Restructure served urls structure with services name\n\n\t\t\t\t\t */\n\n\t\t\t\t\tservices : options.served,\n\t\t\t\t\ttemplate : options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data)=> callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;AAED,AAkBA;;;;AAIA,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;SACvD,MAAM;YACH,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC5C;KACJ;IACD,OAAO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AC;GAC5B,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;GAC/C,QAAQ,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;GACrC;EACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE;GACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;SACvD,MAAM;YACH,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC5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C,OAAO,EAAEA,WAAQ,CAAC,CAAC;GAC9C,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;GACnC;EACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE;GACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js index 4777833..6aaf8d9 100644 --- a/src/embed.js +++ b/src/embed.js @@ -11,2394 +11,2404 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.EmbedJS = factory()); -}(this, function () { 'use strict'; - - var __commonjs_global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; - function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports, __commonjs_global), module.exports; } - - - var babelHelpers = {}; - babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; - }; - - babelHelpers.classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - }; - - babelHelpers.createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } +}(this, (function () { 'use strict'; + +var __commonjs_global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; +function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports, __commonjs_global), module.exports; } + + +var babelHelpers = {}; +babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + +babelHelpers.classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +babelHelpers.createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +babelHelpers.slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - - babelHelpers.slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; - }(); - - babelHelpers; - - /** - * Trucates the string and adds ellipsis at the end. - * @param string The string to be truncated - * @param n Length to which it should be truncated - * @returns {string} The truncated string - */ - function truncate(string, n) { - return string.substr(0, n - 1) + (string.length > n ? '...' : ''); } - /** - * Converts a string into legitimate url. - * @param string - */ - function toUrl(string) { - return string.indexOf('//') === -1 ? '//' + string : string; - } + return _arr; + } - /** - * Extends an Object - * @param destination - * @param source - * @returns {*} - */ - function deepExtend(destination, source) { - for (var property in source) { - if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) { - destination[property] = destination[property] || {}; - deepExtend(destination[property], source[property]); - } else { - destination[property] = source[property]; - } - } - return destination; + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + }; +}(); - function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); - } - - /** - * Sort an array of objects based on the index value - * @param {Array} arr Array to be sorted - * @return {Array} Sorted array - */ - function sortObject(arr) { - return arr.sort(function (a, b) { - return a.index - b.index; - }); - } - - /** - * Creates the string of the iframes after sorting them and finally returning a string - * @param {string} str String to which the created text has to be added - * @param {object} embeds Sorted array of iframe html - * @return {string} String to be rendered - */ - function createText(str, embeds) { - var sortedEmbeds = sortObject(embeds); - for (var i = 0; i < sortedEmbeds.length; i++) { - str += ' ' + sortedEmbeds[i].text; - } - return str; - } +babelHelpers; - /** - * Matches the string and finds the substrings matching to the provided regex pattern - * @param {object} regex Regex pattern - * @param {string} input The string to be analyzed - * @return {object} Returns the matched substring with their corresponding positions - */ - function matches(regex, input) { - return regex.exec(input); - } - - /** - * Checks whether a particular service should be embedded or not based on - * the setting provided by the user - * @param {object} options The options provided by the user - * @param {string} service Name of the service for which the condition is to be analyzed - * @return {boolean} True if it should be embedded - */ - function ifEmbed(options, service) { - if (options.singleEmbed && options.served.length) return; - return options.excludeEmbed.indexOf(service) == -1 && !(options.excludeEmbed === 'all'); - } - - function ifInline(options, service) { - return options.inlineEmbed.indexOf(service) >= 0 || options.inlineEmbed === 'all'; - } +/** + * Trucates the string and adds ellipsis at the end. + * @param string The string to be truncated + * @param n Length to which it should be truncated + * @returns {string} The truncated string + */ +function truncate(string, n) { + return string.substr(0, n - 1) + (string.length > n ? '...' : ''); +} + +/** + * Returns an array after removing the duplicates. + * @param array The array containing the duplicates + * @returns {Array} Array with unique values. + */ - /** - * Calculates the dimensions for the elements based on a aspect ratio - * @param {object} options Plugin options - * @return {object} The width and height of the elements - */ - function setDimensions(options) { - options.videoWidth = options.videoWidth || options.videoHeight / 3 * 4 || 800; - options.videoHeight = options.videoHeight || options.videoWidth / 4 * 3 || 600; - return options; - } - /** - * Returns a cloned object - * @param {object} obj - * @return {object} cloned object - */ - function cloneObject(obj) { - if (obj === null || (typeof obj === 'undefined' ? 'undefined' : babelHelpers.typeof(obj)) !== 'object') return obj; - var temp = obj.constructor(); // give temp the original obj's constructor - for (var key in obj) { - temp[key] = cloneObject(obj[key]); +/** + * Converts a string into legitimate url. + * @param string + */ +function toUrl(string) { + return string.indexOf('//') === -1 ? '//' + string : string; +} + +/** + * Extends an Object + * @param destination + * @param source + * @returns {*} + */ +function deepExtend(destination, source) { + for (var property in source) { + if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) { + destination[property] = destination[property] || {}; + deepExtend(destination[property], source[property]); + } else { + destination[property] = source[property]; } - return temp; } + return destination; +} - function urlRegex() { - return (/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi - ); - } +function escapeRegExp(str) { + return str.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); +} - function arrayLowercase(options, property) { - if (typeof options[property] !== 'string') { - options[property] = options[property].map(function (elem) { - return elem.toLowerCase(); - }); - } - return options; - } +/** + * Sort an array of objects based on the index value + * @param {Array} arr Array to be sorted + * @return {Array} Sorted array + */ +function sortObject(arr) { + return arr.sort(function (a, b) { + return a.index - b.index; + }); +} - /** - * Sets the dimensions and converts options values' Array into lowercase. - * @param options - * @returns {Object|*} - */ - function processOptions(options) { - options = setDimensions(options); - options = arrayLowercase(options, 'excludeEmbed'); - options = arrayLowercase(options, 'inlineEmbed'); - return arrayLowercase(options, 'openGraphExclude'); +/** + * Creates the string of the iframes after sorting them and finally returning a string + * @param {string} str String to which the created text has to be added + * @param {object} embeds Sorted array of iframe html + * @return {string} String to be rendered + */ +function createText(str, embeds) { + var sortedEmbeds = sortObject(embeds); + for (var i = 0; i < sortedEmbeds.length; i++) { + str += ' ' + sortedEmbeds[i].text; + } + return str; +} + +/** + * Matches the string and finds the substrings matching to the provided regex pattern + * @param {object} regex Regex pattern + * @param {string} input The string to be analyzed + * @return {object} Returns the matched substring with their corresponding positions + */ +function matches(regex, input) { + return regex.exec(input); +} + +/** + * Checks whether a particular service should be embedded or not based on + * the setting provided by the user + * @param {object} options The options provided by the user + * @param {string} service Name of the service for which the condition is to be analyzed + * @return {boolean} True if it should be embedded + */ +function ifEmbed(options, service) { + if (options.singleEmbed && options.served.length) return; + return options.excludeEmbed.indexOf(service) == -1 && !(options.excludeEmbed === 'all'); +} + +function ifInline(options, service) { + return options.inlineEmbed.indexOf(service) >= 0 || options.inlineEmbed === 'all'; +} + +/** + * Calculates the dimensions for the elements based on a aspect ratio + * @param {object} options Plugin options + * @return {object} The width and height of the elements + */ +function setDimensions(options) { + options.videoWidth = options.videoWidth || options.videoHeight / 3 * 4 || 800; + options.videoHeight = options.videoHeight || options.videoWidth / 4 * 3 || 600; + return options; +} + +/** + * Returns a cloned object + * @param {object} obj + * @return {object} cloned object + */ +function cloneObject(obj) { + if (obj === null || (typeof obj === 'undefined' ? 'undefined' : babelHelpers.typeof(obj)) !== 'object') return obj; + var temp = obj.constructor(); // give temp the original obj's constructor + for (var key in obj) { + temp[key] = cloneObject(obj[key]); + } + return temp; +} + +function urlRegex() { + return (/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi + ); +} + +function arrayLowercase(options, property) { + if (typeof options[property] !== 'string') { + options[property] = options[property].map(function (elem) { + return elem.toLowerCase(); + }); } + return options; +} - /** - * Get the last element of an array or string - * @param elem [String|Array] - * @returns last element of the Array or String - */ - function lastElement(elem) { - return elem[elem.length - 1]; +/** + * Sets the dimensions and converts options values' Array into lowercase. + * @param options + * @returns {Object|*} + */ +function processOptions(options) { + options = setDimensions(options); + options = arrayLowercase(options, 'excludeEmbed'); + options = arrayLowercase(options, 'inlineEmbed'); + return arrayLowercase(options, 'openGraphExclude'); +} + +/** + * Get the last element of an array or string + * @param elem [String|Array] + * @returns last element of the Array or String + */ +function lastElement(elem) { + return elem[elem.length - 1]; +} + +var renderer = { + url: function url(match, options) { + var config = options.linkOptions; + return '' + match + ''; + }, + smiley: function smiley(text, pre, code) { + return '' + pre + code + ''; + }, + emoji: function emoji(text) { + return ''; + }, + audio: function audio(match) { + return '
'; + }, + soundcloud: function soundcloud(match, options) { + var config = options.soundCloudOptions; + return '
\n\t\t\n\t\t
'; + }, + spotify: function spotify(match) { + var id = lastElement(match.split('/')); + return '
'; + }, + codepen: function codepen(id, options) { + return '
'; + }, + ideone: function ideone(match, options) { + return '
'; + }, + jsbin: function jsbin(id, options) { + return '
'; + }, + jsfiddle: function jsfiddle(id, options) { + id = lastElement(id) == '/' ? id.slice(0, -1) : id; + id = id.indexOf('//') !== -1 ? id : '//' + id; + return '
'; + }, + plunker: function plunker(id, options) { + return '
'; + }, + image: function image(match) { + return '
'; + }, + flickr: function flickr(match, options) { + return '
'; + }, + instagram: function instagram(match, options) { + return '
'; + }, + slideShare: function slideShare(html) { + return '
' + html + '
'; + }, + video: function video(match) { + return '
'; + }, + dailymotion: function dailymotion(match, options) { + var id = lastElement(match.split('/')); + return '
'; + }, + liveleak: function liveleak(match, options) { + return '
'; + }, + ted: function ted(match, options) { + var a = match.split('/'); + var id = a[a.length - 1]; + return '
'; + }, + ustream: function ustream(match, options) { + var id = match.split('/'); + id.splice(1, 0, 'embed'); + return '
'; + }, + detailsVimeo: function detailsVimeo(data, fullData, embedUrl) { + return '
' + data.description + '
' + data.views + '' + data.likes + '
'; + }, + detailsYoutube: function detailsYoutube(data, fullData, embedUrl) { + return '
' + data.description + '
' + data.views + '' + data.likes + '
'; + }, + vine: function vine(match, options) { + var id = lastElement(match.split('/')); + var config = options.vineOptions; + return '
'; + }, + vimeo: function vimeo(url, options) { + return options.plyr ? '
' : '
'; + }, + youtube: function youtube(url, options) { + return options.plyr ? '
' : '
'; + }, + openGraph: function openGraph(data, options) { + return '
' + data.description + '
'; + }, + github: function github(data, options) { + return '
' + data.description + '
' + data.stargazers_count + '' + data.network_count + '
'; + }, + gmap: function gmap(latitude, longitude, location, options) { + var config = options.mapOptions; + if (config.mode === 'place') { + return '
'; + } else if (config.mode === 'streetview') { + return '
'; + } else if (config.mode === 'view') { + return '
'; + } + } +}; + +var regex = { + mentions: /(^|\s)(@[a-z0-9_-]+)/gi, + hashtag: /(^|\s)(#[a-z\d-]+)/gi, + basicAudio: /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, + soundCloud: /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, + spotify: /spotify.com\/track\/[a-zA-Z0-9_]+/gi, + codepen: /http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi, + gist: /gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi, + highlightCode: /(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, + inlineCode: /(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, + ideone: /ideone.com\/[a-zA-Z0-9]{6}/gi, + jsbin: /jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi, + jsfiddle: /jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi, + plunker: /plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi, + basicImage: /((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi, + flickr: /flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi, + instagram: /instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi, + slideShare: /slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi, + github: /[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi, + basicVideo: /(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi, + dailymotion: /dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi, + liveleak: /liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi, + ted: /ted.com\/talks\/[a-zA-Z0-9_]+/gi, + ustream: /ustream.tv\/[a-z\/0-9]*/gi, + vimeo: /https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi, + vine: /vine.co\/v\/[a-zA-Z0-9]+/gi, + youtube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi, + gmap: /@\((.+)\)/gi, + twitter: /https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi, + smileys: /(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi +}; + +function getEmoji(match) { + return match[0] === ':' && lastElement(match) === ':' && match.substring(1, match.length - 1); +} + +var emoji$1 = function (output, options) { + return output.replace(regex.smileys, function (match) { + var emoji = getEmoji(match); + if (emoji) { + return options.template.emoji(emoji, options); + } + return match; + }); +} + +var defaultIcons = [{ + 'text': ':)', + 'code': '' +}, { + 'text': ':D', + 'code': '' +}, { + 'text': ':d', + 'code': '' +}, { + 'text': ':(', + 'code': '' +}, { + 'text': ':/', + 'code': '' + +}, { + 'text': ':P', + 'code': '' +}, { + 'text': ':p', + 'code': '' +}, { + 'text': '3:)', + 'code': '' +}, { + 'text': '(^)', + 'code': '' +}, { + 'text': ';)', + 'code': '' +}, { + 'text': ':o', + 'code': '' +}, { + 'text': ':O', + 'code': '' +}, { + 'text': '-_-', + 'code': '' +}, { + 'text': '(y)', + 'code': '' +}, { + 'text': ':*', + 'code': '' +}, { + 'text': '<3', + 'code': '' +}, { + 'text': '<3', + 'code': '' +}, { + 'text': '</3', + 'code': '' +}, { + 'text': '' + match + ''; - }, - smiley: function smiley(text, pre, code) { - return '' + pre + code + ''; - }, - emoji: function emoji(text) { - return ''; - }, - audio: function audio(match) { - return '
'; - }, - soundcloud: function soundcloud(match, options) { - var config = options.soundCloudOptions; - return '
\n\t\t\n\t\t
'; - }, - spotify: function spotify(match) { - var id = lastElement(match.split('/')); - return '
'; - }, - codepen: function codepen(id, options) { - return '
'; - }, - ideone: function ideone(match, options) { - return '
'; - }, - jsbin: function jsbin(id, options) { - return '
'; - }, - jsfiddle: function jsfiddle(id, options) { - id = lastElement(id) == '/' ? id.slice(0, -1) : id; - id = id.indexOf('//') !== -1 ? id : '//' + id; - return '
'; - }, - plunker: function plunker(id, options) { - return '
'; - }, - image: function image(match) { - return '
'; - }, - flickr: function flickr(match, options) { - return '
'; - }, - instagram: function instagram(match, options) { - return '
'; - }, - slideShare: function slideShare(html) { - return '
' + html + '
'; - }, - video: function video(match) { - return '
'; - }, - dailymotion: function dailymotion(match, options) { - var id = lastElement(match.split('/')); - return '
'; - }, - liveleak: function liveleak(match, options) { - return '
'; - }, - ted: function ted(match, options) { - var a = match.split('/'); - var id = a[a.length - 1]; - return '
'; - }, - ustream: function ustream(match, options) { - var id = match.split('/'); - id.splice(1, 0, 'embed'); - return '
'; - }, - detailsVimeo: function detailsVimeo(data, fullData, embedUrl) { - return '
' + data.description + '
' + data.views + '' + data.likes + '
'; - }, - detailsYoutube: function detailsYoutube(data, fullData, embedUrl) { - return '
' + data.description + '
' + data.views + '' + data.likes + '
'; - }, - vine: function vine(match, options) { - var id = lastElement(match.split('/')); - var config = options.vineOptions; - return '
'; - }, - vimeo: function vimeo(url, options) { - return options.plyr ? '
' : '
'; - }, - youtube: function youtube(url, options) { - return options.plyr ? '
' : '
'; - }, - openGraph: function openGraph(data, options) { - return '
' + data.description + '
'; - }, - github: function github(data, options) { - return '
' + data.description + '
' + data.stargazers_count + '' + data.network_count + '
'; - }, - gmap: function gmap(latitude, longitude, location, options) { - var config = options.mapOptions; - if (config.mode === 'place') { - return '
'; - } else if (config.mode === 'streetview') { - return '
'; - } else if (config.mode === 'view') { - return '
'; - } - } - }; - - var regex = { - mentions: /(^|\s)(@[a-z0-9_-]+)/gi, - hashtag: /(^|\s)(#[a-z\d-]+)/gi, - basicAudio: /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, - soundCloud: /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, - spotify: /spotify.com\/track\/[a-zA-Z0-9_]+/gi, - codepen: /http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi, - gist: /gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi, - highlightCode: /(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - inlineCode: /(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - ideone: /ideone.com\/[a-zA-Z0-9]{6}/gi, - jsbin: /jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi, - jsfiddle: /jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi, - plunker: /plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi, - basicImage: /((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi, - flickr: /flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi, - instagram: /instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi, - slideShare: /slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi, - github: /[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi, - basicVideo: /(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi, - dailymotion: /dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi, - liveleak: /liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi, - ted: /ted.com\/talks\/[a-zA-Z0-9_]+/gi, - ustream: /ustream.tv\/[a-z\/0-9]*/gi, - vimeo: /https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi, - vine: /vine.co\/v\/[a-zA-Z0-9]+/gi, - youtube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi, - gmap: /@\((.+)\)/gi, - twitter: /https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi, - smileys: /(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi + var defaultOptions = { + timeout: 5000, + jsonpCallback: 'callback', + jsonpCallbackFunction: null }; - function getEmoji(match) { - return match[0] === ':' && lastElement(match) === ':' && match.substring(1, match.length - 1); + function generateCallbackFunction() { + return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); } - function emoji (output, options) { - return output.replace(regex.smileys, function (match) { - var emoji = getEmoji(match); - if (emoji) { - return options.template.emoji(emoji, options); - } - return match; - }); - } - - var defaultIcons = [{ - 'text': ':)', - 'code': '' - }, { - 'text': ':D', - 'code': '' - }, { - 'text': ':d', - 'code': '' - }, { - 'text': ':(', - 'code': '' - }, { - 'text': ':/', - 'code': '' - - }, { - 'text': ':P', - 'code': '' - }, { - 'text': ':p', - 'code': '' - }, { - 'text': '3:)', - 'code': '' - }, { - 'text': '(^)', - 'code': '' - }, { - 'text': ';)', - 'code': '' - }, { - 'text': ':o', - 'code': '' - }, { - 'text': ':O', - 'code': '' - }, { - 'text': '-_-', - 'code': '' - }, { - 'text': '(y)', - 'code': '' - }, { - 'text': ':*', - 'code': '' - }, { - 'text': '<3', - 'code': '' - }, { - 'text': '<3', - 'code': '' - }, { - 'text': '</3', - 'code': '' - }, { - 'text': ']*' + _.regex.source + ')', 'gm') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gm'); - _.output = _.output.replace(regexInline, function (match) { - var url = _.options.link ? match.slice(0, -4) : match; - if (_.options.served.indexOf(url) === -1) { - _.options.served.push(url); - if (_.options.link) { - return !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4)); - } else { - return !_.options.inlineText ? _.template(match) : match + _.template(match); - } - } else { - return match; //TODO : check whether this should be `match` - } - }); - return [_.output, _.embeds]; - } + module.exports = fetchJsonp; + }); +}); - function normalEmbed(_) { - var match = void 0; - while ((match = matches(_.regex, _.input)) !== null) { - var url = match[0]; - if (!(_.options.served.indexOf(url) === -1) || _.options.served.length && _.options.singleEmbed) continue; - _.options.served.push(url); - var text = _.template(url); - _.embeds.push({ - text: text, - index: match.index - }); - } - return [_.output, _.embeds]; - } - - function embed(_) { - return ifInline(_.options, _.service) ? inlineEmbed(_) : normalEmbed(_); - } - - function base (input, output, embeds, options, regex, service) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex, - service: service, - template: function template(match) { - return this.options.template[this.service](match, this.options); - } - }; - - return embed(args); - } - - function baseEmbed(input, output, embeds, options, regex, service, flag) { - return ifEmbed(options, service) || ifEmbed(options, service) && flag ? base(input, output, embeds, options, regex, service) : [output, embeds]; - } - - /** - * This is a private function which is used to get the actual text to be replaced for - * a particular url in inline embedding. This returns a promise - * @param {object} _ reference to this - * @param {function} urlToText The function that converts url to replaceable text - * @param {object} match object containing info of matching string - * @return {Promise} resolves to the text - */ - function getInlineData(_, urlToText, match) { - var url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1]; - if (_.options.served.indexOf(url) >= 0) return Promise.resolve(null); - - return new Promise(function (resolve) { - urlToText(_, match, url).then(function (text) { - if (!text) return resolve(); - _.options.served.push(url); - resolve(text); - }); - }); - } - - /** - * A helper function for inline embedding - * @param _ - * @param urlToText - * @returns Promise - */ - function inlineAsyncEmbed(_, urlToText) { - var regexInline = _.options.link ? new RegExp('([^>]*' + _.regex.source + ')', 'gi') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gi'); - var match = void 0, - promises = []; - - while ((match = matches(regexInline, _.output)) !== null) { - promises.push(getInlineData(_, urlToText, match)); - }return new Promise(function (resolve) { - if (matches.length) Promise.all(promises).then(function (data) { - var i = 0; - _.output = _.output.replace(regexInline, function (match) { - if (_.options.link) return !_.options.inlineText ? data[i] + '' : match + data[i++];else return !_.options.inlineText ? data[i] : match + data[i++]; - }); - resolve(_.output); - });else resolve(_.output); - }); - } - - function getNormalData(_, urlToText, match) { - var url = match[0]; - if (_.options.served.indexOf(url) >= 0) return; - - return new Promise(function (resolve) { - urlToText(_, match, url, true).then(function (text) { - if (!text) resolve(); - _.options.served.push(url); - _.embeds.push({ - text: text, - index: match.index - }); - resolve(); - }); - }); - } - - /** - * A helper function for normal embedding - * @param {object} _ - * @param {function} urlToText - * @return {Promise} - */ - function normalAsyncEmbed(_, urlToText) { - var match = void 0, - promises = []; - while ((match = matches(_.regex, _.input)) !== null) { - promises.push(getNormalData(_, urlToText, match)); - }return new Promise(function (resolve) { - Promise.all(promises).then(function () { - resolve(_.embeds); - }); - }); - } +var fetchJsonp$1 = fetchJsonp && (typeof fetchJsonp === 'undefined' ? 'undefined' : babelHelpers.typeof(fetchJsonp)) === 'object' && 'default' in fetchJsonp ? fetchJsonp['default'] : fetchJsonp; - function asyncEmbed(_, urlToText) { - return new Promise(function (resolve) { - if (ifInline(_.options, _.service)) inlineAsyncEmbed(_, urlToText).then(function (output) { - return resolve([output, _.embeds]); - });else normalAsyncEmbed(_, urlToText).then(function (embeds) { - return resolve([_.output, embeds]); - }); - }); - } - - var Twitter = function () { - function Twitter(input, output, options, embeds) { - babelHelpers.classCallCheck(this, Twitter); - - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.twitter; - this.service = 'twitter'; - - this.load = this.load.bind(this); - if (typeof this.options.input !== 'string') { - this.options.input.addEventListener('rendered', this.load, false); - } - } - - /** - * Fetches the data from twitter's oEmbed API - * @param {string} url URL of the tweet - * @return {object} data containing the tweet info - */ - - - babelHelpers.createClass(Twitter, [{ - key: 'tweetData', - value: function tweetData(url) { - var config = this.options.tweetOptions; - var apiUrl = 'https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=' + url + '&maxwidth=' + config.maxWidth + '&hide_media=' + config.hideMedia + '&hide_thread=' + config.hideThread + '&align=' + config.align + '&lang=' + config.lang; - return new Promise(function (resolve) { - fetchJsonp$1(apiUrl, { credentials: 'include' }).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json); - }); - }); - } - - /** - * Load twitter widgets - * @return null - */ - - }, { - key: 'load', - value: function load() { - var twitter = this.options.plugins.twitter; - twitter.widgets.load(this.options.element); //here this refers to the element - - //Execute the function after the widget is loaded - twitter.events.bind('loaded', this.options.onTweetsLoad); - } - }, { - key: 'process', - value: function process() { - var _this2 = this; - - return new Promise(function (resolve) { - return asyncEmbed(_this2, Twitter.urlToText).then(function (data) { - return resolve(data); - }); - }); - } - }], [{ - key: 'urlToText', - value: function urlToText(_this, match, url) { - return new Promise(function (resolve) { - return _this.tweetData(url).then(function (data) { - return resolve(data.html); - }); - }); - } - }]); - return Twitter; - }(); - - (function (self) { - 'use strict'; - - if (self.fetch) { - return; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name'); - } - return name.toLowerCase(); - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value; - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function (value, name) { - this.append(name, value); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function (name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function (name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var list = this.map[name]; - if (!list) { - list = []; - this.map[name] = list; - } - list.push(value); - }; - - Headers.prototype['delete'] = function (name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function (name) { - var values = this.map[normalizeName(name)]; - return values ? values[0] : null; - }; - - Headers.prototype.getAll = function (name) { - return this.map[normalizeName(name)] || []; - }; - - Headers.prototype.has = function (name) { - return this.map.hasOwnProperty(normalizeName(name)); +/** + * Common template for vimeo and youtube iframes + * @param {string} url URL of the embedding video + * @param {object} options Options object + * @return {string} compiled template with variables replaced + */ +function template$1(url, options) { + return options.template.vimeo(url, options) || options.template.youtube(url, options); +} + +/** + * Plays the video after clicking on the thumbnail + * @param {object} options Options object + * @return {null} + */ +function playVideo(options) { + /** Execute the customVideoClickHandler if the user wants to handle it on his own. */ + if (options.customVideoClickHandler) return options.videoClickHandler(options, template$1); + + var classes = document.getElementsByClassName(options.videoClickClass); + for (var i = 0; i < classes.length; i++) { + classes[i].onclick = function () { + options.onVideoShow(); + var url = this.getAttribute('data-ejs-url') + "?autoplay=true"; + this.parentNode.parentNode.innerHTML = template$1(url, options); + }; + } +} + +var getDetailsTemplate = function (data, fullData, embedUrl, options) { + if (data.host === 'vimeo') { + return options.template.detailsVimeo(data, fullData, embedUrl, options); + } else if (data.host === 'youtube') { + return options.template.detailsYoutube(data, fullData, embedUrl, options); + } +} + +/** + * Applies video.js to all audio and video dynamically + * @param {object} options Options object + * @return {null} + */ +var applyPlyr = function (options) { + if (options.plyr) { + if (!options.plugins.plyr) throw new ReferenceError("You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/"); + var plyr = options.plugins.plyr; + plyr.setup('.ejs-plyr', options.plyrOptions); + } +} + +/** + * Applies video.js to all audio and video dynamically + * @param {object} options Options object + * @return {null} + */ +function applyVideoJS(options) { + options.videojsOptions.width = options.videoWidth; + options.videojsOptions.height = options.videoHeight; + if (options.videoJS) { + if (!options.plugins.videojs) throw new ReferenceError("You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/"); + var VideoJS = options.plugins.videojs; + var elements = options.input.getElementsByClassName('ejs-video-js'); + for (var i = 0; i < elements.length; i++) { + VideoJS(elements[i], options.videojsOptions, function () { + return options.videojsCallback(); + }); + } + } +} + +/** + * Destroys the onclick event for opening the video template from the details template + * @param {className} className + * @return {null} + */ +var destroyVideos = function (className) { + var classes = document.getElementsByClassName(className); + for (var i = 0; i < classes.length; i++) { + classes[i].onclick = null; + } +} + +function inlineEmbed(_) { + var regexInline = _.options.link ? new RegExp('([^>]*' + _.regex.source + ')', 'gm') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gm'); + _.output = _.output.replace(regexInline, function (match) { + var url = _.options.link ? match.slice(0, -4) : match; + if (_.options.served.indexOf(url) === -1) { + _.options.served.push(url); + if (_.options.link) { + return !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4)); + } else { + return !_.options.inlineText ? _.template(match) : match + _.template(match); + } + } else { + return match; //TODO : check whether this should be `match` + } + }); + return [_.output, _.embeds]; +} + +function normalEmbed(_) { + var match = void 0; + while ((match = matches(_.regex, _.input)) !== null) { + var url = match[0]; + if (!(_.options.served.indexOf(url) === -1) || _.options.served.length && _.options.singleEmbed) continue; + _.options.served.push(url); + var text = _.template(url); + _.embeds.push({ + text: text, + index: match.index + }); + } + return [_.output, _.embeds]; +} + +function embed(_) { + return ifInline(_.options, _.service) ? inlineEmbed(_) : normalEmbed(_); +} + +var base = function (input, output, embeds, options, regex, service) { + var args = { + input: input, + output: output, + options: options, + embeds: embeds, + regex: regex, + service: service, + template: function template(match) { + return this.options.template[this.service](match, this.options); + } + }; + + return embed(args); +} + +function baseEmbed(input, output, embeds, options, regex, service, flag) { + return ifEmbed(options, service) || ifEmbed(options, service) && flag ? base(input, output, embeds, options, regex, service) : [output, embeds]; +} + +/** + * This is a private function which is used to get the actual text to be replaced for + * a particular url in inline embedding. This returns a promise + * @param {object} _ reference to this + * @param {function} urlToText The function that converts url to replaceable text + * @param {object} match object containing info of matching string + * @return {Promise} resolves to the text + */ +function getInlineData(_, urlToText, match) { + var url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1]; + if (_.options.served.indexOf(url) >= 0) return Promise.resolve(null); + + return new Promise(function (resolve) { + urlToText(_, match, url).then(function (text) { + if (!text) return resolve(); + _.options.served.push(url); + resolve(text); + }); + }); +} + +/** + * A helper function for inline embedding + * @param _ + * @param urlToText + * @returns Promise + */ +function inlineAsyncEmbed(_, urlToText) { + var regexInline = _.options.link ? new RegExp('([^>]*' + _.regex.source + ')', 'gi') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gi'); + var match = void 0, + promises = []; + + while ((match = matches(regexInline, _.output)) !== null) { + promises.push(getInlineData(_, urlToText, match)); + }return new Promise(function (resolve) { + if (matches.length) Promise.all(promises).then(function (data) { + var i = 0; + _.output = _.output.replace(regexInline, function (match) { + if (_.options.link) return !_.options.inlineText ? data[i] + '' : match + data[i++];else return !_.options.inlineText ? data[i] : match + data[i++]; + }); + resolve(_.output); + });else resolve(_.output); + }); +} + +function getNormalData(_, urlToText, match) { + var url = match[0]; + if (_.options.served.indexOf(url) >= 0) return; + + return new Promise(function (resolve) { + urlToText(_, match, url, true).then(function (text) { + if (!text) resolve(); + _.options.served.push(url); + _.embeds.push({ + text: text, + index: match.index + }); + resolve(); + }); + }); +} + +/** + * A helper function for normal embedding + * @param {object} _ + * @param {function} urlToText + * @return {Promise} + */ +function normalAsyncEmbed(_, urlToText) { + var match = void 0, + promises = []; + while ((match = matches(_.regex, _.input)) !== null) { + promises.push(getNormalData(_, urlToText, match)); + }return new Promise(function (resolve) { + Promise.all(promises).then(function () { + resolve(_.embeds); + }); + }); +} + +function asyncEmbed(_, urlToText) { + return new Promise(function (resolve) { + if (ifInline(_.options, _.service)) inlineAsyncEmbed(_, urlToText).then(function (output) { + return resolve([output, _.embeds]); + });else normalAsyncEmbed(_, urlToText).then(function (embeds) { + return resolve([_.output, embeds]); + }); + }); +} + +var Twitter = function () { + function Twitter(input, output, options, embeds) { + babelHelpers.classCallCheck(this, Twitter); + + this.input = input; + this.output = output; + this.options = options; + this.embeds = embeds; + this.regex = regex.twitter; + this.service = 'twitter'; + + this.load = this.load.bind(this); + if (typeof this.options.input !== 'string') { + this.options.input.addEventListener('rendered', this.load, false); + } + } + + /** + * Fetches the data from twitter's oEmbed API + * @param {string} url URL of the tweet + * @return {object} data containing the tweet info + */ + + + babelHelpers.createClass(Twitter, [{ + key: 'tweetData', + value: function tweetData(url) { + var config = this.options.tweetOptions; + var apiUrl = 'https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=' + url + '&maxwidth=' + config.maxWidth + '&hide_media=' + config.hideMedia + '&hide_thread=' + config.hideThread + '&align=' + config.align + '&lang=' + config.lang; + return new Promise(function (resolve) { + fetchJsonp$1(apiUrl, { credentials: 'include' }).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve(json); + }); + }); + } + + /** + * Load twitter widgets + * @return null + */ + + }, { + key: 'load', + value: function load() { + var twitter = this.options.plugins.twitter; + twitter.widgets.load(this.options.element); //here this refers to the element + + //Execute the function after the widget is loaded + twitter.events.bind('loaded', this.options.onTweetsLoad); + } + }, { + key: 'process', + value: function process() { + var _this2 = this; + + return new Promise(function (resolve) { + return asyncEmbed(_this2, Twitter.urlToText).then(function (data) { + return resolve(data); + }); + }); + } + }], [{ + key: 'urlToText', + value: function urlToText(_this, match, url) { + return new Promise(function (resolve) { + return _this.tweetData(url).then(function (data) { + return resolve(data.html); + }); + }); + } + }]); + return Twitter; +}(); + +(function (self) { + 'use strict'; + + if (self.fetch) { + return; + } + + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { + throw new TypeError('Invalid character in header field name'); + } + return name.toLowerCase(); + } + + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value); + } + return value; + } + + function Headers(headers) { + this.map = {}; + + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var list = this.map[name]; + if (!list) { + list = []; + this.map[name] = list; + } + list.push(value); + }; + + Headers.prototype['delete'] = function (name) { + delete this.map[normalizeName(name)]; + }; + + Headers.prototype.get = function (name) { + var values = this.map[normalizeName(name)]; + return values ? values[0] : null; + }; + + Headers.prototype.getAll = function (name) { + return this.map[normalizeName(name)] || []; + }; + + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = [normalizeValue(value)]; + }; + + Headers.prototype.forEach = function (callback, thisArg) { + Object.getOwnPropertyNames(this.map).forEach(function (name) { + this.map[name].forEach(function (value) { + callback.call(thisArg, value, name, this); + }, this); + }, this); + }; + + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')); + } + body.bodyUsed = true; + } + + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); }; - - Headers.prototype.set = function (name, value) { - this.map[normalizeName(name)] = [normalizeValue(value)]; + reader.onerror = function () { + reject(reader.error); }; - - Headers.prototype.forEach = function (callback, thisArg) { - Object.getOwnPropertyNames(this.map).forEach(function (name) { - this.map[name].forEach(function (value) { - callback.call(thisArg, value, name, this); - }, this); - }, this); - }; - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')); - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function (resolve, reject) { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - reader.readAsArrayBuffer(blob); - return fileReaderReady(reader); + }); + } + + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + reader.readAsArrayBuffer(blob); + return fileReaderReady(reader); + } + + function readBlobAsText(blob) { + var reader = new FileReader(); + reader.readAsText(blob); + return fileReaderReady(reader); + } + + var support = { + blob: 'FileReader' in self && 'Blob' in self && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; } - - function readBlobAsText(blob) { - var reader = new FileReader(); - reader.readAsText(blob); - return fileReaderReady(reader); + }(), + formData: 'FormData' in self, + arrayBuffer: 'ArrayBuffer' in self + }; + + function Body() { + this.bodyUsed = false; + + this._initBody = function (body) { + this._bodyInit = body; + if (typeof body === 'string') { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (!body) { + this._bodyText = ''; + } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) { + // Only support ArrayBuffers for POST method. + // Receiving ArrayBuffers happens via Blobs, instead. + } else { + throw new Error('unsupported BodyInit type'); } - var support = { - blob: 'FileReader' in self && 'Blob' in self && function () { - try { - new Blob(); - return true; - } catch (e) { - return false; - } - }(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function Body() { - this.bodyUsed = false; - - this._initBody = function (body) { - this._bodyInit = body; - if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (!body) { - this._bodyText = ''; - } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) { - // Only support ArrayBuffers for POST method. - // Receiving ArrayBuffers happens via Blobs, instead. - } else { - throw new Error('unsupported BodyInit type'); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } - } - }; - - if (support.blob) { - this.blob = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob'); - } else { - return Promise.resolve(new Blob([this._bodyText])); - } - }; - - this.arrayBuffer = function () { - return this.blob().then(readBlobAsArrayBuffer); - }; - - this.text = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text'); - } else { - return Promise.resolve(this._bodyText); - } - }; - } else { - this.text = function () { - var rejected = consumed(this); - return rejected ? rejected : Promise.resolve(this._bodyText); - }; + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8'); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type); } - - if (support.formData) { - this.formData = function () { - return this.text().then(decode); - }; - } - - this.json = function () { - return this.text().then(JSON.parse); - }; - - return this; } + }; - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method; - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - if (Request.prototype.isPrototypeOf(input)) { - if (input.bodyUsed) { - throw new TypeError('Already read'); - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - if (!body) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = input; - } - - this.credentials = options.credentials || this.credentials || 'omit'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.referrer = null; - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests'); - } - this._initBody(body); - } - - Request.prototype.clone = function () { - return new Request(this); - }; - - function decode(body) { - var form = new FormData(); - body.trim().split('&').forEach(function (bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form; - } - - function headers(xhr) { - var head = new Headers(); - var pairs = xhr.getAllResponseHeaders().trim().split('\n'); - pairs.forEach(function (header) { - var split = header.trim().split(':'); - var key = split.shift().trim(); - var value = split.join(':').trim(); - head.append(key, value); - }); - return head; - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob'); + } else { + return Promise.resolve(new Blob([this._bodyText])); } - - this.type = 'default'; - this.status = options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = options.statusText; - this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function () { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }); }; - Response.error = function () { - var response = new Response(null, { status: 0, statusText: '' }); - response.type = 'error'; - return response; + this.arrayBuffer = function () { + return this.blob().then(readBlobAsArrayBuffer); }; - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function (url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code'); + this.text = function () { + var rejected = consumed(this); + if (rejected) { + return rejected; } - return new Response(null, { status: status, headers: { location: url } }); + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text'); + } else { + return Promise.resolve(this._bodyText); + } }; - - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - - self.fetch = function (input, init) { - return new Promise(function (resolve, reject) { - var request; - if (Request.prototype.isPrototypeOf(input) && !init) { - request = input; - } else { - request = new Request(input, init); - } - - var xhr = new XMLHttpRequest(); - - function responseURL() { - if ('responseURL' in xhr) { - return xhr.responseURL; - } - - // Avoid security warnings on getResponseHeader when not allowed by CORS - if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { - return xhr.getResponseHeader('X-Request-URL'); - } - - return; - } - - xhr.onload = function () { - var status = xhr.status === 1223 ? 204 : xhr.status; - if (status < 100 || status > 599) { - reject(new TypeError('Network request failed')); - return; - } - var options = { - status: status, - statusText: xhr.statusText, - headers: headers(xhr), - url: responseURL() - }; - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function () { - reject(new TypeError('Network request failed')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function (value, name) { - xhr.setRequestHeader(name, value); - }); - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }); + } else { + this.text = function () { + var rejected = consumed(this); + return rejected ? rejected : Promise.resolve(this._bodyText); }; - self.fetch.polyfill = true; - })(typeof self !== 'undefined' ? self : undefined); - - /** - * Takes the location name and returns the coordinates of that location using the Google - * Map API v3. This is an async function so it will return a promise. - * @param {string} location The name of any location - * @return {array} Returns an array in the form [latitude, longitude] - */ - function getCoordinate(location) { - var url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' + location + '&sensor=false'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]); - }); - }); - } - - /** - * Returns the template of the Map widget. The source of the iframe is based on whether the - * mode set in options is 'place', 'streetview' or 'view'. - * @param {string} match The matching string in the form of @(location name). - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {object} options plugin options - * @return {string} Template of the map widget. - */ - function template$1(match, latitude, longitude, options) { - var location = locationText(match); - return options.template.gmap(latitude, longitude, location, options); - } - - /** - * Extracts out the location name from the format @(locationName) - * @param {string} match The string in the supported format. Eg : @(Delhi) - * @return {string} Only the location name removing @ and brackets. Eg: Delhi - */ - function locationText(match) { - return match.split('(')[1].split(')')[0]; - } - - function gmap (input, output, options, embeds) { - var match = void 0, - promises = [], - allMatches = []; - - var service = 'map'; - - while ((match = matches(regex.gmap, output)) !== null) { - options.served.push(match); - var promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]); - promises.push(promise); - allMatches.push(match); - } - - return new Promise(function (resolve) { - Promise.all(promises).then(function (coordinatesArr) { - var _loop = function _loop() { - var _coordinatesArr$i = babelHelpers.slicedToArray(coordinatesArr[i], 2); - - var latitude = _coordinatesArr$i[0]; - var longitude = _coordinatesArr$i[1]; - - var text = template$1(allMatches[i][0], latitude, longitude, options); - if (ifInline(options, service)) { - output = output.replace(regex.gmap, function (regexMatch) { - return '' + locationText(regexMatch) + '' + text; - }); - } else { - embeds.push({ - text: text, - index: allMatches[i][0].index - }); - output = output.replace(regex.gmap, function (regexMatch) { - return '' + locationText(regexMatch) + ''; - }); - } - }; - - for (var i in promises) { - _loop(); - } - resolve([output, embeds]); - }); - }); } - function markdown (output, options) { - if (!options.plugins.marked) throw new ReferenceError('marked.js is not loaded.'); - - var Marked = options.plugins.marked; - var renderer = new Marked.Renderer(); - - renderer.link = function (href, title, text) { - if (href.indexOf('</a') === -1) return href; - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return '' + text + ''; - } - }; - - renderer.image = function (href, title, text) { - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return '
' + text + '
'; - } - return '
' + text + '
'; - }; - - renderer.paragraph = function (text) { - return '

' + text + '

'; - }; //for font smiley in end. - - //Fix for heading that should be actually present in marked.js - //if gfm is true the `## Heading` is acceptable but `##Heading` is not - Marked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading; - Marked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading; - - options.markedOptions.renderer = renderer; - options.markedOptions.highlight = false; - return Marked(output, options.markedOptions); - } - - /** - * Encodes the characters like <, > and space and replaces them with - * <, > and > respectively. - * @param {string} code The string that has to be encoded. - * @return {string} The encoded string - */ - function encode(code) { - code = code.replace(/&/gm, ''); - code = code.replace(/</g, '<'); - code = code.replace(/>/g, '>'); - return code; - } - - /** - * removes whitespace characters - * @param {string} code The string from which the whitespace has to be removed - * @return {string} - */ - function trimSpace(code) { - code = code.replace(/^([ \t]*)/g, ''); // leading whitespace - code = code.replace(/[ \t]*$/g, ''); // trailing whitespace - return code; - } - - /** - * Places the code and the language name in the required template - * @param {string} processedCode - * @param {string} language - * @return {string} - */ - function addTemplate(processedCode, language) { - return '
' + (processedCode.value || processedCode) + '
'; - } - - /** - * Replaces the code block with the pre tags and returns a string having the code - * formatting using Highlight.js. - * => Matches the string with the regex and finds the code written in three back-ticks ``` - * => Detects whether any language has been provided by the user. - * The format supported by embed.js is - * ```[language-name] - * var a = 2; - * ``` - * => Trims all the unnecessary spaces and newlines from the code. - * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string - * having the html tags for styling. The `language` here is optional. In case we don't pass the - * language, it tries to detect the language itself. - * => Replaces the code string in the template with the formatted string - * @return {string} The string in which the code is formatted - */ - function highlight (output, options) { - output = output.replace(regex.inlineCode, function (match, group1, group2) { - return '' + group2 + ''; - }); - - return output.replace(regex.highlightCode, function (match, group1, group2, group3) { - var code = group3; - code = trimSpace(code); - code = encode(code); - - // to prevent auto-linking. Not necessary in code - // *blocks*, but in code spans. Will be converted - // back after the auto-linker runs. - code = code.replace(/:\/\//g, '~P'); - - var language = group2.split('\n')[0]; - var highlightedCode = void 0; - - var HighlightJS = options.plugins.highlightjs; - if (language) { - highlightedCode = HighlightJS.highlightAuto(code, [language]); - } else { - highlightedCode = HighlightJS.highlightAuto(code); - language = highlightedCode.language; - } - - return addTemplate(highlightedCode, language); - }); - } - - var Gist = function () { - function Gist(input, output, options, embeds) { - var _this = this; - - babelHelpers.classCallCheck(this, Gist); - - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.gist; - this.service = 'gist'; - - if (typeof this.options.input !== 'string') { - this.options.input.addEventListener('rendered', function () { - _this.load(); - }); - } - } - - babelHelpers.createClass(Gist, [{ - key: 'template', - value: function template(match) { - return '
'; - } - }, { - key: 'load', - value: function load() { - var gists = this.options.input.getElementsByClassName('ejs-gist'); - for (var i = 0; i < gists.length; i++) { - var gistFrame = document.createElement("iframe"); - gistFrame.setAttribute("width", "100%"); - gistFrame.id = 'ejs-gist-' + i; - - var zone = gists[i]; - zone.innerHTML = ""; - zone.appendChild(gistFrame); - - // Create the iframe's document - var url = gists[i].getAttribute('data-src'); - url = url.indexOf('http') === -1 ? 'https://' + url : url; - var gistFrameHTML = ''; - - // Set iframe's document with a trigger for this document to adjust the height - var gistFrameDoc = gistFrame.document; - - if (gistFrame.contentDocument) { - gistFrameDoc = gistFrame.contentDocument; - } else if (gistFrame.contentWindow) { - gistFrameDoc = gistFrame.contentWindow.document; - } - - gistFrameDoc.open(); - gistFrameDoc.writeln(gistFrameHTML); - gistFrameDoc.close(); - } - } - }, { - key: 'process', - value: function process() { - return embed(this); - } - }]); - return Gist; - }(); - - function formatData(data) { - return { - title: data.snippet.title, - thumbnail: data.snippet.thumbnails.medium.url, - rawDescription: data.snippet.description, - views: data.statistics.viewCount, - likes: data.statistics.likeCount, - description: truncate(data.snippet.description, 150), - url: 'https://www.youtube.com/watch?v=' + data.id, - id: data.id, - host: 'youtube' - }; - } - - function data(id, options) { - var url = 'https://www.googleapis.com/youtube/v3/videos?id=' + id + '&key=' + options.googleAuthKey + '&part=snippet,statistics'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json.items[0]); - }); - }); - } - - function urlToText(args, match, url, normalEmbed) { - var id = normalEmbed ? match[1] : match[2]; - var embedUrl = 'https://www.youtube.com/embed/' + id; - if (args.options.videoDetails) { - return new Promise(function (resolve) { - data(id, args.options).then(function (data) { - return resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)); - }); - }); - } else { - return new Promise(function (resolve) { - return resolve(template(embedUrl, args.options)); - }); - } - } - - function youtube (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex.youtube, - service: 'youtube' - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText).then(function (data) { - return resolve(data); - }); - }); + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; } - function formatData$1(data, truncate) { - return { - title: data.title, - thumbnail: data.thumbnail_medium, - rawDescription: data.description.replace(/\n/g, '
').replace(/ /g, '
'), - views: data.stats_number_of_plays, - likes: data.stats_number_of_likes, - description: truncate(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), - url: data.url, - id: data.id, - host: 'vimeo' - }; - } + this.json = function () { + return this.text().then(JSON.parse); + }; - function data$1(id) { - var url = 'https://vimeo.com/api/v2/video/' + id + '.json'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json[0]); - }); - }); - } + return this; + } - function urlToText$1(args, match, url, normalEmbed) { - var id = void 0; - if (!normalEmbed) { - id = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop(); - } else { - id = match[3]; - } - if (!id) return; - var embedUrl = 'https://player.vimeo.com/video/' + id; - if (args.options.videoDetails) { - return new Promise(function (resolve) { - data$1(id).then(function (data) { - return resolve(getDetailsTemplate(formatData$1(data, truncate), data, embedUrl, args.options)); - }); - }); - } else { - return new Promise(function (resolve) { - return resolve(template(embedUrl, args.options)); - }); - } - } + // HTTP methods whose capitalization should be normalized + var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - function vimeo (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex.vimeo, - service: 'vimeo' - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$1).then(function (data) { - return resolve(data); - }); - }); - } + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } - function fetchData(args, url) { - var api = 'http://www.slideshare.net/api/oembed/2?url=' + url + '&format=jsonp&maxwidth=' + args.options.videoWidth + '&maxheight=' + args.options.videoHeight; - return new Promise(function (resolve) { - fetchJsonp$1(api, { credentials: 'include' }).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json.html); - }); - }); + function Request(input, options) { + options = options || {}; + var body = options.body; + if (Request.prototype.isPrototypeOf(input)) { + if (input.bodyUsed) { + throw new TypeError('Already read'); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + if (!body) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = input; } - function urlToText$2(args, match, url) { - return new Promise(function (resolve) { - fetchData(args, url).then(function (html) { - return resolve(args.template(html)); - }); - }); + this.credentials = options.credentials || this.credentials || 'omit'; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); } + this.method = normalizeMethod(options.method || this.method || 'GET'); + this.mode = options.mode || this.mode || null; + this.referrer = null; - function slideShare (input, output, options, embeds) { - var args = { - input: input, output: output, options: options, embeds: embeds, - regex: regex.slideShare, - service: 'slideshare', - template: function template(html) { - return this.options.template.slideShare(html, this.options); - } - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$2).then(function (data) { - return resolve(data); - }); - }); + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests'); } + this._initBody(body); + } - function fetchData$1(url, _) { - url = encodeURIComponent(url); - var api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url); - return new Promise(function (resolve) { - fetch(api).then(function (res) { - return res.json(); - }).then(function (json) { - return resolve(_.options.onOpenGraphFetch(json) || json); - }); - }); - } + Request.prototype.clone = function () { + return new Request(this); + }; - function urlToText$3(_, match, url) { - if (url.match(_.excludeRegex)) return Promise.resolve(); + function decode(body) { + var form = new FormData(); + body.trim().split('&').forEach(function (bytes) { + if (bytes) { + var split = bytes.split('='); + var name = split.shift().replace(/\+/g, ' '); + var value = split.join('=').replace(/\+/g, ' '); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + + function headers(xhr) { + var head = new Headers(); + var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n'); + pairs.forEach(function (header) { + var split = header.trim().split(':'); + var key = split.shift().trim(); + var value = split.join(':').trim(); + head.append(key, value); + }); + return head; + } - return new Promise(function (resolve) { - fetchData$1(url, _).then(function (data) { - return resolve(data && data.success ? _.template(data) : ''); - }); - }); - } + Body.call(Request.prototype); - function openGraph (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - service: 'opengraph', - regex: urlRegex(), - excludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'), - template: function template(data) { - return this.options.template.openGraph(data, this.options); - } - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$3).then(function (data) { - return resolve(data); - }); - }); + function Response(bodyInit, options) { + if (!options) { + options = {}; } - function template$2(data, options) { - return options.template.github(data, options); - } + this.type = 'default'; + this.status = options.status; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = options.statusText; + this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers); + this.url = options.url || ''; + this._initBody(bodyInit); + } - function fetchRepo(data) { - var api = 'https://api.github.com/repos/' + data.user + '/' + data.repo; - return new Promise(function (resolve) { - fetch(api).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json); - }); - }); - } + Body.call(Response.prototype); - function urlToText$4(_this, match, url, normalEmbed) { - var data = !normalEmbed ? { - user: match[2], - repo: match[3] - } : { - user: match[1], - repo: match[2] - }; - - if (!data.repo) return; - return new Promise(function (resolve) { - fetchRepo(data).then(function (response) { - return resolve(template$2(response, _this.options)); - }); - }); - } + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; - function github (input, output, options, embeds) { - var args = { - input: input, output: output, options: options, embeds: embeds, - service: 'github', - regex: regex.github - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$4).then(function (data) { - return resolve(data); - }); - }); - } + Response.error = function () { + var response = new Response(null, { status: 0, statusText: '' }); + response.type = 'error'; + return response; + }; - function mentions (input, options) { - var mRegex = regex.mentions; - return input.replace(mRegex, function (match, $1, $2) { - var username = $2.split('@')[1]; - return $1 + options.mentionsUrl(username); - }); - } + var redirectStatuses = [301, 302, 303, 307, 308]; - function hashtag (input, options) { - var hRegex = regex.hashtag; - return input.replace(hRegex, function (match, $1, $2) { - var username = $2.split('#')[1]; - return $1 + options.hashtagUrl(username); - }); + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError('Invalid status code'); } - var globalOptions = {}; - - var defaultOptions = { - marked: false, - markedOptions: {}, - link: true, - linkOptions: { - target: 'self', - exclude: ['pdf'], - rel: '' - }, - emoji: true, - customEmoji: [], - fontIcons: true, - customFontIcons: [], - highlightCode: false, - mentions: false, - hashtag: false, - videoJS: false, - videojsOptions: { - fluid: true, - preload: 'metadata' - }, - plyr: false, - plyrOptions: {}, - locationEmbed: true, - mapOptions: { - mode: 'place' - }, - tweetsEmbed: false, - tweetOptions: { - maxWidth: 550, - hideMedia: false, - hideThread: false, - align: 'none', - lang: 'en' - }, - singleEmbed: false, - openGraphEndpoint: null, - openGraphExclude: [], - videoEmbed: true, - videoHeight: null, - videoWidth: null, - videoDetails: true, - audioEmbed: true, - imageEmbed: true, - excludeEmbed: [], - inlineEmbed: [], - inlineText: true, - codeEmbedHeight: 500, - vineOptions: { - maxWidth: null, - type: 'postcard', //'postcard' or 'simple' embedding - responsive: true, - width: 350, - height: 460 - }, - plugins: { - marked: window.marked, - videojs: window.videojs, - plyr: window.plyr, - highlightjs: window.hljs, - prismjs: window.Prism, - twitter: window.twttr - }, - googleAuthKey: '', - soundCloudOptions: { - height: 160, - themeColor: 'f50000', //Hex Code of the player theme color - autoPlay: false, - hideRelated: false, - showComments: true, - showUser: true, - showReposts: false, - visual: false, //Show/hide the big preview image - download: false //Show/Hide download buttons - }, - videoClickClass: 'ejs-video-thumb', - customVideoClickHandler: false, - mentionsUrl: function mentionsUrl() {}, - hashtagUrl: function hashtagUrl() {}, - beforeEmbedJSApply: function beforeEmbedJSApply() {}, - afterEmbedJSApply: function afterEmbedJSApply() {}, - onVideoShow: function onVideoShow() {}, - onTweetsLoad: function onTweetsLoad() {}, - videojsCallback: function videojsCallback() {}, - onOpenGraphFetch: function onOpenGraphFetch() {}, - onOpenGraphFail: function onOpenGraphFail() {}, - videoClickHandler: function videoClickHandler() {}, - served: [] //Private variable used to store processed urls so that they are not processed multiple times. - }; + return new Response(null, { status: status, headers: { location: url } }); + }; - var instances = []; - var allInstances = []; - var promises = []; + self.Headers = Headers; + self.Request = Request; + self.Response = Response; - var EmbedJS = function () { - /** - * The constructor takes two arguements. The first one is the options object and the second one is the - * optional string . If the user wants to provide a string directly instead of the element, he can do that. - * In case the user provides both the input element and the string, the input string will be taken from the element - * and the provided string won't be processed. - * - * @param {object} options The options object - * @param template - * @return {null} - */ + self.fetch = function (input, init) { + return new Promise(function (resolve, reject) { + var request; + if (Request.prototype.isPrototypeOf(input) && !init) { + request = input; + } else { + request = new Request(input, init); + } - function EmbedJS(options, template) { - babelHelpers.classCallCheck(this, EmbedJS); + var xhr = new XMLHttpRequest(); - /** - * We have created a clone of the original options to make sure that the original object - * isn't altered. - */ - var defOpts = cloneObject(defaultOptions); - var globOpts = cloneObject(globalOptions); + function responseURL() { + if ('responseURL' in xhr) { + return xhr.responseURL; + } - //merge global options with the default options - var globOptions = deepExtend(defOpts, globOpts); + // Avoid security warnings on getResponseHeader when not allowed by CORS + if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { + return xhr.getResponseHeader('X-Request-URL'); + } - //deepExtend global options with the overriding options provided by the user as an options - //object while creating a new instance of embed.js - this.options = deepExtend(globOptions, options); + return; + } - this.options.template = template || renderer; + xhr.onload = function () { + var status = xhr.status === 1223 ? 204 : xhr.status; + if (status < 100 || status > 599) { + reject(new TypeError('Network request failed')); + return; + } + var options = { + status: status, + statusText: xhr.statusText, + headers: headers(xhr), + url: responseURL() + }; + var body = 'response' in xhr ? xhr.response : xhr.responseText; + resolve(new Response(body, options)); + }; - if (!this.options.input || !(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); + xhr.onerror = function () { + reject(new TypeError('Network request failed')); + }; - this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; - } + xhr.ontimeout = function () { + reject(new TypeError('Network request failed')); + }; - /** - * Processes the string and performs all the insertions and manipulations based on - * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready - * @return {Promise} The processes resulting string - */ + xhr.open(request.method, request.url, true); + if (request.credentials === 'include') { + xhr.withCredentials = true; + } - babelHelpers.createClass(EmbedJS, [{ - key: 'process', - value: function process() { - var _this = this; + if ('responseType' in xhr && support.blob) { + xhr.responseType = 'blob'; + } - var input = this.input; - var options = processOptions(this.options); - var embeds = []; - var output = input; + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); - this.options.beforeEmbedJSApply(); + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); + }); + }; + self.fetch.polyfill = true; +})(typeof self !== 'undefined' ? self : undefined); + +/** + * Takes the location name and returns the coordinates of that location using the Google + * Map API v3. This is an async function so it will return a promise. + * @param {string} location The name of any location + * @return {array} Returns an array in the form [latitude, longitude] + */ +function getCoordinate(location) { + var url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' + location + '&sensor=false'; + return new Promise(function (resolve) { + fetch(url).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]); + }); + }); +} + +/** + * Returns the template of the Map widget. The source of the iframe is based on whether the + * mode set in options is 'place', 'streetview' or 'view'. + * @param {string} match The matching string in the form of @(location name). + * @param {number} latitude Latitude of the location + * @param {number} longitude Longitude of the location + * @param {object} options plugin options + * @return {string} Template of the map widget. + */ +function template$2(match, latitude, longitude, options) { + var location = locationText(match); + return options.template.gmap(latitude, longitude, location, options); +} + +/** + * Extracts out the location name from the format @(locationName) + * @param {string} match The string in the supported format. Eg : @(Delhi) + * @return {string} Only the location name removing @ and brackets. Eg: Delhi + */ +function locationText(match) { + return match.split('(')[1].split(')')[0]; +} + +var gmap$1 = function (input, output, options, embeds) { + var match = void 0, + promises = [], + allMatches = []; + + var service = 'map'; + + while ((match = matches(regex.gmap, output)) !== null) { + options.served.push(match); + var promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]); + promises.push(promise); + allMatches.push(match); + } + + return new Promise(function (resolve) { + Promise.all(promises).then(function (coordinatesArr) { + var _loop = function _loop() { + var _coordinatesArr$i = babelHelpers.slicedToArray(coordinatesArr[i], 2); + + var latitude = _coordinatesArr$i[0]; + var longitude = _coordinatesArr$i[1]; + + var text = template$2(allMatches[i][0], latitude, longitude, options); + if (ifInline(options, service)) { + output = output.replace(regex.gmap, function (regexMatch) { + return '' + locationText(regexMatch) + '' + text; + }); + } else { + embeds.push({ + text: text, + index: allMatches[i][0].index + }); + output = output.replace(regex.gmap, function (regexMatch) { + return '' + locationText(regexMatch) + ''; + }); + } + }; + + for (var i in promises) { + _loop(); + } + resolve([output, embeds]); + }); + }); +} + +var markdown = function (output, options) { + if (!options.plugins.marked) throw new ReferenceError('marked.js is not loaded.'); + + var Marked = options.plugins.marked; + var renderer = new Marked.Renderer(); + + renderer.link = function (href, title, text) { + if (href.indexOf('</a') === -1) return href; + if (href.match(/>(.+)<\/a/gi)) { + if (!title) title = ''; + return '' + text + ''; + } + }; + + renderer.image = function (href, title, text) { + if (href.match(/>(.+)<\/a/gi)) { + if (!title) title = ''; + return '
' + text + '
'; + } + return '
' + text + '
'; + }; + + renderer.paragraph = function (text) { + return '

' + text + '

'; + }; //for font smiley in end. + + //Fix for heading that should be actually present in marked.js + //if gfm is true the `## Heading` is acceptable but `##Heading` is not + Marked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading; + Marked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading; + + options.markedOptions.renderer = renderer; + options.markedOptions.highlight = false; + return Marked(output, options.markedOptions); +} + +/** + * Encodes the characters like <, > and space and replaces them with + * <, > and > respectively. + * @param {string} code The string that has to be encoded. + * @return {string} The encoded string + */ +function encode(code) { + code = code.replace(/&/gm, ''); + code = code.replace(/</g, '<'); + code = code.replace(/>/g, '>'); + return code; +} + +/** + * removes whitespace characters + * @param {string} code The string from which the whitespace has to be removed + * @return {string} + */ +function trimSpace(code) { + code = code.replace(/^([ \t]*)/g, ''); // leading whitespace + code = code.replace(/[ \t]*$/g, ''); // trailing whitespace + return code; +} + +/** + * Places the code and the language name in the required template + * @param {string} processedCode + * @param {string} language + * @return {string} + */ +function addTemplate(processedCode, language) { + return '
' + (processedCode.value || processedCode) + '
'; +} + +/** + * Replaces the code block with the pre tags and returns a string having the code + * formatting using Highlight.js. + * => Matches the string with the regex and finds the code written in three back-ticks ``` + * => Detects whether any language has been provided by the user. + * The format supported by embed.js is + * ```[language-name] + * var a = 2; + * ``` + * => Trims all the unnecessary spaces and newlines from the code. + * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string + * having the html tags for styling. The `language` here is optional. In case we don't pass the + * language, it tries to detect the language itself. + * => Replaces the code string in the template with the formatted string + * @return {string} The string in which the code is formatted + */ +var highlight = function (output, options) { + output = output.replace(regex.inlineCode, function (match, group1, group2) { + return '' + group2 + ''; + }); + + return output.replace(regex.highlightCode, function (match, group1, group2, group3) { + var code = group3; + code = trimSpace(code); + code = encode(code); + + // to prevent auto-linking. Not necessary in code + // *blocks*, but in code spans. Will be converted + // back after the auto-linker runs. + code = code.replace(/:\/\//g, '~P'); + + var language = group2.split('\n')[0]; + var highlightedCode = void 0; + + var HighlightJS = options.plugins.highlightjs; + if (language) { + highlightedCode = HighlightJS.highlightAuto(code, [language]); + } else { + highlightedCode = HighlightJS.highlightAuto(code); + language = highlightedCode.language; + } + + return addTemplate(highlightedCode, language); + }); +} + +var Gist = function () { + function Gist(input, output, options, embeds) { + var _this = this; + + babelHelpers.classCallCheck(this, Gist); + + this.input = input; + this.output = output; + this.options = options; + this.embeds = embeds; + this.regex = regex.gist; + this.service = 'gist'; + + if (typeof this.options.input !== 'string') { + this.options.input.addEventListener('rendered', function () { + _this.load(); + }); + } + } + + babelHelpers.createClass(Gist, [{ + key: 'template', + value: function template(match) { + return '
'; + } + }, { + key: 'load', + value: function load() { + var gists = this.options.input.getElementsByClassName('ejs-gist'); + for (var i = 0; i < gists.length; i++) { + var gistFrame = document.createElement("iframe"); + gistFrame.setAttribute("width", "100%"); + gistFrame.id = 'ejs-gist-' + i; + + var zone = gists[i]; + zone.innerHTML = ""; + zone.appendChild(gistFrame); + + // Create the iframe's document + var url = gists[i].getAttribute('data-src'); + url = url.indexOf('http') === -1 ? 'https://' + url : url; + var gistFrameHTML = ''; + + // Set iframe's document with a trigger for this document to adjust the height + var gistFrameDoc = gistFrame.document; + + if (gistFrame.contentDocument) { + gistFrameDoc = gistFrame.contentDocument; + } else if (gistFrame.contentWindow) { + gistFrameDoc = gistFrame.contentWindow.document; + } + + gistFrameDoc.open(); + gistFrameDoc.writeln(gistFrameHTML); + gistFrameDoc.close(); + } + } + }, { + key: 'process', + value: function process() { + return embed(this); + } + }]); + return Gist; +}(); + +function formatData(data) { + return { + title: data.snippet.title, + thumbnail: data.snippet.thumbnails.medium.url, + rawDescription: data.snippet.description, + views: data.statistics.viewCount, + likes: data.statistics.likeCount, + description: truncate(data.snippet.description, 150), + url: 'https://www.youtube.com/watch?v=' + data.id, + id: data.id, + host: 'youtube' + }; +} + +function data(id, options) { + var url = 'https://www.googleapis.com/youtube/v3/videos?id=' + id + '&key=' + options.googleAuthKey + '&part=snippet,statistics'; + return new Promise(function (resolve) { + fetch(url).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve(json.items[0]); + }); + }); +} + +function urlToText$1(args, match, url, normalEmbed) { + var id = normalEmbed ? match[1] : match[2]; + var embedUrl = 'https://www.youtube.com/embed/' + id; + if (args.options.videoDetails) { + return new Promise(function (resolve) { + data(id, args.options).then(function (data) { + return resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)); + }); + }); + } else { + return new Promise(function (resolve) { + return resolve(template$1(embedUrl, args.options)); + }); + } +} + +var youtube$1 = function (input, output, options, embeds) { + var args = { + input: input, + output: output, + options: options, + embeds: embeds, + regex: regex.youtube, + service: 'youtube' + }; + + return new Promise(function (resolve) { + return asyncEmbed(args, urlToText$1).then(function (data) { + return resolve(data); + }); + }); +} + +function formatData$1(data, truncate$$1) { + return { + title: data.title, + thumbnail: data.thumbnail_medium, + rawDescription: data.description.replace(/\n/g, '
').replace(/ /g, '
'), + views: data.stats_number_of_plays, + likes: data.stats_number_of_likes, + description: truncate$$1(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), + url: data.url, + id: data.id, + host: 'vimeo' + }; +} + +function data$1(id) { + var url = 'https://vimeo.com/api/v2/video/' + id + '.json'; + return new Promise(function (resolve) { + fetch(url).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve(json[0]); + }); + }); +} + +function urlToText$2(args, match, url, normalEmbed) { + var id = void 0; + if (!normalEmbed) { + id = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop(); + } else { + id = match[3]; + } + if (!id) return; + var embedUrl = 'https://player.vimeo.com/video/' + id; + if (args.options.videoDetails) { + return new Promise(function (resolve) { + data$1(id).then(function (data) { + return resolve(getDetailsTemplate(formatData$1(data, truncate), data, embedUrl, args.options)); + }); + }); + } else { + return new Promise(function (resolve) { + return resolve(template$1(embedUrl, args.options)); + }); + } +} + +var vimeo$1 = function (input, output, options, embeds) { + var args = { + input: input, + output: output, + options: options, + embeds: embeds, + regex: regex.vimeo, + service: 'vimeo' + }; + + return new Promise(function (resolve) { + return asyncEmbed(args, urlToText$2).then(function (data) { + return resolve(data); + }); + }); +} + +function fetchData(args, url) { + var api = 'http://www.slideshare.net/api/oembed/2?url=' + url + '&format=jsonp&maxwidth=' + args.options.videoWidth + '&maxheight=' + args.options.videoHeight; + return new Promise(function (resolve) { + fetchJsonp$1(api, { credentials: 'include' }).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve(json.html); + }); + }); +} + +function urlToText$3(args, match, url) { + return new Promise(function (resolve) { + fetchData(args, url).then(function (html) { + return resolve(args.template(html)); + }); + }); +} + +var slideShare$1 = function (input, output, options, embeds) { + var args = { + input: input, output: output, options: options, embeds: embeds, + regex: regex.slideShare, + service: 'slideshare', + template: function template(html) { + return this.options.template.slideShare(html, this.options); + } + }; + + return new Promise(function (resolve) { + return asyncEmbed(args, urlToText$3).then(function (data) { + return resolve(data); + }); + }); +} + +function fetchData$1(url, _) { + url = encodeURIComponent(url); + var api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url); + return new Promise(function (resolve) { + fetch(api).then(function (res) { + return res.json(); + }).then(function (json) { + return resolve(_.options.onOpenGraphFetch(json) || json); + }); + }); +} + +function urlToText$4(_, match, url) { + if (url.match(_.excludeRegex)) return Promise.resolve(); + + return new Promise(function (resolve) { + fetchData$1(url, _).then(function (data) { + return resolve(data && data.success ? _.template(data) : ''); + }); + }); +} + +var openGraph$1 = function (input, output, options, embeds) { + var args = { + input: input, + output: output, + options: options, + embeds: embeds, + service: 'opengraph', + regex: urlRegex(), + excludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'), + template: function template(data) { + return this.options.template.openGraph(data, this.options); + } + }; + + return new Promise(function (resolve) { + return asyncEmbed(args, urlToText$4).then(function (data) { + return resolve(data); + }); + }); +} + +function template$3(data, options) { + return options.template.github(data, options); +} + +function fetchRepo(data) { + var api = 'https://api.github.com/repos/' + data.user + '/' + data.repo; + return new Promise(function (resolve) { + fetch(api).then(function (data) { + return data.json(); + }).then(function (json) { + return resolve(json); + }); + }); +} + +function urlToText$5(_this, match, url, normalEmbed) { + var data = !normalEmbed ? { + user: match[2], + repo: match[3] + } : { + user: match[1], + repo: match[2] + }; + + if (!data.repo) return; + return new Promise(function (resolve) { + fetchRepo(data).then(function (response) { + return resolve(template$3(response, _this.options)); + }); + }); +} + +var github$1 = function (input, output, options, embeds) { + var args = { + input: input, output: output, options: options, embeds: embeds, + service: 'github', + regex: regex.github + }; + + return new Promise(function (resolve) { + return asyncEmbed(args, urlToText$5).then(function (data) { + return resolve(data); + }); + }); +} + +var mentions = function (input, options) { + var mRegex = regex.mentions; + return input.replace(mRegex, function (match, $1, $2) { + var username = $2.split('@')[1]; + return $1 + options.mentionsUrl(username); + }); +} + +var hashtag = function (input, options) { + var hRegex = regex.hashtag; + return input.replace(hRegex, function (match, $1, $2) { + var username = $2.split('#')[1]; + return $1 + options.hashtagUrl(username); + }); +} + +var globalOptions = {}; + +var defaultOptions = { + marked: false, + markedOptions: {}, + link: true, + linkOptions: { + target: 'self', + exclude: ['pdf'], + rel: '' + }, + emoji: true, + customEmoji: [], + fontIcons: true, + customFontIcons: [], + highlightCode: false, + mentions: false, + hashtag: false, + videoJS: false, + videojsOptions: { + fluid: true, + preload: 'metadata' + }, + plyr: false, + plyrOptions: {}, + locationEmbed: true, + mapOptions: { + mode: 'place' + }, + tweetsEmbed: false, + tweetOptions: { + maxWidth: 550, + hideMedia: false, + hideThread: false, + align: 'none', + lang: 'en' + }, + singleEmbed: false, + openGraphEndpoint: null, + openGraphExclude: [], + videoEmbed: true, + videoHeight: null, + videoWidth: null, + videoDetails: true, + audioEmbed: true, + imageEmbed: true, + excludeEmbed: [], + inlineEmbed: [], + inlineText: true, + codeEmbedHeight: 500, + vineOptions: { + maxWidth: null, + type: 'postcard', //'postcard' or 'simple' embedding + responsive: true, + width: 350, + height: 460 + }, + plugins: { + marked: window.marked, + videojs: window.videojs, + plyr: window.plyr, + highlightjs: window.hljs, + prismjs: window.Prism, + twitter: window.twttr + }, + googleAuthKey: '', + soundCloudOptions: { + height: 160, + themeColor: 'f50000', //Hex Code of the player theme color + autoPlay: false, + hideRelated: false, + showComments: true, + showUser: true, + showReposts: false, + visual: false, //Show/hide the big preview image + download: false //Show/Hide download buttons + }, + videoClickClass: 'ejs-video-thumb', + customVideoClickHandler: false, + mentionsUrl: function mentionsUrl() {}, + hashtagUrl: function hashtagUrl() {}, + beforeEmbedJSApply: function beforeEmbedJSApply() {}, + afterEmbedJSApply: function afterEmbedJSApply() {}, + onVideoShow: function onVideoShow() {}, + onTweetsLoad: function onTweetsLoad() {}, + videojsCallback: function videojsCallback() {}, + onOpenGraphFetch: function onOpenGraphFetch() {}, + onOpenGraphFail: function onOpenGraphFail() {}, + videoClickHandler: function videoClickHandler() {}, + served: [] //Private variable used to store processed urls so that they are not processed multiple times. +}; + +var instances = []; +var allInstances = []; +var promises = []; + +var EmbedJS = function () { + /** + * The constructor takes two arguements. The first one is the options object and the second one is the + * optional string . If the user wants to provide a string directly instead of the element, he can do that. + * In case the user provides both the input element and the string, the input string will be taken from the element + * and the provided string won't be processed. + * + * @param {object} options The options object + * @param template + * @return {null} + */ + function EmbedJS(options, template$$1) { + babelHelpers.classCallCheck(this, EmbedJS); + + /** + * We have created a clone of the original options to make sure that the original object + * isn't altered. + */ + var defOpts = cloneObject(defaultOptions); + var globOpts = cloneObject(globalOptions); + + //merge global options with the default options + var globOptions = deepExtend(defOpts, globOpts); + + //deepExtend global options with the overriding options provided by the user as an options + //object while creating a new instance of embed.js + this.options = deepExtend(globOptions, options); + + this.options.template = template$$1 || renderer; + + if (!(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); + + this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; + } + + /** + * Processes the string and performs all the insertions and manipulations based on + * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready + * @return {Promise} The processes resulting string + */ + + + babelHelpers.createClass(EmbedJS, [{ + key: 'process', + value: function process() { + var _this = this; + + var input = this.input; + + if (input === '') return Promise.resolve(''); + + var options = processOptions(this.options); + var embeds = []; + var output = input; - return new Promise(function (resolve) { - if (options.link) output = url(input, options); + this.options.beforeEmbedJSApply(); - var openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]); + return new Promise(function (resolve) { + if (options.link) output = url$1(input, options); - openGraphPromise.then(function (_ref) { - var _ref2 = babelHelpers.slicedToArray(_ref, 2); + var openGraphPromise = options.openGraphEndpoint ? openGraph$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - var output = _ref2[0]; - var embeds = _ref2[1]; + openGraphPromise.then(function (_ref) { + var _ref2 = babelHelpers.slicedToArray(_ref, 2); - if (options.highlightCode) { - output = highlight(output, options); - } - if (options.marked) { - output = markdown(output, options); - } - if (options.emoji) { - output = emoji(output, options); - } - if (options.fontIcons) { - output = smiley(output, options); - } - if (options.mentions) { - output = mentions(output, options); - } - if (options.hashtag) { - output = hashtag(output, options); - } + var output = _ref2[0]; + var embeds = _ref2[1]; - var _baseEmbed = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone'); + if (options.highlightCode) { + output = highlight(output, options); + } + if (options.marked) { + output = markdown(output, options); + } + if (options.emoji) { + output = emoji$1(output, options); + } + if (options.fontIcons) { + output = smiley$1(output, options); + } + if (options.mentions) { + output = mentions(output, options); + } + if (options.hashtag) { + output = hashtag(output, options); + } - var _baseEmbed2 = babelHelpers.slicedToArray(_baseEmbed, 2); + var _baseEmbed = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone'); - output = _baseEmbed2[0]; - embeds = _baseEmbed2[1]; + var _baseEmbed2 = babelHelpers.slicedToArray(_baseEmbed, 2); - var _baseEmbed3 = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker'); + output = _baseEmbed2[0]; + embeds = _baseEmbed2[1]; - var _baseEmbed4 = babelHelpers.slicedToArray(_baseEmbed3, 2); + var _baseEmbed3 = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker'); - output = _baseEmbed4[0]; - embeds = _baseEmbed4[1]; + var _baseEmbed4 = babelHelpers.slicedToArray(_baseEmbed3, 2); - var _baseEmbed5 = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin'); + output = _baseEmbed4[0]; + embeds = _baseEmbed4[1]; - var _baseEmbed6 = babelHelpers.slicedToArray(_baseEmbed5, 2); + var _baseEmbed5 = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin'); - output = _baseEmbed6[0]; - embeds = _baseEmbed6[1]; + var _baseEmbed6 = babelHelpers.slicedToArray(_baseEmbed5, 2); - var _baseEmbed7 = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen'); + output = _baseEmbed6[0]; + embeds = _baseEmbed6[1]; - var _baseEmbed8 = babelHelpers.slicedToArray(_baseEmbed7, 2); + var _baseEmbed7 = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen'); - output = _baseEmbed8[0]; - embeds = _baseEmbed8[1]; + var _baseEmbed8 = babelHelpers.slicedToArray(_baseEmbed7, 2); - var _baseEmbed9 = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle'); + output = _baseEmbed8[0]; + embeds = _baseEmbed8[1]; - var _baseEmbed10 = babelHelpers.slicedToArray(_baseEmbed9, 2); + var _baseEmbed9 = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle'); - output = _baseEmbed10[0]; - embeds = _baseEmbed10[1]; + var _baseEmbed10 = babelHelpers.slicedToArray(_baseEmbed9, 2); - var _baseEmbed11 = baseEmbed(input, output, embeds, options, regex.ted, 'ted'); + output = _baseEmbed10[0]; + embeds = _baseEmbed10[1]; - var _baseEmbed12 = babelHelpers.slicedToArray(_baseEmbed11, 2); + var _baseEmbed11 = baseEmbed(input, output, embeds, options, regex.ted, 'ted'); - output = _baseEmbed12[0]; - embeds = _baseEmbed12[1]; + var _baseEmbed12 = babelHelpers.slicedToArray(_baseEmbed11, 2); - var _baseEmbed13 = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion'); + output = _baseEmbed12[0]; + embeds = _baseEmbed12[1]; - var _baseEmbed14 = babelHelpers.slicedToArray(_baseEmbed13, 2); + var _baseEmbed13 = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion'); - output = _baseEmbed14[0]; - embeds = _baseEmbed14[1]; + var _baseEmbed14 = babelHelpers.slicedToArray(_baseEmbed13, 2); - var _baseEmbed15 = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream'); + output = _baseEmbed14[0]; + embeds = _baseEmbed14[1]; - var _baseEmbed16 = babelHelpers.slicedToArray(_baseEmbed15, 2); + var _baseEmbed15 = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream'); - output = _baseEmbed16[0]; - embeds = _baseEmbed16[1]; + var _baseEmbed16 = babelHelpers.slicedToArray(_baseEmbed15, 2); - var _baseEmbed17 = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak'); + output = _baseEmbed16[0]; + embeds = _baseEmbed16[1]; - var _baseEmbed18 = babelHelpers.slicedToArray(_baseEmbed17, 2); + var _baseEmbed17 = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak'); - output = _baseEmbed18[0]; - embeds = _baseEmbed18[1]; + var _baseEmbed18 = babelHelpers.slicedToArray(_baseEmbed17, 2); - var _baseEmbed19 = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed); + output = _baseEmbed18[0]; + embeds = _baseEmbed18[1]; - var _baseEmbed20 = babelHelpers.slicedToArray(_baseEmbed19, 2); + var _baseEmbed19 = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed); - output = _baseEmbed20[0]; - embeds = _baseEmbed20[1]; + var _baseEmbed20 = babelHelpers.slicedToArray(_baseEmbed19, 2); - var _baseEmbed21 = baseEmbed(input, output, embeds, options, regex.vine, 'vine'); + output = _baseEmbed20[0]; + embeds = _baseEmbed20[1]; - var _baseEmbed22 = babelHelpers.slicedToArray(_baseEmbed21, 2); + var _baseEmbed21 = baseEmbed(input, output, embeds, options, regex.vine, 'vine'); - output = _baseEmbed22[0]; - embeds = _baseEmbed22[1]; + var _baseEmbed22 = babelHelpers.slicedToArray(_baseEmbed21, 2); - var _baseEmbed23 = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud'); + output = _baseEmbed22[0]; + embeds = _baseEmbed22[1]; - var _baseEmbed24 = babelHelpers.slicedToArray(_baseEmbed23, 2); + var _baseEmbed23 = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud'); - output = _baseEmbed24[0]; - embeds = _baseEmbed24[1]; + var _baseEmbed24 = babelHelpers.slicedToArray(_baseEmbed23, 2); - var _baseEmbed25 = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify'); + output = _baseEmbed24[0]; + embeds = _baseEmbed24[1]; - var _baseEmbed26 = babelHelpers.slicedToArray(_baseEmbed25, 2); + var _baseEmbed25 = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify'); - output = _baseEmbed26[0]; - embeds = _baseEmbed26[1]; + var _baseEmbed26 = babelHelpers.slicedToArray(_baseEmbed25, 2); - var _baseEmbed27 = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed); + output = _baseEmbed26[0]; + embeds = _baseEmbed26[1]; - var _baseEmbed28 = babelHelpers.slicedToArray(_baseEmbed27, 2); + var _baseEmbed27 = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed); - output = _baseEmbed28[0]; - embeds = _baseEmbed28[1]; + var _baseEmbed28 = babelHelpers.slicedToArray(_baseEmbed27, 2); - var _baseEmbed29 = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr'); + output = _baseEmbed28[0]; + embeds = _baseEmbed28[1]; - var _baseEmbed30 = babelHelpers.slicedToArray(_baseEmbed29, 2); + var _baseEmbed29 = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr'); - output = _baseEmbed30[0]; - embeds = _baseEmbed30[1]; + var _baseEmbed30 = babelHelpers.slicedToArray(_baseEmbed29, 2); - var _baseEmbed31 = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram'); + output = _baseEmbed30[0]; + embeds = _baseEmbed30[1]; - var _baseEmbed32 = babelHelpers.slicedToArray(_baseEmbed31, 2); + var _baseEmbed31 = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram'); - output = _baseEmbed32[0]; - embeds = _baseEmbed32[1]; + var _baseEmbed32 = babelHelpers.slicedToArray(_baseEmbed31, 2); - var _baseEmbed33 = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed); + output = _baseEmbed32[0]; + embeds = _baseEmbed32[1]; - var _baseEmbed34 = babelHelpers.slicedToArray(_baseEmbed33, 2); + var _baseEmbed33 = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed); - output = _baseEmbed34[0]; - embeds = _baseEmbed34[1]; + var _baseEmbed34 = babelHelpers.slicedToArray(_baseEmbed33, 2); + output = _baseEmbed34[0]; + embeds = _baseEmbed34[1]; - if (ifEmbed(options, 'gist')) { - var _process = new Gist(input, output, options, embeds).process(); - var _process2 = babelHelpers.slicedToArray(_process, 2); + if (ifEmbed(options, 'gist')) { + var _process = new Gist(input, output, options, embeds).process(); - output = _process2[0]; - embeds = _process2[1]; - } + var _process2 = babelHelpers.slicedToArray(_process, 2); - return ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref3) { - var _ref4 = babelHelpers.slicedToArray(_ref3, 2); + output = _process2[0]; + embeds = _process2[1]; + } - var output = _ref4[0]; - var embeds = _ref4[1]; + return ifEmbed(options, 'youtube') ? youtube$1(input, output, options, embeds) : Promise.resolve([output, embeds]); + }).then(function (_ref3) { + var _ref4 = babelHelpers.slicedToArray(_ref3, 2); - return ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref5) { - var _ref6 = babelHelpers.slicedToArray(_ref5, 2); + var output = _ref4[0]; + var embeds = _ref4[1]; - var output = _ref6[0]; - var embeds = _ref6[1]; + return ifEmbed(options, 'vimeo') ? vimeo$1(input, output, options, embeds) : Promise.resolve([output, embeds]); + }).then(function (_ref5) { + var _ref6 = babelHelpers.slicedToArray(_ref5, 2); - return ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref7) { - var _ref8 = babelHelpers.slicedToArray(_ref7, 2); + var output = _ref6[0]; + var embeds = _ref6[1]; - var output = _ref8[0]; - var embeds = _ref8[1]; + return ifEmbed(options, 'github') ? github$1(input, output, options, embeds) : Promise.resolve([output, embeds]); + }).then(function (_ref7) { + var _ref8 = babelHelpers.slicedToArray(_ref7, 2); - return options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref9) { - var _ref10 = babelHelpers.slicedToArray(_ref9, 2); + var output = _ref8[0]; + var embeds = _ref8[1]; - var output = _ref10[0]; - var embeds = _ref10[1]; + return options.locationEmbed && ifEmbed(options, 'gmap') ? gmap$1(input, output, options, embeds) : Promise.resolve([output, embeds]); + }).then(function (_ref9) { + var _ref10 = babelHelpers.slicedToArray(_ref9, 2); - return ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref11) { - var _ref12 = babelHelpers.slicedToArray(_ref11, 2); + var output = _ref10[0]; + var embeds = _ref10[1]; - var output = _ref12[0]; - var embeds = _ref12[1]; + return ifEmbed(options, 'slideshare') ? slideShare$1(input, output, options, embeds) : Promise.resolve([output, embeds]); + }).then(function (_ref11) { + var _ref12 = babelHelpers.slicedToArray(_ref11, 2); - if (options.tweetsEmbed && ifEmbed(options, 'twitter')) { - _this.twitter = new Twitter(input, output, options, embeds); - return _this.twitter.process(); - } else { - return Promise.resolve([output, embeds]); - } - }).then(function (_ref13) { - var _ref14 = babelHelpers.slicedToArray(_ref13, 2); + var output = _ref12[0]; + var embeds = _ref12[1]; - var output = _ref14[0]; - var embeds = _ref14[1]; + if (options.tweetsEmbed && ifEmbed(options, 'twitter')) { + _this.twitter = new Twitter(input, output, options, embeds); + return _this.twitter.process(); + } else { + return Promise.resolve([output, embeds]); + } + }).then(function (_ref13) { + var _ref14 = babelHelpers.slicedToArray(_ref13, 2); - _this.data = { - input: options.input, - output: output, - options: options, - inputString: _this.input, - /** - TODO: - - Restructure served urls structure with services name - */ + var output = _ref14[0]; + var embeds = _ref14[1]; - services: options.served, - template: options.template - }; + _this.data = { + input: options.input, + output: output, + options: options, + inputString: _this.input, + services: options.served, + template: options.template + }; - resolve(createText(output, embeds)); - }); - }); - } + resolve(createText(output, embeds)); + }); + }); + } - /** - * First processes the data by calling the .process() and then renders the data in the div - * => Loads the twitter widgets - * => Executes the onTweetsLoad() once all the tweets have been rendered - * => Applies video.js on the media (both audio and video) - * => Triggers video loading on click of the video preview - * => Executes afterEmbedJSApply() once everything is done. - * - * @return Promise - */ - - }, { - key: 'render', - value: function render() { - var _this2 = this; - - if (typeof this.options.input === 'string') throw new Error('You cannot call render method for a string'); - if (!this.options.input) throw new Error('You didn\'t pass an element while creating this instance. render() method can\'t work without an input element'); - - return new Promise(function (resolve) { - _this2.process().then(function (data) { - _this2.options.input.innerHTML = data; - _this2.applyListeners(); - resolve(_this2.data); - }); - }); - } - - /** - * This method listens to all the events like click, handle - * events to be done after an element has been rendered. These - * include twitter widget rendering, gist embedding, click event listeners . - */ - - }, { - key: 'applyListeners', - value: function applyListeners() { - applyVideoJS(this.options); - applyPlyr(this.options); - - playVideo(this.options); - - var event = new Event('rendered'); - this.options.input.dispatchEvent(event); - - this.options.afterEmbedJSApply(); - } - - /** - * This function updates the parametrs of the current instance - * @param options New updated options object. will be extended with the older options - * @param template [optional] the new template instance - */ - - }, { - key: 'update', - value: function update(options, template) { - - if (options) this.options = deepExtend(this.options, options); - - if (template) this.options.template = template; - - if (!this.options.input || !(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); - - this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; - } - - /** - * returns the resulting string based on the input and the options passed by the user. - * @return Promise - */ - - }, { - key: 'text', - value: function text(callback) { - var _this3 = this; - - this.process().then(function (data) { - return callback(data, _this3.input); - }); - } - - /** - * The destroy method destroys all the listeners and replaces the rih text with the original text in the - * element. - * @return {null} - */ - - }, { - key: 'destroy', - value: function destroy() { - if (babelHelpers.typeof(this.options.input) !== 'object') throw new Error('destroy() method only works if an element had been passed in the options object'); - destroyVideos('ejs-video-thumb'); - if (this.options.tweetsEmbed) this.options.input.removeEventListener('rendered', this.twitter.load(), false); - this.options.input.innerHTML = this.input; - } - - /** - * Sets options globally - * @param {object} options - */ - - }], [{ - key: 'setOptions', - value: function setOptions(options) { - globalOptions = deepExtend(defaultOptions, options); - } - - /** - * Applies embed.js to all the elements with the class name provided as option - * @return {Promise} - * @param selectorName - * @param options - * @param template - */ - - }, { - key: 'applyEmbedJS', - value: function applyEmbedJS(selectorName) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var template = arguments.length <= 2 || arguments[2] === undefined ? renderer : arguments[2]; - - var elements = document.querySelectorAll(selectorName); - for (var i = 0; i < elements.length; i++) { - options.input = elements[i]; - instances[i] = new EmbedJS(options, template); - promises[i] = instances[i].render(); - } - return new Promise(function (resolve) { - Promise.all(promises).then(function (val) { - resolve(val); - }); - }); - } - - /** - * Destroys all the instances of EmbedJS created by using applyEmbedJS() method. - * @return {null} - */ - - }, { - key: 'destroyEmbedJS', - value: function destroyEmbedJS() { - for (var i = 0; i < instances.length; i++) { - instances[i].destroy(); - } - } - - /** - * Destroys all instances of EmbedJS on the page - * @return {null} - */ - - }, { - key: 'destroyAll', - value: function destroyAll() { - for (var i = 0; i < allInstances.length; i++) { - allInstances[i].destroy(); - } - } - - /** - * Creates a new instance of the Template constructor. This has been done so that multiple - * templates of a single service can be used by creating different instances of the Template. - * - * The usage of the plugin is described below. - * - * => Create a new Instance of the template by using .Template() method of EmbedJS. - * - * var template = EmbedJS.Template() - * - * => Now create different templates for different service names. - * - * template.url = function(match, options){ - * return ' + match + ' - * } - * - * template.instagram = function(match, dimensions, options){ - * var config = options.soundCloudOptions; - * return `
`; - * } - * - */ - - }, { - key: 'Template', - value: function Template() { - return renderer; - } - }]); - return EmbedJS; - }(); - - return EmbedJS; - -})); -//# sourceMappingURL=embed.js.map \ No newline at end of file + /** + * First processes the data by calling the .process() and then renders the data in the div + * => Loads the twitter widgets + * => Executes the onTweetsLoad() once all the tweets have been rendered + * => Applies video.js on the media (both audio and video) + * => Triggers video loading on click of the video preview + * => Executes afterEmbedJSApply() once everything is done. + * + * @return Promise + */ + + }, { + key: 'render', + value: function render() { + var _this2 = this; + + if (typeof this.options.input === 'string') throw new Error('You cannot call render method for a string'); + if (!this.options.input) throw new Error('You didn\'t pass an element while creating this instance. render() method can\'t work without an input element'); + + return new Promise(function (resolve) { + _this2.process().then(function (data) { + _this2.options.input.innerHTML = data; + _this2.applyListeners(); + resolve(_this2.data); + }); + }); + } + + /** + * This method listens to all the events like click, handle + * events to be done after an element has been rendered. These + * include twitter widget rendering, gist embedding, click event listeners . + */ + + }, { + key: 'applyListeners', + value: function applyListeners() { + applyVideoJS(this.options); + applyPlyr(this.options); + + playVideo(this.options); + + var event = new Event('rendered'); + this.options.input.dispatchEvent(event); + + this.options.afterEmbedJSApply(); + } + + /** + * This function updates the parametrs of the current instance + * @param options New updated options object. will be extended with the older options + * @param template [optional] the new template instance + */ + + }, { + key: 'update', + value: function update(options, template$$1) { + + if (options) this.options = deepExtend(this.options, options); + + if (template$$1) this.options.template = template$$1; + + if (!this.options.input || !(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); + + this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; + } + + /** + * returns the resulting string based on the input and the options passed by the user. + * @return Promise + */ + + }, { + key: 'text', + value: function text(callback) { + var _this3 = this; + + this.process().then(function (data) { + return callback(data, _this3.input); + }); + } + + /** + * The destroy method destroys all the listeners and replaces the rih text with the original text in the + * element. + * @return {null} + */ + + }, { + key: 'destroy', + value: function destroy() { + if (babelHelpers.typeof(this.options.input) !== 'object') throw new Error('destroy() method only works if an element had been passed in the options object'); + destroyVideos('ejs-video-thumb'); + if (this.options.tweetsEmbed) this.options.input.removeEventListener('rendered', this.twitter.load(), false); + this.options.input.innerHTML = this.input; + } + + /** + * Sets options globally + * @param {object} options + */ + + }], [{ + key: 'setOptions', + value: function setOptions(options) { + globalOptions = deepExtend(defaultOptions, options); + } + + /** + * Applies embed.js to all the elements with the class name provided as option + * @return {Promise} + * @param selectorName + * @param options + * @param template + */ + + }, { + key: 'applyEmbedJS', + value: function applyEmbedJS(selectorName) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var template$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : renderer; + + var elements = document.querySelectorAll(selectorName); + for (var i = 0; i < elements.length; i++) { + options.input = elements[i]; + instances[i] = new EmbedJS(options, template$$1); + promises[i] = instances[i].render(); + } + return new Promise(function (resolve) { + Promise.all(promises).then(function (val) { + resolve(val); + }); + }); + } + + /** + * Destroys all the instances of EmbedJS created by using applyEmbedJS() method. + * @return {null} + */ + + }, { + key: 'destroyEmbedJS', + value: function destroyEmbedJS() { + for (var i = 0; i < instances.length; i++) { + instances[i].destroy(); + } + } + + /** + * Destroys all instances of EmbedJS on the page + * @return {null} + */ + + }, { + key: 'destroyAll', + value: function destroyAll() { + for (var i = 0; i < allInstances.length; i++) { + allInstances[i].destroy(); + } + } + + /** + * Creates a new instance of the Template constructor. This has been done so that multiple + * templates of a single service can be used by creating different instances of the Template. + * + * The usage of the plugin is described below. + * + * => Create a new Instance of the template by using .Template() method of EmbedJS. + * + * var template = EmbedJS.Template() + * + * => Now create different templates for different service names. + * + * template.url = function(match, options){ + * return ' + match + ' + * } + * + * template.instagram = function(match, dimensions, options){ + * var config = options.soundCloudOptions; + * return `
`; + * } + * + */ + + }, { + key: 'Template', + value: function Template() { + return renderer; + } + }]); + return EmbedJS; +}(); + +return EmbedJS; + +}))); +//# sourceMappingURL=embed.js.map diff --git a/src/embed.js.map b/src/embed.js.map index 3f19081..cc3ae60 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","normalizeName","name","String","test","TypeError","normalizeValue","value","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","support","Blob","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","items","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,OAAOL,MAAxC,GAAkDA,MAAzD;;;;;;;;;AASJ,AAAO,SAASM,UAAT,CAAoBC,WAApB,EAAiCC,MAAjC,EAAyC;SACvC,IAAIC,QAAT,IAAqBD,MAArB,EAA6B;YACrBA,OAAOE,cAAP,CAAsBD,QAAtB,KAAmCD,OAAOC,QAAP,CAAnC,IAAuDD,OAAOC,QAAP,EAAiBE,WAA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L,CAAaC,IAAb,EAAnD,EAAwE,KAAxE;QACIxL,OAAL,CAAaH,KAAb,CAAmBqJ,SAAnB,GAA+B,KAAKrJ,KAApC;;;;;;;;;;6BAOiBG,SAAS;mBACV1B,WAAW0H,cAAX,EAA2BhG,OAA3B,CAAhB;;;;;;;;;;;;;+BAUmB6a,cAAiD;OAAnC7a,OAAmC,uEAAzB,EAAyB;OAArB4E,WAAqB,uEAAVyO,QAAU;;OAChEtJ,WAAWhD,SAAS+T,gBAAT,CAA0BD,YAA1B,CAAf;QACK,IAAIpb,IAAI,CAAb,EAAgBA,IAAIsK,SAAS5L,MAA7B,EAAqCsB,GAArC,EAA0C;YACjCI,KAAR,GAAgBkK,SAAStK,CAAT,CAAhB;cACUA,CAAV,IAAe,IAAI+Y,OAAJ,CAAYxY,OAAZ,EAAqB4E,WAArB,CAAf;aACSnF,CAAT,IAAc6Y,UAAU7Y,CAAV,EAAasb,MAAb,EAAd;;UAEM,IAAIvT,OAAJ,CAAY,UAAUC,OAAV,EAAmB;YAC7ByD,GAAR,CAAYD,QAAZ,EAAsBF,IAAtB,CAA2B,UAAU9F,GAAV,EAAe;aACjCA,GAAR;KADD;IADM,CAAP;;;;;;;;;;mCAWuB;QAClB,IAAIxF,IAAI,CAAb,EAAgBA,IAAI6Y,UAAUna,MAA9B,EAAsCsB,GAAtC,EAA2C;cAChCA,CAAV,EAAaub,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIvb,IAAI,CAAb,EAAgBA,IAAI8Y,aAAapa,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBub,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV3H,QAAP;;;;;;;;"} \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index f54b9ab..14992ad 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,4 +1,4 @@ -import {ifEmbed, createText, deepExtend, cloneObject, processOptions} from './modules/utils' +import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils' import renderer from './modules/template' @@ -26,113 +26,113 @@ import hashtag from './modules/hashtag'; import regex from './modules/regex' -import {applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed} from './helpers' +import { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers' -var globalOptions = {}; +let globalOptions = {}; -var defaultOptions = { - marked : false, - markedOptions : {}, - link : true, - linkOptions : { - target : 'self', +const defaultOptions = { + marked: false, + markedOptions: {}, + link: true, + linkOptions: { + target: 'self', exclude: ['pdf'], - rel : '' + rel: '' }, - emoji : true, - customEmoji : [], - fontIcons : true, - customFontIcons : [], - highlightCode : false, - mentions : false, - hashtag : false, - videoJS : false, - videojsOptions : { - fluid : true, + emoji: true, + customEmoji: [], + fontIcons: true, + customFontIcons: [], + highlightCode: false, + mentions: false, + hashtag: false, + videoJS: false, + videojsOptions: { + fluid: true, preload: 'metadata' }, - plyr : false, - plyrOptions : {}, - locationEmbed : true, - mapOptions : { + plyr: false, + plyrOptions: {}, + locationEmbed: true, + mapOptions: { mode: 'place' }, - tweetsEmbed : false, - tweetOptions : { - maxWidth : 550, - hideMedia : false, + tweetsEmbed: false, + tweetOptions: { + maxWidth: 550, + hideMedia: false, hideThread: false, - align : 'none', - lang : 'en' + align: 'none', + lang: 'en' }, - singleEmbed : false, - openGraphEndpoint : null, - openGraphExclude : [], - videoEmbed : true, - videoHeight : null, - videoWidth : null, - videoDetails : true, - audioEmbed : true, - imageEmbed : true, - excludeEmbed : [], - inlineEmbed : [], - inlineText : true, - codeEmbedHeight : 500, - vineOptions : { - maxWidth : null, - type : 'postcard', //'postcard' or 'simple' embedding + singleEmbed: false, + openGraphEndpoint: null, + openGraphExclude: [], + videoEmbed: true, + videoHeight: null, + videoWidth: null, + videoDetails: true, + audioEmbed: true, + imageEmbed: true, + excludeEmbed: [], + inlineEmbed: [], + inlineText: true, + codeEmbedHeight: 500, + vineOptions: { + maxWidth: null, + type: 'postcard', //'postcard' or 'simple' embedding responsive: true, - width : 350, - height : 460 + width: 350, + height: 460 }, - plugins : { - marked : window.marked, - videojs : window.videojs, - plyr : window.plyr, + plugins: { + marked: window.marked, + videojs: window.videojs, + plyr: window.plyr, highlightjs: window.hljs, - prismjs : window.Prism, - twitter : window.twttr + prismjs: window.Prism, + twitter: window.twttr }, - googleAuthKey : '', - soundCloudOptions : { - height : 160, - themeColor : 'f50000', //Hex Code of the player theme color - autoPlay : false, - hideRelated : false, + googleAuthKey: '', + soundCloudOptions: { + height: 160, + themeColor: 'f50000', //Hex Code of the player theme color + autoPlay: false, + hideRelated: false, showComments: true, - showUser : true, - showReposts : false, - visual : false, //Show/hide the big preview image - download : false //Show/Hide download buttons + showUser: true, + showReposts: false, + visual: false, //Show/hide the big preview image + download: false //Show/Hide download buttons }, - videoClickClass : 'ejs-video-thumb', + videoClickClass: 'ejs-video-thumb', customVideoClickHandler: false, - mentionsUrl : function () { + mentionsUrl: function () { }, - hashtagUrl : function () { + hashtagUrl: function () { }, - beforeEmbedJSApply : function () { + beforeEmbedJSApply: function () { }, - afterEmbedJSApply : function () { + afterEmbedJSApply: function () { }, - onVideoShow : function () { + onVideoShow: function () { }, - onTweetsLoad : function () { + onTweetsLoad: function () { }, - videojsCallback : function () { + videojsCallback: function () { }, - onOpenGraphFetch : function () { + onOpenGraphFetch: function () { }, - onOpenGraphFail : function () { + onOpenGraphFail: function () { }, - videoClickHandler : function () { + videoClickHandler: function () { }, - served : [] //Private variable used to store processed urls so that they are not processed multiple times. + served: [] //Private variable used to store processed urls so that they are not processed multiple times. }; -let instances = []; +let instances = []; let allInstances = []; -let promises = []; +let promises = []; export default class EmbedJS { /** @@ -150,7 +150,7 @@ export default class EmbedJS { * We have created a clone of the original options to make sure that the original object * isn't altered. */ - let defOpts = cloneObject(defaultOptions); + let defOpts = cloneObject(defaultOptions); let globOpts = cloneObject(globalOptions); //merge global options with the default options @@ -162,7 +162,7 @@ export default class EmbedJS { this.options.template = template || renderer; - if (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); + if (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); this.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input @@ -174,10 +174,13 @@ export default class EmbedJS { * @return {Promise} The processes resulting string */ process() { - const input = this.input; + const input = this.input; + + if (input === '') return Promise.resolve(''); + const options = processOptions(this.options); - let embeds = []; - let output = input; + let embeds = []; + let output = input; this.options.beforeEmbedJSApply(); @@ -247,19 +250,12 @@ export default class EmbedJS { } }).then(([output, embeds]) => { this.data = { - input : options.input, - output : output, - options : options, + input: options.input, + output, + options, inputString: this.input, - /** - - TODO: - - Restructure served urls structure with services name - - */ - - services : options.served, - template : options.template + services: options.served, + template: options.template }; resolve(createText(output, embeds)) @@ -332,7 +328,7 @@ export default class EmbedJS { * @return Promise */ text(callback) { - this.process().then((data)=> callback(data, this.input)) + this.process().then((data) => callback(data, this.input)) } /** @@ -367,8 +363,8 @@ export default class EmbedJS { let elements = document.querySelectorAll(selectorName); for (let i = 0; i < elements.length; i++) { options.input = elements[i]; - instances[i] = new EmbedJS(options, template); - promises[i] = instances[i].render() + instances[i] = new EmbedJS(options, template); + promises[i] = instances[i].render() } return new Promise(function (resolve) { Promise.all(promises).then(function (val) { diff --git a/src/js/modules/url.js b/src/js/modules/url.js index ef85c33..b8a8864 100644 --- a/src/js/modules/url.js +++ b/src/js/modules/url.js @@ -3,7 +3,6 @@ import {urlRegex, lastElement} from './utils' export default function (input, options) { const config = options.linkOptions; return input.replace(urlRegex(), function(match) { - console.log(arguments); if(lastElement(match) === ')') return match; //hack for markdown image let extension = lastElement(match.split('.')); if ((lastElement(match) === '/')) From 76b0584f2b2eb535f35056489471b1dac7f72618 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Sun, 16 Oct 2016 12:47:43 +0530 Subject: [PATCH 05/62] Release v4.1.6 --- CHANGELOG.md | 48 ++++++++++++++++------- bower.json | 2 +- dist/embed.min.js | 6 +-- package.json | 2 +- src/embed.es2015.js | 82 ++++++++++++++++++++++++++++---------- src/embed.es2015.js.map | 2 +- src/embed.js | 87 +++++++++++++++++++++++++++++++---------- src/embed.js.map | 2 +- 8 files changed, 168 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df778fb..29ab3b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [4.1.6](https://github.com/ritz078/embed.js/compare/v4.1.4...v4.1.6) (2016-10-16) + + +### Bug Fixes + +* **string:** allow empty string as input ([3535d75](https://github.com/ritz078/embed.js/commit/3535d75)), closes [#181](https://github.com/ritz078/embed.js/issues/181) + + + ## [4.1.4](https://github.com/ritz078/embed.js/compare/v4.1.3...v4.1.4) (2016-07-14) @@ -17,6 +27,7 @@ * **destroy:** markdown and destroy working as expected + perf ([de45f1b](https://github.com/ritz078/embed.js/commit/de45f1b)) + ### Performance Improvements * changed classes to functions ([764e7c5](https://github.com/ritz078/embed.js/commit/764e7c5)) @@ -28,7 +39,6 @@ - ## [4.1.1](https://github.com/ritz078/embed.js/compare/v4.1.0...v4.1.1) (2016-06-13) @@ -109,6 +119,7 @@ * **umd:** fixed an issue with undefined marked and prismjs ([0bfaf06](https://github.com/ritz078/embed.js/commit/0bfaf06)) * **video:** fixed basic video regex issue ([cab117c](https://github.com/ritz078/embed.js/commit/cab117c)) + ### Features * **es2015:** added es2015 build of the plugin and jsnext:main option in package.json ([36fa93d](https://github.com/ritz078/embed.js/commit/36fa93d)) @@ -117,6 +128,7 @@ * **singleEmbed:** added options to embed only one service from the detected services ([e31ec03](https://github.com/ritz078/embed.js/commit/e31ec03)) * **tests:** moved from mocha to ava ([c8c8bc7](https://github.com/ritz078/embed.js/commit/c8c8bc7)), closes [#118](https://github.com/ritz078/embed.js/issues/118) + ### Performance Improvements * **async/await:** Removed async/await in favour of ES6 promises ([ef473c2](https://github.com/ritz078/embed.js/commit/ef473c2)), closes [#117](https://github.com/ritz078/embed.js/issues/117) @@ -146,6 +158,7 @@ * **package:** corrected main file path ([f49326b](https://github.com/ritz078/embed.js/commit/f49326b)) * **template:** fixed references for this.options.templates. ([daa3cce](https://github.com/ritz078/embed.js/commit/daa3cce)) + ### Features * **core:** Changed templating structure and export class ([c63cc1e](https://github.com/ritz078/embed.js/commit/c63cc1e)) @@ -165,6 +178,7 @@ * **package:** updated package.json ([6913738](https://github.com/ritz078/embed.js/commit/6913738)) * **travis:** added grunt-cli installation to before-install step ([d23e6f8](https://github.com/ritz078/embed.js/commit/d23e6f8)) + ### Performance Improvements * **css:** optimized css and reduced file size ([f3f65c3](https://github.com/ritz078/embed.js/commit/f3f65c3)) @@ -180,6 +194,7 @@ * **release:** fix version number in build files ([aea6b89](https://github.com/ritz078/embed.js/commit/aea6b89)) + ### Features * **changelog:** automated changelog generation using grunt ([f74e5ad](https://github.com/ritz078/embed.js/commit/f74e5ad)) @@ -196,6 +211,7 @@ * **template:** added options as argument in template functions ([45b2208](https://github.com/ritz078/embed.js/commit/45b2208)) * **test:** added some test and refactoring ([fbd58d6](https://github.com/ritz078/embed.js/commit/fbd58d6)) + ### Features * **slideshare:** added slideshare embedding functionality ([d056eda](https://github.com/ritz078/embed.js/commit/d056eda)), closes [#93](https://github.com/ritz078/embed.js/issues/93) @@ -207,7 +223,6 @@ - ## [3.6.1](https://github.com/ritz078/embed.js/compare/3.6.0...3.6.1) (2016-01-03) @@ -227,6 +242,7 @@ * removed function is_short_url as its no longer needed ([74b272c](https://github.com/ritz078/embed.js/commit/74b272c)) * **opengraph:** fixed preference order for opengraph usage with other services ([5d8e545](https://github.com/ritz078/embed.js/commit/5d8e545)) + ### Features * **github:** Added github API integration for repo urls. ([7f727db](https://github.com/ritz078/embed.js/commit/7f727db)), closes [#81](https://github.com/ritz078/embed.js/issues/81) @@ -237,6 +253,7 @@ * **opengraph:** Integrated opengraph support with inline embedding. ([a72784d](https://github.com/ritz078/embed.js/commit/a72784d)), closes [#82](https://github.com/ritz078/embed.js/issues/82) * **release:** added grunt release to automate publishing ([2ff5817](https://github.com/ritz078/embed.js/commit/2ff5817)) + ### Performance Improvements * **package:** updated babel plugin ([1d54b31](https://github.com/ritz078/embed.js/commit/1d54b31)) @@ -251,6 +268,7 @@ * **video:** fixed name of the function for custom video callback. ([348b7de](https://github.com/ritz078/embed.js/commit/348b7de)), closes [#79](https://github.com/ritz078/embed.js/issues/79) + ### Features * **video:** added support for custom click handler and class name for youtube and vimeo ([34d6cb3](https://github.com/ritz078/embed.js/commit/34d6cb3)), closes [#79](https://github.com/ritz078/embed.js/issues/79) @@ -268,6 +286,7 @@ * **options:** Set tweetsEmbed and highlightCode to false by default ([1302d27](https://github.com/ritz078/embed.js/commit/1302d27)) * **video:** fix multiple video playing under same block ([21a7ce6](https://github.com/ritz078/embed.js/commit/21a7ce6)), closes [#76](https://github.com/ritz078/embed.js/issues/76) + ### Features * **.npmignore:** added npmignore to remove files from packaging ([dd5f174](https://github.com/ritz078/embed.js/commit/dd5f174)) @@ -335,6 +354,7 @@ * **bower:** added missing comma in the file ([590f429](https://github.com/ritz078/embed.js/commit/590f429)) * **bower:** unexpected token error ([2880148](https://github.com/ritz078/embed.js/commit/2880148)) + ### Features * **bump:** version updated ([c33a383](https://github.com/ritz078/embed.js/commit/c33a383)) @@ -380,11 +400,12 @@ * **videojs:** Added fluid:true and preload:'metada' as default in video.js options ([cfc0c67](https://github.com/ritz078/embed.js/commit/cfc0c67)) * **webpack-dev:** Removed grunt serve that ran webpack dev server ([36dbc9c](https://github.com/ritz078/embed.js/commit/36dbc9c)) + ### Features * **audio:** Added wav|mp3|ogg embed feature support with video.js ([d270b18](https://github.com/ritz078/embed.js/commit/d270b18)) * **audio:** Support for soundcloud and spotify added ([555ea1b](https://github.com/ritz078/embed.js/commit/555ea1b)) -* **build:** Added support to create custom build of the library by only including the necess ([0e0d0bc](https://github.com/ritz078/embed.js/commit/0e0d0bc)) +* **build:** Added support to create custom build of the library by only including the necessary fun ([0e0d0bc](https://github.com/ritz078/embed.js/commit/0e0d0bc)) * **code:** Moved code analyzing part to separate module and support for ideone added ([973edb9](https://github.com/ritz078/embed.js/commit/973edb9)) * **code-highlighting:** Added support for code highlighting using highlight.js ([0b8ad3f](https://github.com/ritz078/embed.js/commit/0b8ad3f)) * **codepen:** support for codepen embedding added ([882bbc7](https://github.com/ritz078/embed.js/commit/882bbc7)) @@ -421,18 +442,19 @@ * **spotify and soundcloud:** support for spotify and soundcloud embedding added ([5bf6bf0](https://github.com/ritz078/embed.js/commit/5bf6bf0)) * **ted:** Support for Ted video embedding support added ([2b84036](https://github.com/ritz078/embed.js/commit/2b84036)) * **text:** Feature to return processes string added and optional rendering enabled ([b01841e](https://github.com/ritz078/embed.js/commit/b01841e)) -* **twitter:** Added on TweetsLoad function that gets executed after all the tweets have been r ([2ee86b4](https://github.com/ritz078/embed.js/commit/2ee86b4)) +* **twitter:** Added on TweetsLoad function that gets executed after all the tweets have been render ([2ee86b4](https://github.com/ritz078/embed.js/commit/2ee86b4)) * **twitter:** Multiple tweet embed support added ([7a59ecf](https://github.com/ritz078/embed.js/commit/7a59ecf)) * **twitter, custom-icons:** Added support for custom font icons and triggered a renedered event wit ([98fd2e7](https://github.com/ritz078/embed.js/commit/98fd2e7)) * **url:** added buff.ly support to the url module ([12b944f](https://github.com/ritz078/embed.js/commit/12b944f)) * **urlEmbed:** Url class to find and replace links into anchor tags added ([76e8173](https://github.com/ritz078/embed.js/commit/76e8173)) * **ustream:** Support for ustream video embedding added ([4251c65](https://github.com/ritz078/embed.js/commit/4251c65)) -* **video:** Added the feature to embed basic video and use video.js to support in multiple p ([6da36e0](https://github.com/ritz078/embed.js/commit/6da36e0)) +* **video:** Added the feature to embed basic video and use video.js to support in multiple places. ([6da36e0](https://github.com/ritz078/embed.js/commit/6da36e0)) * **video-details:** Feature to disable vimeo and youtube description added ([a138840](https://github.com/ritz078/embed.js/commit/a138840)) * **vimeo:** Support for fetching vimeo data added ([0dff396](https://github.com/ritz078/embed.js/commit/0dff396)) * **vine:** Support for vine added ([20f8cb2](https://github.com/ritz078/embed.js/commit/20f8cb2)) * **youtube:** Support youtube details fetching from the API ([c2c1f9f](https://github.com/ritz078/embed.js/commit/c2c1f9f)) + ### Performance Improvements * match replaced by exec to get the index ([92fb229](https://github.com/ritz078/embed.js/commit/92fb229)) @@ -447,21 +469,20 @@ - ## [2.0.4](https://github.com/ritz078/embed.js/compare/v2.0.3...v2.0.4) (2015-04-19) - ## [2.0.3](https://github.com/ritz078/embed.js/compare/v2.0.2...v2.0.3) (2015-04-08) ### Features -* callback functions added #10 ([4e932e9](https://github.com/ritz078/embed.js/commit/4e932e9)) -* support for a lot of shortened urls added #12 ([5cd9d4b](https://github.com/ritz078/embed.js/commit/5cd9d4b)) +* callback functions added [#10](https://github.com/ritz078/embed.js/issues/10) ([4e932e9](https://github.com/ritz078/embed.js/commit/4e932e9)) +* support for a lot of shortened urls added [#12](https://github.com/ritz078/embed.js/issues/12) ([5cd9d4b](https://github.com/ritz078/embed.js/commit/5cd9d4b)) + ### Performance Improvements @@ -474,29 +495,26 @@ - ## [2.0.1](https://github.com/ritz078/embed.js/compare/v2.0.0-rc.1...v2.0.1) (2015-03-23) - # [2.0.0-rc.1](https://github.com/ritz078/embed.js/compare/v2.0.0...v2.0.0-rc.1) (2015-03-23) - # [2.0.0](https://github.com/ritz078/embed.js/compare/v1.0.0...v2.0.0) (2015-03-23) ### Features -* liveleak support added #7 ([7986722](https://github.com/ritz078/embed.js/commit/7986722)) +* liveleak support added [#7](https://github.com/ritz078/embed.js/issues/7) ([7986722](https://github.com/ritz078/embed.js/commit/7986722)) * spotify support added ([14de673](https://github.com/ritz078/embed.js/commit/14de673)) -* TED support added #7 ([4228ec0](https://github.com/ritz078/embed.js/commit/4228ec0)) -* vine support added #7 ([e7aa9c1](https://github.com/ritz078/embed.js/commit/e7aa9c1)) +* TED support added [#7](https://github.com/ritz078/embed.js/issues/7) ([4228ec0](https://github.com/ritz078/embed.js/commit/4228ec0)) +* vine support added [#7](https://github.com/ritz078/embed.js/issues/7) ([e7aa9c1](https://github.com/ritz078/embed.js/commit/e7aa9c1)) diff --git a/bower.json b/bower.json index 28036dd..a2a3a61 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.4", + "version": "4.1.6", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "main": [ "./src/embed.css", diff --git a/dist/embed.min.js b/dist/embed.min.js index 7c915a7..5127868 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -1,10 +1,10 @@ /* - * embed-js - v4.1.4 + * embed-js - v4.1.6 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * * Made by Ritesh Kumar * Under MIT License */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,W),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function k(a,b){b=b||{};var c=b.body;if(k.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new d(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new d(b.headers)),this.method=j(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function l(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function m(a){var b=new d,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function n(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof d?b.headers:new d(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){d.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},d.prototype["delete"]=function(a){delete this.map[b(a)]},d.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},d.prototype.getAll=function(a){return this.map[b(a)]||[]},d.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},d.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},d.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)};var o={blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a},p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];k.prototype.clone=function(){return new k(this)},i.call(k.prototype),i.call(n.prototype),n.prototype.clone=function(){return new n(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},n.error=function(){var a=new n(null,{status:0,statusText:""});return a.type="error",a};var q=[301,302,303,307,308];n.redirect=function(a,b){if(q.indexOf(b)===-1)throw new RangeError("Invalid status code");return new n(null,{status:b,headers:{location:a}})},a.Headers=d,a.Request=k,a.Response=n,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=k.prototype.isPrototypeOf(a)&&!b?a:new k(a,b);var g=new XMLHttpRequest; -g.onload=function(){var a=1223===g.status?204:g.status;if(a<100||a>599)return void d(new TypeError("Network request failed"));var b={status:a,statusText:g.statusText,headers:m(g),url:e()},f="response"in g?g.response:g.responseText;c(new n(f,b))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&o.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"]; +l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype),o.prototype.clone=function(){return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;f 599) { - reject(new TypeError('Network request failed')) - return - } var options = { - status: status, + status: xhr.status, statusText: xhr.statusText, headers: headers(xhr), url: responseURL() diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map index 1ae2956..9db14ce 100644 --- a/src/embed.es2015.js.map +++ b/src/embed.es2015.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,Q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c,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,E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5 +1,5 @@ /* - * embed-js - v4.1.4 + * embed-js - v4.1.6 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * @@ -926,6 +926,21 @@ var Twitter = function () { return; } + var support = { + searchParams: 'URLSearchParams' in self, + iterable: 'Symbol' in self && 'iterator' in Symbol, + blob: 'FileReader' in self && 'Blob' in self && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: 'FormData' in self, + arrayBuffer: 'ArrayBuffer' in self + }; + function normalizeName(name) { if (typeof name !== 'string') { name = String(name); @@ -943,6 +958,24 @@ var Twitter = function () { return value; } + // Build a destructive iterator for the value list + function iteratorFor(items) { + var iterator = { + next: function next() { + var value = items.shift(); + return { done: value === undefined, value: value }; + } + }; + + if (support.iterable) { + iterator[Symbol.iterator] = function () { + return iterator; + }; + } + + return iterator; + } + function Headers(headers) { this.map = {}; @@ -997,6 +1030,34 @@ var Twitter = function () { }, this); }; + Headers.prototype.keys = function () { + var items = []; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + + Headers.prototype.values = function () { + var items = []; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + + Headers.prototype.entries = function () { + var items = []; + this.forEach(function (value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + function consumed(body) { if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')); @@ -1027,19 +1088,6 @@ var Twitter = function () { return fileReaderReady(reader); } - var support = { - blob: 'FileReader' in self && 'Blob' in self && function () { - try { - new Blob(); - return true; - } catch (e) { - return false; - } - }(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - function Body() { this.bodyUsed = false; @@ -1051,6 +1099,8 @@ var Twitter = function () { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); } else if (!body) { this._bodyText = ''; } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) { @@ -1065,6 +1115,8 @@ var Twitter = function () { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; @@ -1268,13 +1320,8 @@ var Twitter = function () { } xhr.onload = function () { - var status = xhr.status === 1223 ? 204 : xhr.status; - if (status < 100 || status > 599) { - reject(new TypeError('Network request failed')); - return; - } var options = { - status: status, + status: xhr.status, statusText: xhr.statusText, headers: headers(xhr), url: responseURL() diff --git a/src/embed.js.map b/src/embed.js.map index cc3ae60..13b80a8 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","normalizeName","name","String","test","TypeError","normalizeValue","value","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","support","Blob","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","shift","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","items","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,OAAOL,MAAxC,GAAkDA,MAAzD;;;;;;;;;AASJ,AAAO,SAASM,UAAT,CAAoBC,WAApB,EAAiCC,MAAjC,EAAyC;SACvC,IAAIC,QAAT,IAAqBD,MAArB,EAA6B;YACrBA,OAAOE,cAAP,CAAsBD,QAAtB,KAAmCD,OAAOC,QAAP,CAAnC,IAAuDD,OAAOC,QAAP,EAAiBE,WAAjB,KAAiCC,MAA5F,EAAoG;wBACpFH,QAAZ,IAAwBF,YAAYE,QAAZ,KAAyB,EAAjD;uBACWF,YAAYE,QAAZ,CAAX,EAAkCD,OAAOC,QAAP,CAAlC;SAFJ,MAGO;wBACSA,QAAZ,IAAwBD,OAAOC,QAAP,CAAxB;;;WAGDF,WAAP;;;AAGJ,AAAO,SAASM,YAAT,CAAsBC,GAAtB,EAA2B;WACvBA,IAAIC,OAAJ,CAAY,oCAAZ,EAAkD,MAAlD,CAAP;;;;;;;;AAQJ,SAASC,UAAT,CAAoBC,GAApB,EAAyB;WACdA,IAAIC,IAAJ,CAAS,UAACC,CAAD,EAAIC,CAAJ;eAAWD,EAAEE,KAAF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AStK,CAAT,CAAhB;cACUA,CAAV,IAAe,IAAI+Y,OAAJ,CAAYxY,OAAZ,EAAqB4E,WAArB,CAAf;aACSnF,CAAT,IAAc6Y,UAAU7Y,CAAV,EAAasb,MAAb,EAAd;;UAEM,IAAIvT,OAAJ,CAAY,UAAUC,OAAV,EAAmB;YAC7ByD,GAAR,CAAYD,QAAZ,EAAsBF,IAAtB,CAA2B,UAAU9F,GAAV,EAAe;aACjCA,GAAR;KADD;IADM,CAAP;;;;;;;;;;mCAWuB;QAClB,IAAIxF,IAAI,CAAb,EAAgBA,IAAI6Y,UAAUna,MAA9B,EAAsCsB,GAAtC,EAA2C;cAChCA,CAAV,EAAaub,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIvb,IAAI,CAAb,EAAgBA,IAAI8Y,aAAapa,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBub,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV3H,QAAP;;;;;;;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,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A0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file From b9f566faf9d87c6a0548d010b180dac51ec35962 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 26 Oct 2016 21:38:30 +0530 Subject: [PATCH 06/62] fix(soundcloud): wrong soundcloud URLs fixes #188 --- dist/embed.min.js | 4 ++-- src/embed.es2015.js | 13 ++----------- src/embed.es2015.js.map | 2 +- src/embed.js | 4 ++-- src/embed.js.map | 2 +- src/js/main.js | 2 +- src/js/modules/template.js | 11 +---------- 7 files changed, 10 insertions(+), 28 deletions(-) diff --git a/dist/embed.min.js b/dist/embed.min.js index 5127868..8f72d36 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -6,5 +6,5 @@ * Made by Ritesh Kumar * Under MIT License */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,W),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"]; -l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype),o.prototype.clone=function(){return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype),o.prototype.clone=function(){ +return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;f - + ` }, @@ -1873,7 +1864,7 @@ let promises = []; class EmbedJS { /** - * The constructor takes two arguements. The first one is the options object and the second one is the + * The constructor takes two arguments. The first one is the options object and the second one is the * optional string . If the user wants to provide a string directly instead of the element, he can do that. * In case the user provides both the input element and the string, the input string will be taken from the element * and the provided string won't be processed. diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map index 9db14ce..a69c9f0 100644 --- a/src/embed.es2015.js.map +++ b/src/embed.es2015.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;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AAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE;YAChG,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;SACvD,MAAM;YACH,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC5C;KACJ;IACD,OAAO,WAAW,CAAC;CACtB;;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EAAE,CAAC,EAAE,EAAE;GACzC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;GAC5B,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,OAAO,EAAEA,WAAQ,CAAC,CAAC;GAC9C,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;GACnC;EACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE;GACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE;IACzC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js index a232218..c9deb8b 100644 --- a/src/embed.js +++ b/src/embed.js @@ -262,7 +262,7 @@ var renderer = { }, soundcloud: function soundcloud(match, options) { var config = options.soundCloudOptions; - return '
\n\t\t\n\t\t
'; + return '
\n\t\t\n\t\t
'; }, spotify: function spotify(match) { var id = lastElement(match.split('/')); @@ -1987,7 +1987,7 @@ var promises = []; var EmbedJS = function () { /** - * The constructor takes two arguements. The first one is the options object and the second one is the + * The constructor takes two arguments. The first one is the options object and the second one is the * optional string . If the user wants to provide a string directly instead of the element, he can do that. * In case the user provides both the input element and the string, the input string will be taken from the element * and the provided string won't be processed. diff --git a/src/embed.js.map b/src/embed.js.map index 13b80a8..b238174 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguements. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,OAAOL,MAAxC,GAAkDA,MAAzD;;;;;;;;;AASJ,AAAO,SAASM,UAAT,CAAoBC,WAApB,EAAiCC,MAAjC,EAAyC;SACvC,IAAIC,QAAT,IAAqBD,MAArB,EAA6B;YACrBA,OAAOE,cAAP,CAAsBD,QAAtB,KAAmCD,OAAOC,QAAP,CAAnC,IAAuDD,OAAOC,QAAP,EAAiBE,WAAjB,KAAiCC,MAA5F,EAAoG;wBACpFH,QAAZ,IAAwBF,YAAYE,QAAZ,KAAyB,EAAjD;uBACWF,YAAYE,QAAZ,CAAX,EAAkCD,OAAOC,QAAP,CAAlC;SAFJ,MAGO;wBACSA,QAAZ,IAAwBD,OAAOC,QAAP,CAAxB;;;WAGDF,WAAP;;;A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qB,uEAAVoP,QAAU;;OAChEjK,WAAWhD,SAASyU,gBAAT,CAA0BD,YAA1B,CAAf;QACK,IAAI9b,IAAI,CAAb,EAAgBA,IAAIsK,SAAS5L,MAA7B,EAAqCsB,GAArC,EAA0C;YACjCI,KAAR,GAAgBkK,SAAStK,CAAT,CAAhB;cACUA,CAAV,IAAe,IAAIyZ,OAAJ,CAAYlZ,OAAZ,EAAqB4E,WAArB,CAAf;aACSnF,CAAT,IAAcuZ,UAAUvZ,CAAV,EAAagc,MAAb,EAAd;;UAEM,IAAIjU,OAAJ,CAAY,UAAUC,OAAV,EAAmB;YAC7ByD,GAAR,CAAYD,QAAZ,EAAsBF,IAAtB,CAA2B,UAAU9F,GAAV,EAAe;aACjCA,GAAR;KADD;IADM,CAAP;;;;;;;;;;mCAWuB;QAClB,IAAIxF,IAAI,CAAb,EAAgBA,IAAIuZ,UAAU7a,MAA9B,EAAsCsB,GAAtC,EAA2C;cAChCA,CAAV,EAAaic,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIjc,IAAI,CAAb,EAAgBA,IAAIwZ,aAAa9a,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBic,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,G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EAAaic,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIjc,IAAI,CAAb,EAAgBA,IAAIwZ,aAAa9a,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBic,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index 14992ad..46c7799 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -136,7 +136,7 @@ let promises = []; export default class EmbedJS { /** - * The constructor takes two arguements. The first one is the options object and the second one is the + * The constructor takes two arguments. The first one is the options object and the second one is the * optional string . If the user wants to provide a string directly instead of the element, he can do that. * In case the user provides both the input element and the string, the input string will be taken from the element * and the provided string won't be processed. diff --git a/src/js/modules/template.js b/src/js/modules/template.js index 8472a15..f420dc8 100644 --- a/src/js/modules/template.js +++ b/src/js/modules/template.js @@ -21,16 +21,7 @@ export default { soundcloud(match, options){ let config = options.soundCloudOptions; return `
- +
` }, From 966ddf68be83f78a4e0eb26050e076acab810acc Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 26 Oct 2016 21:43:52 +0530 Subject: [PATCH 07/62] docs(dev): added grunt tasks info closes #186 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0338dab..4674f03 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,16 @@ x.destroy() 1. Pass the emoji name as the value to `customEmoji`. See the example [here](https://embedjs.readme.io/docs/options#customemoji) 1. Run `grunt build-emoji && grunt build` +## Development +1. Fork the repo +1. create a branch +1. Create a PR + +### grunt tasks +`grunt` : starts development server and watches files for changes. Run this for development purpose. +`grunt dist` : create dist directory with all the different build files +`grunt build-emoji` : create spritesheet from all the emojis. Only run if you have made some changes related to emojis + ## License MIT © [Ritesh Kumar](https://github.com/ritz078) From 68097ab0a15137af87b4fa698424703215952c8d Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 26 Oct 2016 21:48:53 +0530 Subject: [PATCH 08/62] Release v4.1.7 --- CHANGELOG.md | 10 ++++++++++ bower.json | 2 +- dist/embed.min.js | 2 +- package.json | 2 +- src/embed.es2015.js | 2 +- src/embed.js | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29ab3b4..8382e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [4.1.7](https://github.com/ritz078/embed.js/compare/v4.1.6...v4.1.7) (2016-10-26) + + +### Bug Fixes + +* **soundcloud:** wrong soundcloud URLs ([b9f566f](https://github.com/ritz078/embed.js/commit/b9f566f)), closes [#188](https://github.com/ritz078/embed.js/issues/188) + + + ## [4.1.6](https://github.com/ritz078/embed.js/compare/v4.1.4...v4.1.6) (2016-10-16) diff --git a/bower.json b/bower.json index a2a3a61..bf6e0e3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.6", + "version": "4.1.7", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "main": [ "./src/embed.css", diff --git a/dist/embed.min.js b/dist/embed.min.js index 8f72d36..b0c5c97 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.6 + * embed-js - v4.1.7 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/package.json b/package.json index 411282f..5f0e7d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.6", + "version": "4.1.7", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "keywords": [ "JavaScript-plugin", diff --git a/src/embed.es2015.js b/src/embed.es2015.js index 9833343..382144e 100644 --- a/src/embed.es2015.js +++ b/src/embed.es2015.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.6 + * embed-js - v4.1.7 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/src/embed.js b/src/embed.js index c9deb8b..e050d65 100644 --- a/src/embed.js +++ b/src/embed.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.6 + * embed-js - v4.1.7 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * From 47011aa138451c528b4af9d00347fff096251ce8 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 26 Oct 2016 21:52:48 +0530 Subject: [PATCH 09/62] Release v4.1.10 --- CHANGELOG.md | 5 +++++ bower.json | 2 +- dist/embed.min.js | 2 +- package.json | 2 +- src/embed.es2015.js | 2 +- src/embed.js | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8382e8f..ab0ea6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +## [4.1.10](https://github.com/ritz078/embed.js/compare/v4.1.7...v4.1.10) (2016-10-26) + + + ## [4.1.7](https://github.com/ritz078/embed.js/compare/v4.1.6...v4.1.7) (2016-10-26) diff --git a/bower.json b/bower.json index bf6e0e3..b1ac4c0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.7", + "version": "4.1.10", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "main": [ "./src/embed.css", diff --git a/dist/embed.min.js b/dist/embed.min.js index b0c5c97..4ed4292 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.7 + * embed-js - v4.1.10 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/package.json b/package.json index 5f0e7d2..5a968eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embed-js", - "version": "4.1.7", + "version": "4.1.10", "description": "A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services.", "keywords": [ "JavaScript-plugin", diff --git a/src/embed.es2015.js b/src/embed.es2015.js index 382144e..06afea2 100644 --- a/src/embed.es2015.js +++ b/src/embed.es2015.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.7 + * embed-js - v4.1.10 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * diff --git a/src/embed.js b/src/embed.js index e050d65..464ff36 100644 --- a/src/embed.js +++ b/src/embed.js @@ -1,5 +1,5 @@ /* - * embed-js - v4.1.7 + * embed-js - v4.1.10 * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. * http://riteshkr.com/embed.js * From 53214601589b297cd1738bb6b642fb92f8a1144f Mon Sep 17 00:00:00 2001 From: Robert Michalski Date: Tue, 3 Jan 2017 13:48:54 +0100 Subject: [PATCH 10/62] Made input of /embed/ into match of ustream url conditional and added example url into demo app, closes #192. --- demo/index.html | 2 +- src/js/modules/template.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/demo/index.html b/demo/index.html index ad0fbdb..2a00a34 100644 --- a/demo/index.html +++ b/demo/index.html @@ -52,7 +52,7 @@

Loading embed.js in a block

if student.triedHard then "B" else "B-" else "C" ``` - consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus https://github.com/ritz078/embed.js/issues/82 , voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto https://soundcloud.com/the-bugle/bugle-179-playas-gon-play minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora http://open.spotify.com/track/4th1RQAelzqgY7wL53UGQt doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium https://vine.co/v/bjHh0zHdgZT molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est nobis vero incidunt quod earum totam, corporis voluptatibus https://vimeo.com/119199079 ab voluptate nesciunt consequuntur eligendi natus voluptatem obcaecati quo. Dolor nostrum vel commodi! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia velit ipsam eos facere http://www.dailymotion.com/video/x2k8un2_2015-wc-nz-vs-wi-holder-reacts-on-guptills-237_sport molestias explicabo quia odit dignissimos ipsa iusto enim, harum debitis neque amet, optio voluptatum odio nisi eius. + consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus https://github.com/ritz078/embed.js/issues/82 , voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto https://soundcloud.com/the-bugle/bugle-179-playas-gon-play minima quod vel. Dicta accusantium molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cum quos numquam, error optio voluptatibus, voluptates debitis dolorum possimus ducimus recusandae cupiditate. Veritatis cumque laboriosam debitis numquam iste amet provident vero. Lorem ipsum dolor sit amet, consectetur adipisicing elit. A, cupiditate fugiat, nemo asperiores tempora http://open.spotify.com/track/4th1RQAelzqgY7wL53UGQt doloribus neque, molestias, harum consequuntur molestiae magnam officia quos facere tenetur dignissimos animi beatae. Eius, ipsum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit porro voluptas, nam doloremque, incidunt architecto minima quod vel. Dicta accusantium https://vine.co/v/bjHh0zHdgZT molestias quaerat ut, nostrum, quidem id sapiente adipisci ullam architecto. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est nobis vero incidunt quod earum totam, corporis voluptatibus https://vimeo.com/119199079 ab voluptate nesciunt consequuntur eligendi natus voluptatem obcaecati quo. Dolor nostrum vel commodi! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia velit ipsam eos facere http://www.dailymotion.com/video/x2k8un2_2015-wc-nz-vs-wi-holder-reacts-on-guptills-237_sport molestias explicabo quia odit dignissimos ipsa iusto enim, harum debitis neque amet, http://www.ustream.tv/embed/1524 optio voluptatum odio nisi eius.
Cur rumor nocere?Emeritis adelphis satis perderes domina est.Gloss cadunt in bi-color brema! @(IIT Roorkee) Bi-color habitio virtualiter imitaris amicitia est.Teres tatas ducunt ad racana.Genetrixs prarere in rugensis civitas! :) Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut numquam asperiores nobis repellat modi iusto, possimus excepturi atque, quae doloribus nihil corrupti minima quasi, sed? Vero labore cumque laudantium quisquam! https://www.instagram.com/p/_JHaOcjJ7h/?taken-by=9gag Lorem ipsum dolor sit amet, consectetur adipisicing elit. Similique blanditiis architecto tempore minima vero adipisci reiciendis ratione numquam quas perferendis maxime iste, commodi cumque quis praesentium quasi, a neque temporibus? https://www.instagram.com/p/-mIWFsIVV-/?taken-by=natgeo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto quis vitae cupiditate quam accusamus facere maxime ab distinctio tempore, voluptates itaque culpa amet placeat alias provident corporis, blanditiis explicabo perspiciatis. https://www.flickr.com/photos/43301211@N03/23331635460/in/explore-2015-12-09/ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum quasi sit et nam magni ab asperiores tempore, http://www.slideshare.net/haraldf/business-quotes-for-2011 impedit, tempora officiis rerum modi labore vitae explicabo eos aperiam sequi facilis neque. diff --git a/src/js/modules/template.js b/src/js/modules/template.js index f420dc8..f26e9de 100644 --- a/src/js/modules/template.js +++ b/src/js/modules/template.js @@ -89,7 +89,10 @@ export default { ustream(match, options){ let id = match.split('/'); - id.splice(1, 0, 'embed'); + // only add embed if it is not already in the link + if( match.indexOf('/embed/') < 0 ) { + id.splice(1, 0, 'embed'); + } return `
` }, From 49de6e8cb17626c7e494e6be77804964aba31a2b Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 25 Jan 2017 14:37:57 +0530 Subject: [PATCH 11/62] docs(coc): added code of conduct --- CODE_OF_CONDUCT.md | 15 +++++++++++++++ README.md | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c2ebaab --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,15 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. + +This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.1.0, available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/) diff --git a/README.md b/README.md index 4674f03..e962cd2 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ x.destroy() 1. create a branch 1. Create a PR +**Note**: This projects adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). + ### grunt tasks `grunt` : starts development server and watches files for changes. Run this for development purpose. `grunt dist` : create dist directory with all the different build files From 900c528d9260a71c1e391aeee04077bde9fa7afc Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 25 Jan 2017 19:38:59 +0530 Subject: [PATCH 12/62] fix(template): extend template instead of replacing --- dist/embed.min.js | 4 ++-- src/embed.es2015.js | 7 +++++-- src/embed.es2015.js.map | 2 +- src/embed.js | 7 +++++-- src/embed.js.map | 2 +- src/js/main.js | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dist/embed.min.js b/dist/embed.min.js index 4ed4292..dd07308 100644 --- a/dist/embed.min.js +++ b/dist/embed.min.js @@ -6,5 +6,5 @@ * Made by Ritesh Kumar * Under MIT License */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.EmbedJS=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports,W),b.exports}function b(a,b){return a.substr(0,b-1)+(a.length>b?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype),o.prototype.clone=function(){ -return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return a.indexOf("/embed/")<0&&c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype), +o.prototype.clone=function(){return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=d(Y,c),"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;f
` }, @@ -1888,7 +1891,7 @@ class EmbedJS { //object while creating a new instance of embed.js this.options = deepExtend(globOptions, options); - this.options.template = template$$1 || renderer; + this.options.template = deepExtend(renderer, template$$1); if (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map index a69c9f0..d9d2506 100644 --- a/src/embed.es2015.js.map +++ b/src/embed.es2015.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG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zC,OAAO,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;GACF,CAAC;EACF;;;;;;CAMD,OAAO,cAAc,GAAG;EACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACtB;EACD;;;;;;CAMD,OAAO,UAAU,GAAG;EACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC7C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\t// only add embed if it is not already in the link\n\t\tif( match.indexOf('/embed/') < 0 ) {\n\t\t\tid.splice(1, 0, 'embed');\n\t\t}\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = deepExtend(renderer, template);\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,M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C,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;GACzB;EACD;;;;;;;;;;;;;;;;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js index 464ff36..9c487f6 100644 --- a/src/embed.js +++ b/src/embed.js @@ -314,7 +314,10 @@ var renderer = { }, ustream: function ustream(match, options) { var id = match.split('/'); - id.splice(1, 0, 'embed'); + // only add embed if it is not already in the link + if (match.indexOf('/embed/') < 0) { + id.splice(1, 0, 'embed'); + } return '
'; }, detailsVimeo: function detailsVimeo(data, fullData, embedUrl) { @@ -2013,7 +2016,7 @@ var EmbedJS = function () { //object while creating a new instance of embed.js this.options = deepExtend(globOptions, options); - this.options.template = template$$1 || renderer; + this.options.template = deepExtend(renderer, template$$1); if (!(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); diff --git a/src/embed.js.map b/src/embed.js.map index b238174..63875c3 100644 --- a/src/embed.js.map +++ b/src/embed.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,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;iBAChCA,CAAb,EAAgBic,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\t// only add embed if it is not already in the link\n\t\tif( match.indexOf('/embed/') < 0 ) {\n\t\t\tid.splice(1, 0, 'embed');\n\t\t}\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = deepExtend(renderer, template);\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,OAAOL,MAAxC,GAAkDA,MAAzD;;;;;;;;;AASJ,AAAO,SAASM,UAAT,CAAoBC,WAApB,EAAiCC,MAAjC,EAAyC;SACvC,IAAIC,QAAT,IAAqBD,MAArB,EAA6B;YACrBA,OAAOE,cAAP,CAAsBD,QAAtB,KAAmCD,OAAOC,QAAP,CAAnC,IAAuDD,OAAOC,QAAP,EAAiBE,WAAjB,KAAiCC,MAA5F,EAAoG;wBACpFH,QAAZ,IAAwBF,YAAYE,QAAZ,KAAyB,EAAjD;uBACWF,YAAYE,QAAZ,CAAX,EAAkCD,OAAOC,QAAP,CAAlC;SAFJ,MAGO;wBACSA,QAAZ,IAAwBD,OAAOC,QAAP,CAAxB;;;WAGDF,WAAP;;;AAGJ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;;;;;;;;;;+BAUmBub,cAAiD;OAAnCvb,OAAmC,uEAAzB,EAAyB;OAArB4E,WAAqB,uEAAVoP,QAAU;;OAChEjK,WAAWhD,SAASyU,gBAAT,CAA0BD,YAA1B,CAAf;QACK,IAAI9b,IAAI,CAAb,EAAgBA,IAAIsK,SAAS5L,MAA7B,EAAqCsB,GAArC,EAA0C;YACjCI,KAAR,GAAgBkK,SAAStK,CAAT,CAAhB;cACUA,CAAV,IAAe,IAAIyZ,OAAJ,CAAYlZ,OAAZ,EAAqB4E,WAArB,CAAf;aACSnF,CAAT,IAAcuZ,UAAUvZ,CAAV,EAAagc,MAAb,EAAd;;UAEM,IAAIjU,OAAJ,CAAY,UAAUC,OAAV,EAAmB;YAC7ByD,GAAR,CAAYD,QAAZ,EAAsBF,IAAtB,CAA2B,UAAU9F,GAAV,EAAe;aACjCA,GAAR;KADD;IADM,CAAP;;;;;;;;;;mCAWuB;QAClB,IAAIxF,IAAI,CAAb,EAAgBA,IAAIuZ,UAAU7a,MAA9B,EAAsCsB,GAAtC,EAA2C;cAChCA,CAAV,EAAaic,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIjc,IAAI,CAAb,EAAgBA,IAAIwZ,aAAa9a,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBic,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index 46c7799..a9c148e 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -160,7 +160,7 @@ export default class EmbedJS { //object while creating a new instance of embed.js this.options = deepExtend(globOptions, options); - this.options.template = template || renderer; + this.options.template = deepExtend(renderer, template); if (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); From f4db469602690dbf9da2a3717db87e18593a33d0 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 25 Jan 2017 19:55:17 +0530 Subject: [PATCH 13/62] build(dist): exclude dist from github fixes #185 --- .gitignore | 2 +- Gruntfile.js | 6 +- demo/index.html | 2 +- dist/embed.min.js | 4 +- package.json | 12 +- rollup.es2015.config.js | 2 +- rollup.umd.config.js | 2 +- src/embed.css | 3776 --------------------------------------- src/embed.css.map | 7 - src/embed.es2015.js | 2152 ---------------------- src/embed.es2015.js.map | 1 - src/embed.js | 2461 ------------------------- src/embed.js.map | 1 - 13 files changed, 18 insertions(+), 8410 deletions(-) delete mode 100644 src/embed.css delete mode 100644 src/embed.css.map delete mode 100644 src/embed.es2015.js delete mode 100644 src/embed.es2015.js.map delete mode 100644 src/embed.js delete mode 100644 src/embed.js.map diff --git a/.gitignore b/.gitignore index c550d80..58a8995 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,8 @@ node_modules/ .tmp/ npm-debug.log .DS_Store -src/jquery.embed.js embed.js.sublime-project embed.js.sublime-workspace .sass-cache bower_components +dist diff --git a/Gruntfile.js b/Gruntfile.js index c55b609..156868e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -95,7 +95,7 @@ module.exports = function (grunt) { style: 'expanded' }, files : { - 'src/embed.css': 'src/css/embed.scss' + 'dist/embed.css': 'src/css/embed.scss' } } }, @@ -117,7 +117,7 @@ module.exports = function (grunt) { }, build : { files: { - 'dist/embed.min.js': 'src/embed.js' + 'dist/embed.min.js': 'dist/embed.js' } } }, @@ -146,7 +146,7 @@ module.exports = function (grunt) { 'string-replace': { dist: { files : { - '.tmp/embed.css': 'src/embed.css' + '.tmp/embed.css': 'dist/embed.css' }, options: { replacements: [{ diff --git a/demo/index.html b/demo/index.html index 2a00a34..48a2e74 100644 --- a/demo/index.html +++ b/demo/index.html @@ -63,7 +63,7 @@

Loading embed.js in a block

- + ',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;fb?"...":"")}function c(a){return a.indexOf("//")===-1?"//"+a:a}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&b[c].constructor===Object?(a[c]=a[c]||{},d(a[c],b[c])):a[c]=b[c];return a}function e(a){return a.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function f(a){return a.sort(function(a,b){return a.index-b.index})}function g(a,b){for(var c=f(b),d=0;d=0||"all"===a.inlineEmbed}function k(a){return a.videoWidth=a.videoWidth||a.videoHeight/3*4||800,a.videoHeight=a.videoHeight||a.videoWidth/4*3||600,a}function l(a){if(null===a||"object"!==("undefined"==typeof a?"undefined":X["typeof"](a)))return a;var b=a.constructor();for(var c in a)b[c]=l(a[c]);return b}function m(){return/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi}function n(a,b){return"string"!=typeof a[b]&&(a[b]=a[b].map(function(a){return a.toLowerCase()})),a}function o(a){return a=k(a),a=n(a,"excludeEmbed"),a=n(a,"inlineEmbed"),n(a,"openGraphExclude")}function p(a){return a[a.length-1]}function q(a){return":"===a[0]&&":"===p(a)&&a.substring(1,a.length-1)}function r(a,b){return b.template.vimeo(a,b)||b.template.youtube(a,b)}function s(a){if(a.customVideoClickHandler)return a.videoClickHandler(a,r);for(var b=document.getElementsByClassName(a.videoClickClass),c=0;c]*"+a.regex.source+")","gm"):new RegExp("([^\\s]*"+a.regex.source+")","gm");return a.output=a.output.replace(b,function(b){var c=a.options.link?b.slice(0,-4):b;return a.options.served.indexOf(c)===-1?(a.options.served.push(c),a.options.link?a.options.inlineText?b+a.template(b.slice(0,-4)):a.template(b.slice(0,-4))+"":a.options.inlineText?b+a.template(b):a.template(b)):b}),[a.output,a.embeds]}function v(a){for(var b=void 0;null!==(b=h(a.regex,a.input));){var c=b[0];if(!(a.options.served.indexOf(c)!==-1||a.options.served.length&&a.options.singleEmbed)){a.options.served.push(c);var d=a.template(c);a.embeds.push({text:d,index:b.index})}}return[a.output,a.embeds]}function w(a){return j(a.options,a.service)?u(a):v(a)}function x(a,b,c,d,e,f,g){return i(d,f)||i(d,f)&&g?ha(a,b,c,d,e,f):[b,c]}function y(a,b,c){var d=(a.options.link?c[0].slice(0,-4):c[0])||c[1];return a.options.served.indexOf(d)>=0?Promise.resolve(null):new Promise(function(e){b(a,c,d).then(function(b){return b?(a.options.served.push(d),void e(b)):e()})})}function z(a,b){for(var c=a.options.link?new RegExp("([^>]*"+a.regex.source+")","gi"):new RegExp("([^\\s]*"+a.regex.source+")","gi"),d=void 0,e=[];null!==(d=h(c,a.output));)e.push(y(a,b,d));return new Promise(function(b){h.length?Promise.all(e).then(function(d){var e=0;a.output=a.output.replace(c,function(b){return a.options.link?a.options.inlineText?b+d[e++]:d[e]+"":a.options.inlineText?b+d[e++]:d[e]}),b(a.output)}):b(a.output)})}function A(a,b,c){var d=c[0];if(!(a.options.served.indexOf(d)>=0))return new Promise(function(e){b(a,c,d,!0).then(function(b){b||e(),a.options.served.push(d),a.embeds.push({text:b,index:c.index}),e()})})}function B(a,b){for(var c=void 0,d=[];null!==(c=h(a.regex,a.input));)d.push(A(a,b,c));return new Promise(function(b){Promise.all(d).then(function(){b(a.embeds)})})}function C(a,b){return new Promise(function(c){j(a.options,a.service)?z(a,b).then(function(b){return c([b,a.embeds])}):B(a,b).then(function(b){return c([a.output,b])})})}function D(a){var b="http://maps.googleapis.com/maps/api/geocode/json?address="+a+"&sensor=false";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a([b.results[0].geometry.location.lat,b.results[0].geometry.location.lng])})})}function E(a,b,c,d){var e=F(a);return d.template.gmap(b,c,e,d)}function F(a){return a.split("(")[1].split(")")[0]}function G(a){return a=a.replace(/&/gm,""),a=a.replace(/</g,"<"),a=a.replace(/>/g,">")}function H(a){return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,"")}function I(a,b){return'
'+(a.value||a)+"
"}function J(a){return{title:a.snippet.title,thumbnail:a.snippet.thumbnails.medium.url,rawDescription:a.snippet.description,views:a.statistics.viewCount,likes:a.statistics.likeCount,description:b(a.snippet.description,150),url:"https://www.youtube.com/watch?v="+a.id,id:a.id,host:"youtube"}}function K(a,b){var c="https://www.googleapis.com/youtube/v3/videos?id="+a+"&key="+b.googleAuthKey+"&part=snippet,statistics";return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(b){return a(b.items[0])})})}function L(a,b,c,d){var e=d?b[1]:b[2],f="https://www.youtube.com/embed/"+e;return a.options.videoDetails?new Promise(function(b){K(e,a.options).then(function(c){return b(ea(J(c),c,f,a.options))})}):new Promise(function(b){return b(r(f,a.options))})}function M(a,b){return{title:a.title,thumbnail:a.thumbnail_medium,rawDescription:a.description.replace(/\n/g,"
").replace(/ /g,"
"),views:a.stats_number_of_plays,likes:a.stats_number_of_likes,description:b(a.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g," "),150),url:a.url,id:a.id,host:"vimeo"}}function N(a){var b="https://vimeo.com/api/v2/video/"+a+".json";return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b[0])})})}function O(a,c,d,e){var f=void 0;if(f=e?c[3]:a.options.link?c[0].slice(0,-4).split("/").slice(-1).pop():c[0].split("/").slice(-1).pop()){var g="https://player.vimeo.com/video/"+f;return a.options.videoDetails?new Promise(function(c){N(f).then(function(d){return c(ea(M(d,b),d,g,a.options))})}):new Promise(function(b){return b(r(g,a.options))})}}function P(a,b){var c="http://www.slideshare.net/api/oembed/2?url="+b+"&format=jsonp&maxwidth="+a.options.videoWidth+"&maxheight="+a.options.videoHeight;return new Promise(function(a){da(c,{credentials:"include"}).then(function(a){return a.json()}).then(function(b){return a(b.html)})})}function Q(a,b,c){return new Promise(function(b){P(a,c).then(function(c){return b(a.template(c))})})}function R(a,b){a=encodeURIComponent(a);var c=new Function("url","return `"+b.options.openGraphEndpoint+"`")(a);return new Promise(function(a){fetch(c).then(function(a){return a.json()}).then(function(c){return a(b.options.onOpenGraphFetch(c)||c)})})}function S(a,b,c){return c.match(a.excludeRegex)?Promise.resolve():new Promise(function(b){R(c,a).then(function(c){return b(c&&c.success?a.template(c):"")})})}function T(a,b){return b.template.github(a,b)}function U(a){var b="https://api.github.com/repos/"+a.user+"/"+a.repo;return new Promise(function(a){fetch(b).then(function(a){return a.json()}).then(function(b){return a(b)})})}function V(a,b,c,d){var e=d?{user:b[1],repo:b[2]}:{user:b[2],repo:b[3]};if(e.repo)return new Promise(function(b){U(e).then(function(c){return b(T(c,a.options))})})}var W="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,X={};X["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},X.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},X.createClass=function(){function a(a,b){for(var c=0;c'+a+""},smiley:function(a,b,c){return''+b+c+""},emoji:function(a){return''},audio:function(a){return'
'},soundcloud:function(a,b){var c=b.soundCloudOptions;return'
\n\t\t\n\t\t
'},spotify:function(a){var b=p(a.split("/"));return'
'},codepen:function(a,b){return'
'},ideone:function(a,b){return'
'},jsbin:function(a,b){return'
'},jsfiddle:function(a,b){return a="/"==p(a)?a.slice(0,-1):a,a=a.indexOf("//")!==-1?a:"//"+a,'
'},plunker:function(a,b){return'
'},image:function(a){return'
'},flickr:function(a,b){return'
'},instagram:function(a,b){return'
'},slideShare:function(a){return'
'+a+"
"},video:function(a){return'
'},dailymotion:function(a,b){var c=p(a.split("/"));return'
'},liveleak:function(a,b){return'
'},ted:function(a,b){var c=a.split("/"),d=c[c.length-1];return'
'},ustream:function(a,b){var c=a.split("/");return a.indexOf("/embed/")<0&&c.splice(1,0,"embed"),'
'},detailsVimeo:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},detailsYoutube:function(a,b,c){return'
'+a.description+'
'+a.views+''+a.likes+"
"},vine:function(a,b){var c=p(a.split("/")),d=b.vineOptions;return'
'},vimeo:function(a,b){return b.plyr?"
":'
'},youtube:function(a,b){return b.plyr?"
":'
'},openGraph:function(a,b){return'
'+a.description+"
"},github:function(a,b){return'
'+a.description+'
'+a.stargazers_count+''+a.network_count+"
"},gmap:function(a,b,c,d){var e=d.mapOptions;return"place"===e.mode?'
':"streetview"===e.mode?'
':"view"===e.mode?'
':void 0}},Z={mentions:/(^|\s)(@[a-z0-9_-]+)/gi,hashtag:/(^|\s)(#[a-z\d-]+)/gi,basicAudio:/((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi,soundCloud:/(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi,spotify:/spotify.com\/track\/[a-zA-Z0-9_]+/gi,codepen:/http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi,gist:/gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi,highlightCode:/(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,inlineCode:/(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm,ideone:/ideone.com\/[a-zA-Z0-9]{6}/gi,jsbin:/jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi,jsfiddle:/jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi,plunker:/plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi,basicImage:/((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,flickr:/flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi,instagram:/instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi,slideShare:/slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi,github:/[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi,basicVideo:/(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi,dailymotion:/dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi,liveleak:/liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi,ted:/ted.com\/talks\/[a-zA-Z0-9_]+/gi,ustream:/ustream.tv\/[a-z\/0-9]*/gi,vimeo:/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi,vine:/vine.co\/v\/[a-zA-Z0-9]+/gi,youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi,gmap:/@\((.+)\)/gi,twitter:/https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi,smileys:/(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi},$=function(a,b){return a.replace(Z.smileys,function(a){var c=q(a);return c?b.template.emoji(c,b):a})},_=[{text:":)",code:""},{text:":D",code:""},{text:":d",code:""},{text:":(",code:""},{text:":/",code:""},{text:":P",code:""},{text:":p",code:""},{text:"3:)",code:""},{text:"(^)",code:""},{text:";)",code:""},{text:":o",code:""},{text:":O",code:""},{text:"-_-",code:""},{text:"(y)",code:""},{text:":*",code:""},{text:"<3",code:""},{text:"<3",code:""},{text:"</3",code:""},{text:"-1?b:a}function l(a,b){b=b||{};var c=b.body;if(l.prototype.isPrototypeOf(a)){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,b.headers||(this.headers=new e(a.headers)),this.method=a.method,this.mode=a.mode,c||(c=a._bodyInit,a.bodyUsed=!0)}else this.url=a;if(this.credentials=b.credentials||this.credentials||"omit",!b.headers&&this.headers||(this.headers=new e(b.headers)),this.method=k(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&c)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(c)}function m(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function n(a){var b=new e,c=(a.getAllResponseHeaders()||"").trim().split("\n");return c.forEach(function(a){var c=a.trim().split(":"),d=c.shift().trim(),e=c.join(":").trim();b.append(d,e)}),b}function o(a,b){b||(b={}),this.type="default",this.status=b.status,this.ok=this.status>=200&&this.status<300,this.statusText=b.statusText,this.headers=b.headers instanceof e?b.headers:new e(b.headers),this.url=b.url||"",this._initBody(a)}if(!a.fetch){var p={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(a){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};e.prototype.append=function(a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)},e.prototype["delete"]=function(a){delete this.map[b(a)]},e.prototype.get=function(a){var c=this.map[b(a)];return c?c[0]:null},e.prototype.getAll=function(a){return this.map[b(a)]||[]},e.prototype.has=function(a){return this.map.hasOwnProperty(b(a))},e.prototype.set=function(a,d){this.map[b(a)]=[c(d)]},e.prototype.forEach=function(a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)},e.prototype.keys=function(){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)},e.prototype.values=function(){var a=[];return this.forEach(function(b){a.push(b)}),d(a)},e.prototype.entries=function(){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)},p.iterable&&(e.prototype[Symbol.iterator]=e.prototype.entries);var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},j.call(l.prototype),j.call(o.prototype), +o.prototype.clone=function(){return new o(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new e(this.headers),url:this.url})},o.error=function(){var a=new o(null,{status:0,statusText:""});return a.type="error",a};var r=[301,302,303,307,308];o.redirect=function(a,b){if(r.indexOf(b)===-1)throw new RangeError("Invalid status code");return new o(null,{status:b,headers:{location:a}})},a.Headers=e,a.Request=l,a.Response=o,a.fetch=function(a,b){return new Promise(function(c,d){function e(){return"responseURL"in g?g.responseURL:/^X-Request-URL:/m.test(g.getAllResponseHeaders())?g.getResponseHeader("X-Request-URL"):void 0}var f;f=l.prototype.isPrototypeOf(a)&&!b?a:new l(a,b);var g=new XMLHttpRequest;g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:n(g),url:e()},b="response"in g?g.response:g.responseText;c(new o(b,a))},g.onerror=function(){d(new TypeError("Network request failed"))},g.ontimeout=function(){d(new TypeError("Network request failed"))},g.open(f.method,f.url,!0),"include"===f.credentials&&(g.withCredentials=!0),"responseType"in g&&p.blob&&(g.responseType="blob"),f.headers.forEach(function(a,b){g.setRequestHeader(b,a)}),g.send("undefined"==typeof f._bodyInit?null:f._bodyInit)})},a.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0);var ja=function(a,b,c,d){for(var e=void 0,f=[],g=[],i="map";null!==(e=h(Z.gmap,b));){c.served.push(e);var k="place"!==c.mapOptions.mode?D(e[0]):Promise.resolve([null,null]);f.push(k),g.push(e)}return new Promise(function(a){Promise.all(f).then(function(e){var h=function(){var a=X.slicedToArray(e[k],2),f=a[0],h=a[1],l=E(g[k][0],f,h,c);j(c,i)?b=b.replace(Z.gmap,function(a){return''+F(a)+""+l}):(d.push({text:l,index:g[k][0].index}),b=b.replace(Z.gmap,function(a){return''+F(a)+""}))};for(var k in f)h();a([b,d])})})},ka=function(a,b){if(!b.plugins.marked)throw new ReferenceError("marked.js is not loaded.");var c=b.plugins.marked,d=new c.Renderer;return d.link=function(a,c,d){return a.indexOf("</a")===-1?a:a.match(/>(.+)<\/a/gi)?(c||(c=""),''+d+""):void 0},d.image=function(a,b,c){return a.match(/>(.+)<\/a/gi)?(b||(b=""),'
'+c+'
'):'
'+c+'
'},d.paragraph=function(a){return"

"+a+"

"},c.Lexer.rules.gfm.heading=c.Lexer.rules.normal.heading,c.Lexer.rules.tables.heading=c.Lexer.rules.normal.heading,b.markedOptions.renderer=d,b.markedOptions.highlight=!1,c(a,b.markedOptions)},la=function(a,b){return a=a.replace(Z.inlineCode,function(a,b,c){return""+c+""}),a.replace(Z.highlightCode,function(a,c,d,e){var f=e;f=H(f),f=G(f),f=f.replace(/:\/\//g,"~P");var g=d.split("\n")[0],h=void 0,i=b.plugins.highlightjs;return g?h=i.highlightAuto(f,[g]):(h=i.highlightAuto(f),g=h.language),I(h,g)})},ma=function(){function a(b,c,d,e){var f=this;X.classCallCheck(this,a),this.input=b,this.output=c,this.options=d,this.embeds=e,this.regex=Z.gist,this.service="gist","string"!=typeof this.options.input&&this.options.input.addEventListener("rendered",function(){f.load()})}return X.createClass(a,[{key:"template",value:function(a){return'
'}},{key:"load",value:function(){for(var a=this.options.input.getElementsByClassName("ejs-gist"),b=0;b',g=c.document;c.contentDocument?g=c.contentDocument:c.contentWindow&&(g=c.contentWindow.document),g.open(),g.writeln(f),g.close()}}},{key:"process",value:function(){return w(this)}}]),a}(),na=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.youtube,service:"youtube"};return new Promise(function(a){return C(e,L).then(function(b){return a(b)})})},oa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.vimeo,service:"vimeo"};return new Promise(function(a){return C(e,O).then(function(b){return a(b)})})},pa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,regex:Z.slideShare,service:"slideshare",template:function(a){return this.options.template.slideShare(a,this.options)}};return new Promise(function(a){return C(e,Q).then(function(b){return a(b)})})},qa=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"opengraph",regex:m(),excludeRegex:new RegExp([".mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg"].concat(c.openGraphExclude).join("|"),"gi"),template:function(a){return this.options.template.openGraph(a,this.options)}};return new Promise(function(a){return C(e,S).then(function(b){return a(b)})})},ra=function(a,b,c,d){var e={input:a,output:b,options:c,embeds:d,service:"github",regex:Z.github};return new Promise(function(a){return C(e,V).then(function(b){return a(b)})})},sa=function(a,b){var c=Z.mentions;return a.replace(c,function(a,c,d){var e=d.split("@")[1];return c+b.mentionsUrl(e)})},ta=function(a,b){var c=Z.hashtag;return a.replace(c,function(a,c,d){var e=d.split("#")[1];return c+b.hashtagUrl(e)})},ua={},va={marked:!1,markedOptions:{},link:!0,linkOptions:{target:"self",exclude:["pdf"],rel:""},emoji:!0,customEmoji:[],fontIcons:!0,customFontIcons:[],highlightCode:!1,mentions:!1,hashtag:!1,videoJS:!1,videojsOptions:{fluid:!0,preload:"metadata"},plyr:!1,plyrOptions:{},locationEmbed:!0,mapOptions:{mode:"place"},tweetsEmbed:!1,tweetOptions:{maxWidth:550,hideMedia:!1,hideThread:!1,align:"none",lang:"en"},singleEmbed:!1,openGraphEndpoint:null,openGraphExclude:[],videoEmbed:!0,videoHeight:null,videoWidth:null,videoDetails:!0,audioEmbed:!0,imageEmbed:!0,excludeEmbed:[],inlineEmbed:[],inlineText:!0,codeEmbedHeight:500,vineOptions:{maxWidth:null,type:"postcard",responsive:!0,width:350,height:460},plugins:{marked:window.marked,videojs:window.videojs,plyr:window.plyr,highlightjs:window.hljs,prismjs:window.Prism,twitter:window.twttr},googleAuthKey:"",soundCloudOptions:{height:160,themeColor:"f50000",autoPlay:!1,hideRelated:!1,showComments:!0,showUser:!0,showReposts:!1,visual:!1,download:!1},videoClickClass:"ejs-video-thumb",customVideoClickHandler:!1,mentionsUrl:function(){},hashtagUrl:function(){},beforeEmbedJSApply:function(){},afterEmbedJSApply:function(){},onVideoShow:function(){},onTweetsLoad:function(){},videojsCallback:function(){},onOpenGraphFetch:function(){},onOpenGraphFail:function(){},videoClickHandler:function(){},served:[]},wa=[],xa=[],ya=[],za=function(){function a(b,c){X.classCallCheck(this,a);var e=l(va),f=l(ua),g=d(e,f);if(this.options=d(g,b),this.options.template=c||Y,"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}return X.createClass(a,[{key:"process",value:function(){var a=this,b=this.input;if(""===b)return Promise.resolve("");var c=o(this.options),d=[],e=b;return this.options.beforeEmbedJSApply(),new Promise(function(f){c.link&&(e=ba(b,c));var h=c.openGraphEndpoint?qa(b,e,c,d):Promise.resolve([e,d]);h.then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];c.highlightCode&&(e=la(e,c)),c.marked&&(e=ka(e,c)),c.emoji&&(e=$(e,c)),c.fontIcons&&(e=aa(e,c)),c.mentions&&(e=sa(e,c)),c.hashtag&&(e=ta(e,c));var g=x(b,e,f,c,Z.ideone,"ideone"),h=X.slicedToArray(g,2);e=h[0],f=h[1];var j=x(b,e,f,c,Z.plunker,"plunker"),k=X.slicedToArray(j,2);e=k[0],f=k[1];var l=x(b,e,f,c,Z.jsbin,"jsbin"),m=X.slicedToArray(l,2);e=m[0],f=m[1];var n=x(b,e,f,c,Z.codepen,"codepen"),o=X.slicedToArray(n,2);e=o[0],f=o[1];var p=x(b,e,f,c,Z.jsfiddle,"jsfiddle"),q=X.slicedToArray(p,2);e=q[0],f=q[1];var r=x(b,e,f,c,Z.ted,"ted"),s=X.slicedToArray(r,2);e=s[0],f=s[1];var t=x(b,e,f,c,Z.dailymotion,"dailymotion"),u=X.slicedToArray(t,2);e=u[0],f=u[1];var v=x(b,e,f,c,Z.ustream,"ustream"),w=X.slicedToArray(v,2);e=w[0],f=w[1];var y=x(b,e,f,c,Z.liveleak,"liveleak"),z=X.slicedToArray(y,2);e=z[0],f=z[1];var A=x(b,e,f,c,Z.basicVideo,"video",c.videoEmbed),B=X.slicedToArray(A,2);e=B[0],f=B[1];var C=x(b,e,f,c,Z.vine,"vine"),D=X.slicedToArray(C,2);e=D[0],f=D[1];var E=x(b,e,f,c,Z.soundCloud,"soundcloud"),F=X.slicedToArray(E,2);e=F[0],f=F[1];var G=x(b,e,f,c,Z.spotify,"spotify"),H=X.slicedToArray(G,2);e=H[0],f=H[1];var I=x(b,e,f,c,Z.basicAudio,"audio",c.audioEmbed),J=X.slicedToArray(I,2);e=J[0],f=J[1];var K=x(b,e,f,c,Z.flickr,"flickr"),L=X.slicedToArray(K,2);e=L[0],f=L[1];var M=x(b,e,f,c,Z.instagram,"instagram"),N=X.slicedToArray(M,2);e=N[0],f=N[1];var O=x(b,e,f,c,Z.basicImage,"image",c.imageEmbed),P=X.slicedToArray(O,2);if(e=P[0],f=P[1],i(c,"gist")){var Q=new ma(b,e,c,f).process(),R=X.slicedToArray(Q,2);e=R[0],f=R[1]}return i(c,"youtube")?na(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"vimeo")?oa(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"github")?ra(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return c.locationEmbed&&i(c,"gmap")?ja(b,e,c,f):Promise.resolve([e,f])}).then(function(a){var d=X.slicedToArray(a,2),e=d[0],f=d[1];return i(c,"slideshare")?pa(b,e,c,f):Promise.resolve([e,f])}).then(function(d){var e=X.slicedToArray(d,2),f=e[0],g=e[1];return c.tweetsEmbed&&i(c,"twitter")?(a.twitter=new ia(b,f,c,g),a.twitter.process()):Promise.resolve([f,g])}).then(function(b){var d=X.slicedToArray(b,2),e=d[0],h=d[1];a.data={input:c.input,output:e,options:c,inputString:a.input,services:c.served,template:c.template},f(g(e,h))})})}},{key:"render",value:function(){var a=this;if("string"==typeof this.options.input)throw new Error("You cannot call render method for a string");if(!this.options.input)throw new Error("You didn't pass an element while creating this instance. render() method can't work without an input element");return new Promise(function(b){a.process().then(function(c){a.options.input.innerHTML=c,a.applyListeners(),b(a.data)})})}},{key:"applyListeners",value:function(){t(this.options),fa(this.options),s(this.options);var a=new Event("rendered");this.options.input.dispatchEvent(a),this.options.afterEmbedJSApply()}},{key:"update",value:function(a,b){if(a&&(this.options=d(this.options,a)),b&&(this.options.template=b),!this.options.input||"string"!=typeof this.options.input&&"object"!==X["typeof"](this.options.input))throw ReferenceError("You need to pass an element or the string that needs to be processed");this.input="object"===X["typeof"](this.options.input)?this.options.input.innerHTML:this.options.input}},{key:"text",value:function(a){var b=this;this.process().then(function(c){return a(c,b.input)})}},{key:"destroy",value:function(){if("object"!==X["typeof"](this.options.input))throw new Error("destroy() method only works if an element had been passed in the options object");ga("ejs-video-thumb"),this.options.tweetsEmbed&&this.options.input.removeEventListener("rendered",this.twitter.load(),!1),this.options.input.innerHTML=this.input}}],[{key:"setOptions",value:function(a){ua=d(va,a)}},{key:"applyEmbedJS",value:function(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,e=document.querySelectorAll(b),f=0;f n ? '...' : ''); -} - -/** - * Returns an array after removing the duplicates. - * @param array The array containing the duplicates - * @returns {Array} Array with unique values. - */ - - -/** - * Converts a string into legitimate url. - * @param string - */ -function toUrl(string) { - return (string.indexOf('//') === -1) ? ('//' + string) : string -} - -/** - * Extends an Object - * @param destination - * @param source - * @returns {*} - */ -function deepExtend(destination, source) { - for (var property in source) { - if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) { - destination[property] = destination[property] || {}; - deepExtend(destination[property], source[property]); - } else { - destination[property] = source[property]; - } - } - return destination; -} - -function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/** - * Sort an array of objects based on the index value - * @param {Array} arr Array to be sorted - * @return {Array} Sorted array - */ -function sortObject(arr) { - return arr.sort((a, b) => (a.index - b.index)); -} - -/** - * Creates the string of the iframes after sorting them and finally returning a string - * @param {string} str String to which the created text has to be added - * @param {object} embeds Sorted array of iframe html - * @return {string} String to be rendered - */ -function createText(str, embeds) { - let sortedEmbeds = sortObject(embeds); - for (let i = 0; i < sortedEmbeds.length; i++) { - str += ` ${sortedEmbeds[i].text}`; - } - return str; -} - -/** - * Matches the string and finds the substrings matching to the provided regex pattern - * @param {object} regex Regex pattern - * @param {string} input The string to be analyzed - * @return {object} Returns the matched substring with their corresponding positions - */ -function matches(regex, input) { - return regex.exec(input); -} - -/** - * Checks whether a particular service should be embedded or not based on - * the setting provided by the user - * @param {object} options The options provided by the user - * @param {string} service Name of the service for which the condition is to be analyzed - * @return {boolean} True if it should be embedded - */ -function ifEmbed(options, service) { - if (options.singleEmbed && options.served.length) return; - return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all')); -} - -function ifInline(options, service) { - return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all')); -} - -/** - * Calculates the dimensions for the elements based on a aspect ratio - * @param {object} options Plugin options - * @return {object} The width and height of the elements - */ -function setDimensions(options) { - options.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800; - options.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600; - return options; -} - -/** - * Returns a cloned object - * @param {object} obj - * @return {object} cloned object - */ -function cloneObject(obj) { - if (obj === null || typeof obj !== 'object') return obj; - var temp = obj.constructor(); // give temp the original obj's constructor - for (var key in obj) { - temp[key] = cloneObject(obj[key]) - } - return temp -} - -function urlRegex() { - return /((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi; -} - -function arrayLowercase(options, property){ - if(typeof options[property] !== 'string'){ - options[property] = options[property].map(function(elem){ - return elem.toLowerCase(); - }) - } - return options; -} - -/** - * Sets the dimensions and converts options values' Array into lowercase. - * @param options - * @returns {Object|*} - */ -function processOptions(options){ - options = setDimensions(options); - options = arrayLowercase(options, 'excludeEmbed'); - options = arrayLowercase(options, 'inlineEmbed'); - return arrayLowercase(options, 'openGraphExclude'); -} - -/** - * Get the last element of an array or string - * @param elem [String|Array] - * @returns last element of the Array or String - */ -function lastElement(elem){ - return elem[elem.length - 1]; -} - -var renderer = { - url(match, options){ - let config = options.linkOptions; - return `${match}`; - }, - - smiley(text, pre, code) { - return `${pre}${code}`; - }, - - emoji(text){ - return ``; - }, - - audio(match){ - return `
` - }, - - soundcloud(match, options){ - let config = options.soundCloudOptions; - return `
- -
` - }, - - spotify(match){ - let id = lastElement(match.split('/')); - return `
` - }, - - codepen(id, options){ - return `
` - }, - - ideone(match, options){ - return `
` - }, - - jsbin(id, options){ - return `
` - }, - - jsfiddle(id, options){ - id = lastElement(id) == '/' ? id.slice(0, - 1) : id; - id = (id.indexOf('//') !== -1) ? id : `//${id}`; - return `
` - }, - - plunker(id, options){ - return `
` - }, - - image(match){ - return `
` - }, - - flickr(match, options){ - return `
` - }, - - instagram(match, options){ - return `
`; - }, - - slideShare(html){ - return `
${html}
`; - }, - - video(match){ - return `
` - }, - - dailymotion(match, options){ - const id = lastElement(match.split('/')); - return `
` - }, - - liveleak(match, options){ - return `
` - }, - - ted(match, options){ - let a = match.split('/'); - const id = a[a.length - 1]; - return `
` - }, - - ustream(match, options){ - let id = match.split('/'); - id.splice(1, 0, 'embed'); - return `
` - }, - - detailsVimeo(data, fullData, embedUrl){ - return `
${data.description}
${data.views}${data.likes}
` - }, - - detailsYoutube(data, fullData, embedUrl){ - return `
${data.description}
${data.views}${data.likes}
` - }, - - vine(match, options){ - const id = lastElement(match.split('/')); - const config = options.vineOptions; - return `
` - }, - - vimeo(url, options){ - return options.plyr ? - `
` : - `
` - }, - - youtube(url, options){ - return options.plyr ? - `
` : - `
` - }, - - openGraph(data, options){ - return `
${data.description}
` - }, - - github(data, options){ - return `
${data.description}
${data.stargazers_count}${data.network_count}
` - }, - - gmap(latitude, longitude, location, options){ - const config = options.mapOptions; - if (config.mode === 'place') { - return `
`; - } else if (config.mode === 'streetview') { - return `
`; - } else if (config.mode === 'view') { - return `
` - } - } -} - -const regex = { - mentions : /(^|\s)(@[a-z0-9_-]+)/gi, - hashtag : /(^|\s)(#[a-z\d-]+)/gi, - basicAudio : /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, - soundCloud : /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, - spotify : /spotify.com\/track\/[a-zA-Z0-9_]+/gi, - codepen : /http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi, - gist : /gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi, - highlightCode: /(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - inlineCode : /(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - ideone : /ideone.com\/[a-zA-Z0-9]{6}/gi, - jsbin : /jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi, - jsfiddle : /jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi, - plunker : /plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi, - basicImage : /((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi, - flickr : /flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi, - instagram : /instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi, - slideShare : /slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi, - github : /[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi, - basicVideo : /(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi, - dailymotion : /dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi, - liveleak : /liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi, - ted : /ted.com\/talks\/[a-zA-Z0-9_]+/gi, - ustream : /ustream.tv\/[a-z\/0-9]*/gi, - vimeo : /https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi, - vine : /vine.co\/v\/[a-zA-Z0-9]+/gi, - youtube : /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi, - gmap : /@\((.+)\)/gi, - twitter : /https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi, - smileys : /(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi -}; - -function getEmoji(match) { - return match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1) -} - -var emoji = function (output, options) { - return output.replace(regex.smileys, function (match) { - const emoji = getEmoji(match); - if (emoji) { - return options.template.emoji(emoji, options) - } - return match; - }); -} - -const defaultIcons = [{ - 'text': ':)', - 'code': '' -}, { - 'text': ':D', - 'code': '' -}, { - 'text': ':d', - 'code': '' -}, { - 'text': ':(', - 'code': '' -}, { - 'text': ':/', - 'code': '' - -}, { - 'text': ':P', - 'code': '' -}, { - 'text': ':p', - 'code': '' -}, { - 'text': '3:)', - 'code': '' -}, { - 'text': '(^)', - 'code': '' -}, { - 'text': ';)', - 'code': '' -}, { - 'text': ':o', - 'code': '' -}, { - 'text': ':O', - 'code': '' -}, { - 'text': '-_-', - 'code': '' -}, { - 'text': '(y)', - 'code': '' -}, { - 'text': ':*', - 'code': '' -}, { - 'text': '<3', - 'code': '' -}, { - 'text': '<3', - 'code': '' -}, { - 'text': '</3', - 'code': '' -}, { - 'text': ' escapeRegExp(val.text)); - - const smileyRegex = new RegExp(`(^|\\s)(${escapedSymbols.join('|')})(?=\\s|$)`, 'gi'); - - return input.replace(smileyRegex, (match, pre, text) => { - let index = escapedSymbols.indexOf(escapeRegExp(text)); - if (index === -1) return match; - let code = icons[index].code; - return options.template.smiley(text, pre, code, options); - }); -} - -var url = function (input, options) { - const config = options.linkOptions; - return input.replace(urlRegex(), function(match) { - if(lastElement(match) === ')') return match; //hack for markdown image - let extension = lastElement(match.split('.')); - if ((lastElement(match) === '/')) - match = match.slice(0, -1); - if (config.exclude.indexOf(extension) === -1) - return options.template.url(match, options); - return match; - }); -} - -var fetchJsonp = __commonjs(function (module, exports, global) { -(function (global, factory) { - if (typeof define === 'function' && define.amd) { - define(['exports', 'module'], factory); - } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { - factory(exports, module); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, mod); - global.fetchJsonp = mod.exports; - } -})(__commonjs_global, function (exports, module) { - 'use strict'; - - var defaultOptions = { - timeout: 5000, - jsonpCallback: 'callback', - jsonpCallbackFunction: null - }; - - function generateCallbackFunction() { - return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); - } - - // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' - // error if request timeout - function clearFunction(functionName) { - // IE8 throws an exception when you try to delete a property on window - // http://stackoverflow.com/a/1824228/751089 - try { - delete window[functionName]; - } catch (e) { - window[functionName] = undefined; - } - } - - function removeScript(scriptId) { - var script = document.getElementById(scriptId); - document.getElementsByTagName('head')[0].removeChild(script); - } - - function fetchJsonp(_url) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - // to avoid param reassign - var url = _url; - var timeout = options.timeout || defaultOptions.timeout; - var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback; - - var timeoutId = undefined; - - return new Promise(function (resolve, reject) { - var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction(); - var scriptId = jsonpCallback + '_' + callbackFunction; - - window[callbackFunction] = function (response) { - resolve({ - ok: true, - // keep consistent with fetch API - json: function json() { - return Promise.resolve(response); - } - }); - - if (timeoutId) clearTimeout(timeoutId); - - removeScript(scriptId); - - clearFunction(callbackFunction); - }; - - // Check if the user set their own params, and if not add a ? to start a list of params - url += url.indexOf('?') === -1 ? '?' : '&'; - - var jsonpScript = document.createElement('script'); - jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction); - jsonpScript.id = scriptId; - document.getElementsByTagName('head')[0].appendChild(jsonpScript); - - timeoutId = setTimeout(function () { - reject(new Error('JSONP request to ' + url + ' timed out')); - - clearFunction(callbackFunction); - removeScript(scriptId); - }, timeout); - }); - } - - // export as global function - /* - let local; - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - local.fetchJsonp = fetchJsonp; - */ - - module.exports = fetchJsonp; -}); -}); - -var fetchJsonp$1 = (fetchJsonp && typeof fetchJsonp === 'object' && 'default' in fetchJsonp ? fetchJsonp['default'] : fetchJsonp); - -/** - * Common template for vimeo and youtube iframes - * @param {string} url URL of the embedding video - * @param {object} options Options object - * @return {string} compiled template with variables replaced - */ -function template(url, options) { - return options.template.vimeo(url, options) || options.template.youtube(url, options) -} - -/** - * Plays the video after clicking on the thumbnail - * @param {object} options Options object - * @return {null} - */ -function playVideo(options) { - /** Execute the customVideoClickHandler if the user wants to handle it on his own. */ - if (options.customVideoClickHandler) return options.videoClickHandler(options, template); - - let classes = document.getElementsByClassName(options.videoClickClass); - for (let i = 0; i < classes.length; i++) { - classes[i].onclick = function () { - options.onVideoShow(); - let url = this.getAttribute('data-ejs-url') + "?autoplay=true"; - this.parentNode.parentNode.innerHTML = template(url, options); - }; - } -} - -var getDetailsTemplate = function (data, fullData, embedUrl, options) { - if (data.host === 'vimeo') { - return options.template.detailsVimeo(data, fullData, embedUrl, options) - } else if (data.host === 'youtube') { - return options.template.detailsYoutube(data, fullData, embedUrl, options) - } -} - -/** - * Applies video.js to all audio and video dynamically - * @param {object} options Options object - * @return {null} - */ -var applyPlyr = function (options) { - if (options.plyr) { - if (!options.plugins.plyr) throw new ReferenceError("You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/"); - let plyr = options.plugins.plyr; - plyr.setup('.ejs-plyr', options.plyrOptions); - } -} - -/** - * Applies video.js to all audio and video dynamically - * @param {object} options Options object - * @return {null} - */ -function applyVideoJS(options) { - options.videojsOptions.width = options.videoWidth; - options.videojsOptions.height = options.videoHeight; - if (options.videoJS) { - if (!options.plugins.videojs) throw new ReferenceError("You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/"); - let VideoJS = options.plugins.videojs; - let elements = options.input.getElementsByClassName('ejs-video-js'); - for (let i = 0; i < elements.length; i++) { - VideoJS(elements[i], options.videojsOptions, () => options.videojsCallback()); - } - } -} - -/** - * Destroys the onclick event for opening the video template from the details template - * @param {className} className - * @return {null} - */ -var destroyVideos = function (className) { - const classes = document.getElementsByClassName(className); - for (let i = 0; i < classes.length; i++) { - classes[i].onclick = null - } -} - -function inlineEmbed(_){ - let regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\/a>`, 'gm') : new RegExp(`([^\\s]*${_.regex.source})`, 'gm'); - _.output = _.output.replace(regexInline, function(match) { - let url = _.options.link ? match.slice(0, -4) : match; - if (_.options.served.indexOf(url) === -1) { - _.options.served.push(url); - if (_.options.link) { - return !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4)) - } else { - return !_.options.inlineText ? _.template(match) : match + _.template(match) - } - } else { - return match; //TODO : check whether this should be `match` - } - }); - return [_.output, _.embeds]; -} - -function normalEmbed(_){ - let match; - while ((match = matches(_.regex, _.input)) !== null) { - let url = match[0]; - if (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue; - _.options.served.push(url); - let text = _.template(url); - _.embeds.push({ - text : text, - index: match.index - }) - } - return [_.output, _.embeds]; -} - -function embed(_){ - return (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_) -} - -var base = function (input, output, embeds, options, regex, service) { - const args = { - input, - output, - options, - embeds, - regex, - service, - template(match){ - return this.options.template[this.service](match, this.options); - } - }; - - return embed(args); -} - -function baseEmbed(input, output, embeds, options, regex, service, flag){ - return ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds] -} - -/** - * This is a private function which is used to get the actual text to be replaced for - * a particular url in inline embedding. This returns a promise - * @param {object} _ reference to this - * @param {function} urlToText The function that converts url to replaceable text - * @param {object} match object containing info of matching string - * @return {Promise} resolves to the text - */ -function getInlineData(_, urlToText, match) { - let url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1]; - if (_.options.served.indexOf(url) >= 0) return Promise.resolve(null); - - return new Promise((resolve) => { - urlToText(_, match, url).then((text) => { - if (!text) return resolve(); - _.options.served.push(url); - resolve(text); - }) - }) -} - -/** - * A helper function for inline embedding - * @param _ - * @param urlToText - * @returns Promise - */ -function inlineAsyncEmbed(_, urlToText) { - let regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\/a>`, 'gi') : new RegExp(`([^\\s]*${_.regex.source})`, 'gi'); - let match, promises = []; - - while ((match = matches(regexInline, _.output)) !== null) - promises.push(getInlineData(_, urlToText, match)); - - return new Promise((resolve) => { - if (matches.length) - Promise.all(promises).then((data) => { - let i = 0; - _.output = _.output.replace(regexInline, (match) => { - if (_.options.link) - return !_.options.inlineText ? data[i] + '' : match + data[i++]; - else - return !_.options.inlineText ? data[i] : match + data[i++]; - }); - resolve(_.output) - }); - else - resolve(_.output) - }) -} - - -function getNormalData(_, urlToText, match) { - let url = match[0]; - if (_.options.served.indexOf(url) >= 0) return; - - return new Promise((resolve) => { - urlToText(_, match, url, true).then(function (text) { - if (!text) resolve(); - _.options.served.push(url); - _.embeds.push({ - text : text, - index: match.index - }); - resolve() - }) - }) -} - -/** - * A helper function for normal embedding - * @param {object} _ - * @param {function} urlToText - * @return {Promise} - */ -function normalAsyncEmbed(_, urlToText) { - let match, promises = []; - while ((match = matches(_.regex, _.input)) !== null) - promises.push(getNormalData(_, urlToText, match)); - return new Promise(function (resolve) { - Promise.all(promises).then(function () { - resolve(_.embeds) - }); - }) -} - -function asyncEmbed(_, urlToText) { - return new Promise(function (resolve) { - if (ifInline(_.options, _.service)) - inlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds])); - else - normalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds])) - }) -} - -class Twitter { - constructor(input, output, options, embeds) { - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.twitter; - this.service = 'twitter'; - - this.load = this.load.bind(this); - if(typeof this.options.input !== 'string'){ - this.options.input.addEventListener('rendered', this.load, false); - } - } - - /** - * Fetches the data from twitter's oEmbed API - * @param {string} url URL of the tweet - * @return {object} data containing the tweet info - */ - tweetData(url) { - let config = this.options.tweetOptions; - let apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`; - return new Promise((resolve) => { - fetchJsonp$1(apiUrl, {credentials: 'include'}) - .then((data)=>data.json()) - .then((json)=>resolve(json)) - }) - } - - /** - * Load twitter widgets - * @return null - */ - load() { - const twitter = this.options.plugins.twitter; - twitter.widgets.load(this.options.element); //here this refers to the element - - //Execute the function after the widget is loaded - twitter.events.bind('loaded', this.options.onTweetsLoad); - } - - static urlToText(_this, match, url) { - return new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html))) - } - - process() { - return new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data))) - } -} - -(function(self) { - 'use strict'; - - if (self.fetch) { - return - } - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: 'FileReader' in self && 'Blob' in self && (function() { - try { - new Blob() - return true - } catch(e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name) - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value) - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift() - return {done: value === undefined, value: value} - } - } - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - } - } - - return iterator - } - - function Headers(headers) { - this.map = {} - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value) - }, this) - - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]) - }, this) - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name) - value = normalizeValue(value) - var list = this.map[name] - if (!list) { - list = [] - this.map[name] = list - } - list.push(value) - } - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)] - } - - Headers.prototype.get = function(name) { - var values = this.map[normalizeName(name)] - return values ? values[0] : null - } - - Headers.prototype.getAll = function(name) { - return this.map[normalizeName(name)] || [] - } - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - } - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = [normalizeValue(value)] - } - - Headers.prototype.forEach = function(callback, thisArg) { - Object.getOwnPropertyNames(this.map).forEach(function(name) { - this.map[name].forEach(function(value) { - callback.call(thisArg, value, name, this) - }, this) - }, this) - } - - Headers.prototype.keys = function() { - var items = [] - this.forEach(function(value, name) { items.push(name) }) - return iteratorFor(items) - } - - Headers.prototype.values = function() { - var items = [] - this.forEach(function(value) { items.push(value) }) - return iteratorFor(items) - } - - Headers.prototype.entries = function() { - var items = [] - this.forEach(function(value, name) { items.push([name, value]) }) - return iteratorFor(items) - } - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result) - } - reader.onerror = function() { - reject(reader.error) - } - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader() - reader.readAsArrayBuffer(blob) - return fileReaderReady(reader) - } - - function readBlobAsText(blob) { - var reader = new FileReader() - reader.readAsText(blob) - return fileReaderReady(reader) - } - - function Body() { - this.bodyUsed = false - - this._initBody = function(body) { - this._bodyInit = body - if (typeof body === 'string') { - this._bodyText = body - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString() - } else if (!body) { - this._bodyText = '' - } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) { - // Only support ArrayBuffers for POST method. - // Receiving ArrayBuffers happens via Blobs, instead. - } else { - throw new Error('unsupported BodyInit type') - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8') - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type) - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8') - } - } - } - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this) - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - } - - this.arrayBuffer = function() { - return this.blob().then(readBlobAsArrayBuffer) - } - - this.text = function() { - var rejected = consumed(this) - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - } - } else { - this.text = function() { - var rejected = consumed(this) - return rejected ? rejected : Promise.resolve(this._bodyText) - } - } - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - } - } - - this.json = function() { - return this.text().then(JSON.parse) - } - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] - - function normalizeMethod(method) { - var upcased = method.toUpperCase() - return (methods.indexOf(upcased) > -1) ? upcased : method - } - - function Request(input, options) { - options = options || {} - var body = options.body - if (Request.prototype.isPrototypeOf(input)) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url - this.credentials = input.credentials - if (!options.headers) { - this.headers = new Headers(input.headers) - } - this.method = input.method - this.mode = input.mode - if (!body) { - body = input._bodyInit - input.bodyUsed = true - } - } else { - this.url = input - } - - this.credentials = options.credentials || this.credentials || 'omit' - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers) - } - this.method = normalizeMethod(options.method || this.method || 'GET') - this.mode = options.mode || this.mode || null - this.referrer = null - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body) - } - - Request.prototype.clone = function() { - return new Request(this) - } - - function decode(body) { - var form = new FormData() - body.trim().split('&').forEach(function(bytes) { - if (bytes) { - var split = bytes.split('=') - var name = split.shift().replace(/\+/g, ' ') - var value = split.join('=').replace(/\+/g, ' ') - form.append(decodeURIComponent(name), decodeURIComponent(value)) - } - }) - return form - } - - function headers(xhr) { - var head = new Headers() - var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n') - pairs.forEach(function(header) { - var split = header.trim().split(':') - var key = split.shift().trim() - var value = split.join(':').trim() - head.append(key, value) - }) - return head - } - - Body.call(Request.prototype) - - function Response(bodyInit, options) { - if (!options) { - options = {} - } - - this.type = 'default' - this.status = options.status - this.ok = this.status >= 200 && this.status < 300 - this.statusText = options.statusText - this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers) - this.url = options.url || '' - this._initBody(bodyInit) - } - - Body.call(Response.prototype) - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - } - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}) - response.type = 'error' - return response - } - - var redirectStatuses = [301, 302, 303, 307, 308] - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - } - - self.Headers = Headers - self.Request = Request - self.Response = Response - - self.fetch = function(input, init) { - return new Promise(function(resolve, reject) { - var request - if (Request.prototype.isPrototypeOf(input) && !init) { - request = input - } else { - request = new Request(input, init) - } - - var xhr = new XMLHttpRequest() - - function responseURL() { - if ('responseURL' in xhr) { - return xhr.responseURL - } - - // Avoid security warnings on getResponseHeader when not allowed by CORS - if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { - return xhr.getResponseHeader('X-Request-URL') - } - - return - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: headers(xhr), - url: responseURL() - } - var body = 'response' in xhr ? xhr.response : xhr.responseText - resolve(new Response(body, options)) - } - - xhr.onerror = function() { - reject(new TypeError('Network request failed')) - } - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')) - } - - xhr.open(request.method, request.url, true) - - if (request.credentials === 'include') { - xhr.withCredentials = true - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob' - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value) - }) - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit) - }) - } - self.fetch.polyfill = true -})(typeof self !== 'undefined' ? self : undefined); - -/** - * Takes the location name and returns the coordinates of that location using the Google - * Map API v3. This is an async function so it will return a promise. - * @param {string} location The name of any location - * @return {array} Returns an array in the form [latitude, longitude] - */ -function getCoordinate(location) { - let url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`; - return new Promise((resolve) => { - fetch(url) - .then((data) => data.json()) - .then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng])) - }) -} - -/** - * Returns the template of the Map widget. The source of the iframe is based on whether the - * mode set in options is 'place', 'streetview' or 'view'. - * @param {string} match The matching string in the form of @(location name). - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {object} options plugin options - * @return {string} Template of the map widget. - */ -function template$1(match, latitude, longitude, options) { - const location = locationText(match); - return options.template.gmap(latitude, longitude, location, options); -} - -/** - * Extracts out the location name from the format @(locationName) - * @param {string} match The string in the supported format. Eg : @(Delhi) - * @return {string} Only the location name removing @ and brackets. Eg: Delhi - */ -function locationText(match) { - return match.split('(')[1].split(')')[0] -} - -var gmap = function (input, output, options, embeds) { - let match, promises = [], allMatches = []; - - const service = 'map'; - - while ((match = matches(regex.gmap, output)) !== null) { - options.served.push(match); - const promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]); - promises.push(promise); - allMatches.push(match) - } - - return new Promise((resolve) => { - Promise.all(promises).then((coordinatesArr) => { - for (var i in promises) { - let [latitude, longitude] = coordinatesArr[i]; - let text = template$1((allMatches[i])[0], latitude, longitude, options); - if (ifInline(options, service)) { - output = output.replace(regex.gmap, (regexMatch) => { - return `${locationText(regexMatch)}${text}` - }) - } else { - embeds.push({ - text : text, - index: allMatches[i][0].index - }); - output = output.replace(regex.gmap, (regexMatch) => { - return `${locationText(regexMatch)}` - }); - } - } - resolve([output, embeds]) - }) - }) -} - -var markdown = function (output, options) { - if (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`); - - const Marked = options.plugins.marked; - const renderer = new Marked.Renderer(); - - renderer.link = (href, title, text) => { - if (href.indexOf('</a') === -1) return href; - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return `${text}` - } - }; - - renderer.image = (href, title, text) => { - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return `
${text}
` - } - return `
${text}
` - }; - - renderer.paragraph = (text) => `

${text}

`; //for font smiley in end. - - //Fix for heading that should be actually present in marked.js - //if gfm is true the `## Heading` is acceptable but `##Heading` is not - Marked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading; - Marked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading; - - options.markedOptions.renderer = renderer; - options.markedOptions.highlight = false; - return Marked(output, options.markedOptions) -} - -/** - * Encodes the characters like <, > and space and replaces them with - * <, > and > respectively. - * @param {string} code The string that has to be encoded. - * @return {string} The encoded string - */ -function encode(code) { - code = code.replace(/&/gm, ''); - code = code.replace(/</g, '<'); - code = code.replace(/>/g, '>'); - return code; -} - -/** - * removes whitespace characters - * @param {string} code The string from which the whitespace has to be removed - * @return {string} - */ -function trimSpace(code) { - code = code.replace(/^([ \t]*)/g, ''); // leading whitespace - code = code.replace(/[ \t]*$/g, ''); // trailing whitespace - return code; -} - - -/** - * Places the code and the language name in the required template - * @param {string} processedCode - * @param {string} language - * @return {string} - */ -function addTemplate(processedCode, language) { - return `
${processedCode.value || processedCode}
` -} - - -/** - * Replaces the code block with the pre tags and returns a string having the code - * formatting using Highlight.js. - * => Matches the string with the regex and finds the code written in three back-ticks ``` - * => Detects whether any language has been provided by the user. - * The format supported by embed.js is - * ```[language-name] - * var a = 2; - * ``` - * => Trims all the unnecessary spaces and newlines from the code. - * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string - * having the html tags for styling. The `language` here is optional. In case we don't pass the - * language, it tries to detect the language itself. - * => Replaces the code string in the template with the formatted string - * @return {string} The string in which the code is formatted - */ -var highlight = function (output, options) { - output = output.replace(regex.inlineCode, function (match, group1, group2) { - return `${group2}` - }); - - return output.replace(regex.highlightCode, (match, group1, group2, group3) => { - let code = group3; - code = trimSpace(code); - code = encode(code); - - // to prevent auto-linking. Not necessary in code - // *blocks*, but in code spans. Will be converted - // back after the auto-linker runs. - code = code.replace(/:\/\//g, '~P'); - - let language = group2.split('\n')[0]; - let highlightedCode; - - const HighlightJS = options.plugins.highlightjs; - if (language) { - highlightedCode = HighlightJS.highlightAuto(code, [language]); - } else { - highlightedCode = HighlightJS.highlightAuto(code); - language = highlightedCode.language; - } - - return addTemplate(highlightedCode, language); - }); -} - -class Gist { - constructor(input, output, options, embeds) { - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.gist; - this.service = 'gist'; - - if(typeof this.options.input !== 'string'){ - this.options.input.addEventListener('rendered', () => { - this.load() - }) - } - } - - template(match) { - return `
` - } - - load() { - let gists = this.options.input.getElementsByClassName('ejs-gist'); - for (let i = 0; i < gists.length; i++) { - let gistFrame = document.createElement("iframe"); - gistFrame.setAttribute("width", "100%"); - gistFrame.id = `ejs-gist-${i}`; - - let zone = gists[i]; - zone.innerHTML = ""; - zone.appendChild(gistFrame); - - // Create the iframe's document - let url = gists[i].getAttribute('data-src'); - url = url.indexOf('http') === -1 ? `https://${url}` : url; - let gistFrameHTML = ``; - - // Set iframe's document with a trigger for this document to adjust the height - let gistFrameDoc = gistFrame.document; - - if (gistFrame.contentDocument) { - gistFrameDoc = gistFrame.contentDocument; - } else if (gistFrame.contentWindow) { - gistFrameDoc = gistFrame.contentWindow.document; - } - - gistFrameDoc.open(); - gistFrameDoc.writeln(gistFrameHTML); - gistFrameDoc.close(); - } - } - - process() { - return embed(this); - } -} - -function formatData(data) { - return { - title : data.snippet.title, - thumbnail : data.snippet.thumbnails.medium.url, - rawDescription: data.snippet.description, - views : data.statistics.viewCount, - likes : data.statistics.likeCount, - description : truncate(data.snippet.description, 150), - url : `https://www.youtube.com/watch?v=${data.id}`, - id : data.id, - host : 'youtube' - } -} - -function data(id, options) { - let url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`; - return new Promise((resolve) => { - fetch(url) - .then((data) => data.json()) - .then((json) => resolve(json.items[0])) - }) -} - -function urlToText(args, match, url, normalEmbed) { - let id = normalEmbed ? match[1] : match[2]; - let embedUrl = `https://www.youtube.com/embed/${id}`; - if (args.options.videoDetails) { - return new Promise((resolve) => { - data(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options))) - }) - } else { - return new Promise((resolve) => resolve(template(embedUrl, args.options))) - } -} - -var youtube = function (input, output, options, embeds) { - const args = { - input, - output, - options, - embeds, - regex : regex.youtube, - service: 'youtube' - }; - - return new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data))) -} - -function formatData$1(data, truncate$$1) { - return { - title : data.title, - thumbnail : data.thumbnail_medium, - rawDescription: data.description.replace(/\n/g, '
').replace(/ /g, '
'), - views : data.stats_number_of_plays, - likes : data.stats_number_of_likes, - description : truncate$$1(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), - url : data.url, - id : data.id, - host : 'vimeo' - } -} - -function data$1(id) { - let url = `https://vimeo.com/api/v2/video/${id}.json`; - return new Promise((resolve) => { - fetch(url) - .then((data) => data.json()) - .then((json) => resolve(json[0])) - }) -} - -function urlToText$1(args, match, url, normalEmbed) { - let id; - if (!normalEmbed) { - id = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop(); - } else { - id = match[3] - } - if (!id) return; - let embedUrl = `https://player.vimeo.com/video/${id}`; - if (args.options.videoDetails) { - return new Promise((resolve) => { - data$1(id).then((data) => resolve(getDetailsTemplate(formatData$1(data, truncate), data, embedUrl, args.options))) - }) - } else { - return new Promise((resolve) => resolve(template(embedUrl, args.options))) - } - -} - -var vimeo = function (input, output, options, embeds) { - const args = { - input, - output, - options, - embeds, - regex : regex.vimeo, - service: 'vimeo' - }; - - return new Promise((resolve) => asyncEmbed(args, urlToText$1).then((data) => resolve(data))) -} - -function fetchData(args, url) { - let api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`; - return new Promise((resolve) => { - fetchJsonp$1(api, {credentials: 'include'}) - .then((data) => data.json()) - .then((json) => resolve(json.html)) - }) -} - -function urlToText$2(args, match, url) { - return new Promise((resolve) => { - fetchData(args, url).then((html) => resolve(args.template(html))) - }) -} - -var slideShare = function (input, output, options, embeds) { - const args = { - input, output, options, embeds, - regex: regex.slideShare, - service: 'slideshare', - template(html) { - return this.options.template.slideShare(html, this.options) - } - }; - - return new Promise((resolve) => asyncEmbed(args, urlToText$2).then((data) => resolve(data))) -} - -function fetchData$1(url, _) { - url = encodeURIComponent(url); - let api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url); - return new Promise((resolve) => { - fetch(api) - .then((res)=>res.json()) - .then((json)=>resolve(_.options.onOpenGraphFetch(json) || json)) - }) -} - -function urlToText$3(_, match, url) { - if (url.match(_.excludeRegex)) return Promise.resolve(); - - return new Promise((resolve) => { - fetchData$1(url, _).then((data) => resolve(data && data.success ? _.template(data) : '')) - }) -} - -var openGraph = function (input, output, options, embeds) { - const args = { - input, - output, - options, - embeds, - service : 'opengraph', - regex : urlRegex(), - excludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'), - template(data) { - return this.options.template.openGraph(data, this.options) - } - }; - - return new Promise((resolve) => asyncEmbed(args, urlToText$3).then((data) => resolve(data))) -} - -function template$2(data, options) { - return options.template.github(data, options); -} - -function fetchRepo(data) { - let api = `https://api.github.com/repos/${data.user}/${data.repo}`; - return new Promise((resolve) => { - fetch(api) - .then(function (data) { - return data.json() - }) - .then(function (json) { - return resolve(json) - }) - }) -} - -function urlToText$4(_this, match, url, normalEmbed) { - let data = !normalEmbed ? ({ - user: match[2], - repo: match[3] - }) : ({ - user: match[1], - repo: match[2] - }); - - if (!data.repo) return; - return new Promise(function (resolve) { - fetchRepo(data) - .then(function (response) { - return resolve(template$2(response, _this.options)) - }) - }) -} - -var github = function (input, output, options, embeds) { - const args = { - input, output, options, embeds, - service: 'github', - regex : regex.github - }; - - return new Promise((resolve) => asyncEmbed(args, urlToText$4).then((data) => resolve(data))) -} - -var mentions = function (input, options) { - const mRegex = regex.mentions; - return input.replace(mRegex,(match, $1, $2) => { - const username = $2.split('@')[1]; - return $1 + options.mentionsUrl(username); - }) -} - -var hashtag = function (input, options) { - const hRegex = regex.hashtag; - return input.replace(hRegex,(match, $1, $2)=>{ - const username = $2.split('#')[1]; - return $1 + options.hashtagUrl(username); - }) -} - -let globalOptions = {}; - -const defaultOptions = { - marked: false, - markedOptions: {}, - link: true, - linkOptions: { - target: 'self', - exclude: ['pdf'], - rel: '' - }, - emoji: true, - customEmoji: [], - fontIcons: true, - customFontIcons: [], - highlightCode: false, - mentions: false, - hashtag: false, - videoJS: false, - videojsOptions: { - fluid: true, - preload: 'metadata' - }, - plyr: false, - plyrOptions: {}, - locationEmbed: true, - mapOptions: { - mode: 'place' - }, - tweetsEmbed: false, - tweetOptions: { - maxWidth: 550, - hideMedia: false, - hideThread: false, - align: 'none', - lang: 'en' - }, - singleEmbed: false, - openGraphEndpoint: null, - openGraphExclude: [], - videoEmbed: true, - videoHeight: null, - videoWidth: null, - videoDetails: true, - audioEmbed: true, - imageEmbed: true, - excludeEmbed: [], - inlineEmbed: [], - inlineText: true, - codeEmbedHeight: 500, - vineOptions: { - maxWidth: null, - type: 'postcard', //'postcard' or 'simple' embedding - responsive: true, - width: 350, - height: 460 - }, - plugins: { - marked: window.marked, - videojs: window.videojs, - plyr: window.plyr, - highlightjs: window.hljs, - prismjs: window.Prism, - twitter: window.twttr - }, - googleAuthKey: '', - soundCloudOptions: { - height: 160, - themeColor: 'f50000', //Hex Code of the player theme color - autoPlay: false, - hideRelated: false, - showComments: true, - showUser: true, - showReposts: false, - visual: false, //Show/hide the big preview image - download: false //Show/Hide download buttons - }, - videoClickClass: 'ejs-video-thumb', - customVideoClickHandler: false, - mentionsUrl: function () { - }, - hashtagUrl: function () { - }, - beforeEmbedJSApply: function () { - }, - afterEmbedJSApply: function () { - }, - onVideoShow: function () { - }, - onTweetsLoad: function () { - }, - videojsCallback: function () { - }, - onOpenGraphFetch: function () { - }, - onOpenGraphFail: function () { - }, - videoClickHandler: function () { - }, - served: [] //Private variable used to store processed urls so that they are not processed multiple times. -}; - -let instances = []; -let allInstances = []; -let promises = []; - -class EmbedJS { - /** - * The constructor takes two arguments. The first one is the options object and the second one is the - * optional string . If the user wants to provide a string directly instead of the element, he can do that. - * In case the user provides both the input element and the string, the input string will be taken from the element - * and the provided string won't be processed. - * - * @param {object} options The options object - * @param template - * @return {null} - */ - constructor(options, template$$1) { - /** - * We have created a clone of the original options to make sure that the original object - * isn't altered. - */ - let defOpts = cloneObject(defaultOptions); - let globOpts = cloneObject(globalOptions); - - //merge global options with the default options - let globOptions = deepExtend(defOpts, globOpts); - - //deepExtend global options with the overriding options provided by the user as an options - //object while creating a new instance of embed.js - this.options = deepExtend(globOptions, options); - - this.options.template = template$$1 || renderer; - - if (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); - - this.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input - - } - - /** - * Processes the string and performs all the insertions and manipulations based on - * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready - * @return {Promise} The processes resulting string - */ - process() { - const input = this.input; - - if (input === '') return Promise.resolve(''); - - const options = processOptions(this.options); - let embeds = []; - let output = input; - - this.options.beforeEmbedJSApply(); - - return new Promise((resolve) => { - if (options.link) - output = url(input, options); - - const openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]); - - openGraphPromise.then(function ([output, embeds]) { - if (options.highlightCode) { - output = highlight(output, options) - } - if (options.marked) { - output = markdown(output, options) - } - if (options.emoji) { - output = emoji(output, options) - } - if (options.fontIcons) { - output = smiley(output, options) - } - if (options.mentions) { - output = mentions(output, options); - } - if (options.hashtag) { - output = hashtag(output, options); - } - - [output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram'); - [output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed); - - if (ifEmbed(options, 'gist')) { - [output, embeds] = new Gist(input, output, options, embeds).process() - } - - return ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function ([output, embeds]) { - return ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function ([output, embeds]) { - return ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function ([output, embeds]) { - return options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds]) - }).then(function ([output, embeds]) { - return ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(([output, embeds]) => { - if (options.tweetsEmbed && ifEmbed(options, 'twitter')) { - this.twitter = new Twitter(input, output, options, embeds); - return this.twitter.process() - } else { - return Promise.resolve([output, embeds]) - } - }).then(([output, embeds]) => { - this.data = { - input: options.input, - output, - options, - inputString: this.input, - services: options.served, - template: options.template - }; - - resolve(createText(output, embeds)) - - }) - }) - } - - /** - * First processes the data by calling the .process() and then renders the data in the div - * => Loads the twitter widgets - * => Executes the onTweetsLoad() once all the tweets have been rendered - * => Applies video.js on the media (both audio and video) - * => Triggers video loading on click of the video preview - * => Executes afterEmbedJSApply() once everything is done. - * - * @return Promise - */ - render() { - if (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`); - if (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`); - - return new Promise((resolve) => { - this.process().then((data) => { - this.options.input.innerHTML = data; - this.applyListeners(); - resolve(this.data); - }) - }) - } - - /** - * This method listens to all the events like click, handle - * events to be done after an element has been rendered. These - * include twitter widget rendering, gist embedding, click event listeners . - */ - applyListeners() { - applyVideoJS(this.options); - applyPlyr(this.options); - - playVideo(this.options); - - let event = new Event('rendered'); - this.options.input.dispatchEvent(event); - - this.options.afterEmbedJSApply(); - } - - - /** - * This function updates the parametrs of the current instance - * @param options New updated options object. will be extended with the older options - * @param template [optional] the new template instance - */ - update(options, template$$1) { - - if (options) - this.options = deepExtend(this.options, options); - - if (template$$1) - this.options.template = template$$1; - - if (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); - - this.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input - } - - /** - * returns the resulting string based on the input and the options passed by the user. - * @return Promise - */ - text(callback) { - this.process().then((data) => callback(data, this.input)) - } - - /** - * The destroy method destroys all the listeners and replaces the rih text with the original text in the - * element. - * @return {null} - */ - destroy() { - if (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`); - destroyVideos('ejs-video-thumb'); - if (this.options.tweetsEmbed) - this.options.input.removeEventListener('rendered', this.twitter.load(), false); - this.options.input.innerHTML = this.input - } - - /** - * Sets options globally - * @param {object} options - */ - static setOptions(options) { - globalOptions = deepExtend(defaultOptions, options) - } - - /** - * Applies embed.js to all the elements with the class name provided as option - * @return {Promise} - * @param selectorName - * @param options - * @param template - */ - static applyEmbedJS(selectorName, options = {}, template$$1 = renderer) { - let elements = document.querySelectorAll(selectorName); - for (let i = 0; i < elements.length; i++) { - options.input = elements[i]; - instances[i] = new EmbedJS(options, template$$1); - promises[i] = instances[i].render() - } - return new Promise(function (resolve) { - Promise.all(promises).then(function (val) { - resolve(val); - }) - }) - } - - /** - * Destroys all the instances of EmbedJS created by using applyEmbedJS() method. - * @return {null} - */ - static destroyEmbedJS() { - for (let i = 0; i < instances.length; i++) { - instances[i].destroy() - } - } - - /** - * Destroys all instances of EmbedJS on the page - * @return {null} - */ - static destroyAll() { - for (let i = 0; i < allInstances.length; i++) { - allInstances[i].destroy() - } - } - - /** - * Creates a new instance of the Template constructor. This has been done so that multiple - * templates of a single service can be used by creating different instances of the Template. - * - * The usage of the plugin is described below. - * - * => Create a new Instance of the template by using .Template() method of EmbedJS. - * - * var template = EmbedJS.Template() - * - * => Now create different templates for different service names. - * - * template.url = function(match, options){ - * return ' + match + ' - * } - * - * template.instagram = function(match, dimensions, options){ - * var config = options.soundCloudOptions; - * return `
`; - * } - * - */ - static Template() { - return renderer; - } -} - -export default EmbedJS; -//# sourceMappingURL=embed.es2015.js.map diff --git a/src/embed.es2015.js.map b/src/embed.es2015.js.map deleted file mode 100644 index a69c9f0..0000000 --- a/src/embed.es2015.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["this","fetchJsonp","template","formatData","truncate","data","urlToText","fetchData"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAAS,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;CACrE;;;;;;;AAOD,AAAO,AAWN;;;;;;AAMD,AAAO,SAAS,KAAK,CAAC,MAAM,EAAE;IAC1B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM;CAClE;;;;;;;;AAQD,AAAO,SAAS,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE;IAC5C,KAAK,IAAI,QAAQ,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,QA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;;;;;;;;;CAwBD,OAAO,QAAQ,GAAG;EACjB,OAAO,QAAQ,CAAC;EAChB;CACD;;"} \ No newline at end of file diff --git a/src/embed.js b/src/embed.js deleted file mode 100644 index 464ff36..0000000 --- a/src/embed.js +++ /dev/null @@ -1,2461 +0,0 @@ -/* - * embed-js - v4.1.10 - * A JavaScript plugin that analyses the string and embeds emojis, media, tweets, code and services. - * http://riteshkr.com/embed.js - * - * Made by Ritesh Kumar - * Under MIT License - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.EmbedJS = factory()); -}(this, (function () { 'use strict'; - -var __commonjs_global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this; -function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports, __commonjs_global), module.exports; } - - -var babelHelpers = {}; -babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; -}; - -babelHelpers.classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -babelHelpers.createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - -babelHelpers.slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - -babelHelpers; - -/** - * Trucates the string and adds ellipsis at the end. - * @param string The string to be truncated - * @param n Length to which it should be truncated - * @returns {string} The truncated string - */ -function truncate(string, n) { - return string.substr(0, n - 1) + (string.length > n ? '...' : ''); -} - -/** - * Returns an array after removing the duplicates. - * @param array The array containing the duplicates - * @returns {Array} Array with unique values. - */ - - -/** - * Converts a string into legitimate url. - * @param string - */ -function toUrl(string) { - return string.indexOf('//') === -1 ? '//' + string : string; -} - -/** - * Extends an Object - * @param destination - * @param source - * @returns {*} - */ -function deepExtend(destination, source) { - for (var property in source) { - if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) { - destination[property] = destination[property] || {}; - deepExtend(destination[property], source[property]); - } else { - destination[property] = source[property]; - } - } - return destination; -} - -function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -/** - * Sort an array of objects based on the index value - * @param {Array} arr Array to be sorted - * @return {Array} Sorted array - */ -function sortObject(arr) { - return arr.sort(function (a, b) { - return a.index - b.index; - }); -} - -/** - * Creates the string of the iframes after sorting them and finally returning a string - * @param {string} str String to which the created text has to be added - * @param {object} embeds Sorted array of iframe html - * @return {string} String to be rendered - */ -function createText(str, embeds) { - var sortedEmbeds = sortObject(embeds); - for (var i = 0; i < sortedEmbeds.length; i++) { - str += ' ' + sortedEmbeds[i].text; - } - return str; -} - -/** - * Matches the string and finds the substrings matching to the provided regex pattern - * @param {object} regex Regex pattern - * @param {string} input The string to be analyzed - * @return {object} Returns the matched substring with their corresponding positions - */ -function matches(regex, input) { - return regex.exec(input); -} - -/** - * Checks whether a particular service should be embedded or not based on - * the setting provided by the user - * @param {object} options The options provided by the user - * @param {string} service Name of the service for which the condition is to be analyzed - * @return {boolean} True if it should be embedded - */ -function ifEmbed(options, service) { - if (options.singleEmbed && options.served.length) return; - return options.excludeEmbed.indexOf(service) == -1 && !(options.excludeEmbed === 'all'); -} - -function ifInline(options, service) { - return options.inlineEmbed.indexOf(service) >= 0 || options.inlineEmbed === 'all'; -} - -/** - * Calculates the dimensions for the elements based on a aspect ratio - * @param {object} options Plugin options - * @return {object} The width and height of the elements - */ -function setDimensions(options) { - options.videoWidth = options.videoWidth || options.videoHeight / 3 * 4 || 800; - options.videoHeight = options.videoHeight || options.videoWidth / 4 * 3 || 600; - return options; -} - -/** - * Returns a cloned object - * @param {object} obj - * @return {object} cloned object - */ -function cloneObject(obj) { - if (obj === null || (typeof obj === 'undefined' ? 'undefined' : babelHelpers.typeof(obj)) !== 'object') return obj; - var temp = obj.constructor(); // give temp the original obj's constructor - for (var key in obj) { - temp[key] = cloneObject(obj[key]); - } - return temp; -} - -function urlRegex() { - return (/((href|src)=["']|)(\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/)?(?:(?:0rz\.tw)|(?:1link\.in)|(?:1url\.com)|(?:2\.gp)|(?:2big\.at)|(?:2tu\.us)|(?:3\.ly)|(?:307\.to)|(?:4ms\.me)|(?:4sq\.com)|(?:4url\.cc)|(?:6url\.com)|(?:7\.ly)|(?:a\.gg)|(?:a\.nf)|(?:aa\.cx)|(?:abcurl\.net)|(?:ad\.vu)|(?:adf\.ly)|(?:adjix\.com)|(?:afx\.cc)|(?:all\.fuseurl.com)|(?:alturl\.com)|(?:amzn\.to)|(?:ar\.gy)|(?:arst\.ch)|(?:atu\.ca)|(?:azc\.cc)|(?:b23\.ru)|(?:b2l\.me)|(?:bacn\.me)|(?:bcool\.bz)|(?:binged\.it)|(?:bit\.ly)|(?:buff\.ly)|(?:bizj\.us)|(?:bloat\.me)|(?:bravo\.ly)|(?:bsa\.ly)|(?:budurl\.com)|(?:canurl\.com)|(?:chilp\.it)|(?:chzb\.gr)|(?:cl\.lk)|(?:cl\.ly)|(?:clck\.ru)|(?:cli\.gs)|(?:cliccami\.info)|(?:clickthru\.ca)|(?:clop\.in)|(?:conta\.cc)|(?:cort\.as)|(?:cot\.ag)|(?:crks\.me)|(?:ctvr\.us)|(?:cutt\.us)|(?:dai\.ly)|(?:decenturl\.com)|(?:dfl8\.me)|(?:digbig\.com)|(?:digg\.com)|(?:disq\.us)|(?:dld\.bz)|(?:dlvr\.it)|(?:do\.my)|(?:doiop\.com)|(?:dopen\.us)|(?:easyuri\.com)|(?:easyurl\.net)|(?:eepurl\.com)|(?:eweri\.com)|(?:fa\.by)|(?:fav\.me)|(?:fb\.me)|(?:fbshare\.me)|(?:ff\.im)|(?:fff\.to)|(?:fire\.to)|(?:firsturl\.de)|(?:firsturl\.net)|(?:flic\.kr)|(?:flq\.us)|(?:fly2\.ws)|(?:fon\.gs)|(?:freak\.to)|(?:fuseurl\.com)|(?:fuzzy\.to)|(?:fwd4\.me)|(?:fwib\.net)|(?:g\.ro.lt)|(?:gizmo\.do)|(?:gl\.am)|(?:go\.9nl.com)|(?:go\.ign.com)|(?:go\.usa.gov)|(?:goo\.gl)|(?:goshrink\.com)|(?:gurl\.es)|(?:hex\.io)|(?:hiderefer\.com)|(?:hmm\.ph)|(?:href\.in)|(?:hsblinks\.com)|(?:htxt\.it)|(?:huff\.to)|(?:hulu\.com)|(?:hurl\.me)|(?:hurl\.ws)|(?:icanhaz\.com)|(?:idek\.net)|(?:ilix\.in)|(?:is\.gd)|(?:its\.my)|(?:ix\.lt)|(?:j\.mp)|(?:jijr\.com)|(?:kl\.am)|(?:klck\.me)|(?:korta\.nu)|(?:krunchd\.com)|(?:l9k\.net)|(?:lat\.ms)|(?:liip\.to)|(?:liltext\.com)|(?:linkbee\.com)|(?:linkbun\.ch)|(?:liurl\.cn)|(?:ln-s\.net)|(?:ln-s\.ru)|(?:lnk\.gd)|(?:lnk\.ms)|(?:lnkd\.in)|(?:lnkurl\.com)|(?:lru\.jp)|(?:lt\.tl)|(?:lurl\.no)|(?:macte\.ch)|(?:mash\.to)|(?:merky\.de)|(?:migre\.me)|(?:miniurl\.com)|(?:minurl\.fr)|(?:mke\.me)|(?:moby\.to)|(?:moourl\.com)|(?:mrte\.ch)|(?:myloc\.me)|(?:myurl\.in)|(?:n\.pr)|(?:nbc\.co)|(?:nblo\.gs)|(?:nn\.nf)|(?:not\.my)|(?:notlong\.com)|(?:nsfw\.in)|(?:nutshellurl\.com)|(?:nxy\.in)|(?:nyti\.ms)|(?:o-x\.fr)|(?:oc1\.us)|(?:om\.ly)|(?:omf\.gd)|(?:omoikane\.net)|(?:on\.cnn.com)|(?:on\.mktw.net)|(?:onforb\.es)|(?:orz\.se)|(?:ow\.ly)|(?:ping\.fm)|(?:pli\.gs)|(?:pnt\.me)|(?:politi\.co)|(?:post\.ly)|(?:pp\.gg)|(?:profile\.to)|(?:ptiturl\.com)|(?:pub\.vitrue.com)|(?:qlnk\.net)|(?:qte\.me)|(?:qu\.tc)|(?:qy\.fi)|(?:r\.im)|(?:rb6\.me)|(?:read\.bi)|(?:readthis\.ca)|(?:reallytinyurl\.com)|(?:redir\.ec)|(?:redirects\.ca)|(?:redirx\.com)|(?:retwt\.me)|(?:ri\.ms)|(?:rickroll\.it)|(?:riz\.gd)|(?:rt\.nu)|(?:ru\.ly)|(?:rubyurl\.com)|(?:rurl\.org)|(?:rww\.tw)|(?:s4c\.in)|(?:s7y\.us)|(?:safe\.mn)|(?:sameurl\.com)|(?:sdut\.us)|(?:shar\.es)|(?:shink\.de)|(?:shorl\.com)|(?:short\.ie)|(?:short\.to)|(?:shortlinks\.co.uk)|(?:shorturl\.com)|(?:shout\.to)|(?:show\.my)|(?:shrinkify\.com)|(?:shrinkr\.com)|(?:shrt\.fr)|(?:shrt\.st)|(?:shrten\.com)|(?:shrunkin\.com)|(?:simurl\.com)|(?:slate\.me)|(?:smallr\.com)|(?:smsh\.me)|(?:smurl\.name)|(?:sn\.im)|(?:snipr\.com)|(?:snipurl\.com)|(?:snurl\.com)|(?:sp2\.ro)|(?:spedr\.com)|(?:srnk\.net)|(?:srs\.li)|(?:starturl\.com)|(?:su\.pr)|(?:surl\.co.uk)|(?:surl\.hu)|(?:t\.cn)|(?:t\.co)|(?:t\.lh.com)|(?:ta\.gd)|(?:tbd\.ly)|(?:tcrn\.ch)|(?:tgr\.me)|(?:tgr\.ph)|(?:tighturl\.com)|(?:tiniuri\.com)|(?:tiny\.cc)|(?:tiny\.ly)|(?:tiny\.pl)|(?:tinylink\.in)|(?:tinyuri\.ca)|(?:tinyurl\.com)|(?:tl\.gd)|(?:tmi\.me)|(?:tnij\.org)|(?:tnw\.to)|(?:tny\.com)|(?:to\.ly)|(?:togoto\.us)|(?:totc\.us)|(?:toysr\.us)|(?:tpm\.ly)|(?:tr\.im)|(?:tra\.kz)|(?:trunc\.it)|(?:twhub\.com)|(?:twirl\.at)|(?:twitclicks\.com)|(?:twitterurl\.net)|(?:twitterurl\.org)|(?:twiturl\.de)|(?:twurl\.cc)|(?:twurl\.nl)|(?:u\.mavrev.com)|(?:u\.nu)|(?:u76\.org)|(?:ub0\.cc)|(?:ulu\.lu)|(?:updating\.me)|(?:ur1\.ca)|(?:url\.az)|(?:url\.co.uk)|(?:url\.ie)|(?:url360\.me)|(?:url4\.eu)|(?:urlborg\.com)|(?:urlbrief\.com)|(?:urlcover\.com)|(?:urlcut\.com)|(?:urlenco\.de)|(?:urli\.nl)|(?:urls\.im)|(?:urlshorteningservicefortwitter\.com)|(?:urlx\.ie)|(?:urlzen\.com)|(?:usat\.ly)|(?:use\.my)|(?:vb\.ly)|(?:vgn\.am)|(?:vl\.am)|(?:vm\.lc)|(?:w55\.de)|(?:wapo\.st)|(?:wapurl\.co.uk)|(?:wipi\.es)|(?:wp\.me)|(?:x\.vu)|(?:xr\.com)|(?:xrl\.in)|(?:xrl\.us)|(?:xurl\.es)|(?:xurl\.jp)|(?:y\.ahoo.it)|(?:yatuc\.com)|(?:ye\.pe)|(?:yep\.it)|(?:yfrog\.com)|(?:yhoo\.it)|(?:yiyd\.com)|(?:youtu\.be)|(?:yuarel\.com)|(?:z0p\.de)|(?:zi\.ma)|(?:zi\.mu)|(?:zipmyurl\.com)|(?:zud\.me)|(?:zurl\.ws)|(?:zz\.gd)|(?:zzang\.kr)|(?:›\.ws)|(?:✩\.ws)|(?:✿\.ws)|(?:❥\.ws)|(?:➔\.ws)|(?:➞\.ws)|(?:➡\.ws)|(?:➨\.ws)|(?:➯\.ws)|(?:➹\.ws)|(?:➽\.ws))\/[a-z0-9]*/gi - ); -} - -function arrayLowercase(options, property) { - if (typeof options[property] !== 'string') { - options[property] = options[property].map(function (elem) { - return elem.toLowerCase(); - }); - } - return options; -} - -/** - * Sets the dimensions and converts options values' Array into lowercase. - * @param options - * @returns {Object|*} - */ -function processOptions(options) { - options = setDimensions(options); - options = arrayLowercase(options, 'excludeEmbed'); - options = arrayLowercase(options, 'inlineEmbed'); - return arrayLowercase(options, 'openGraphExclude'); -} - -/** - * Get the last element of an array or string - * @param elem [String|Array] - * @returns last element of the Array or String - */ -function lastElement(elem) { - return elem[elem.length - 1]; -} - -var renderer = { - url: function url(match, options) { - var config = options.linkOptions; - return '' + match + ''; - }, - smiley: function smiley(text, pre, code) { - return '' + pre + code + ''; - }, - emoji: function emoji(text) { - return ''; - }, - audio: function audio(match) { - return '
'; - }, - soundcloud: function soundcloud(match, options) { - var config = options.soundCloudOptions; - return '
\n\t\t\n\t\t
'; - }, - spotify: function spotify(match) { - var id = lastElement(match.split('/')); - return '
'; - }, - codepen: function codepen(id, options) { - return '
'; - }, - ideone: function ideone(match, options) { - return '
'; - }, - jsbin: function jsbin(id, options) { - return '
'; - }, - jsfiddle: function jsfiddle(id, options) { - id = lastElement(id) == '/' ? id.slice(0, -1) : id; - id = id.indexOf('//') !== -1 ? id : '//' + id; - return '
'; - }, - plunker: function plunker(id, options) { - return '
'; - }, - image: function image(match) { - return '
'; - }, - flickr: function flickr(match, options) { - return '
'; - }, - instagram: function instagram(match, options) { - return '
'; - }, - slideShare: function slideShare(html) { - return '
' + html + '
'; - }, - video: function video(match) { - return '
'; - }, - dailymotion: function dailymotion(match, options) { - var id = lastElement(match.split('/')); - return '
'; - }, - liveleak: function liveleak(match, options) { - return '
'; - }, - ted: function ted(match, options) { - var a = match.split('/'); - var id = a[a.length - 1]; - return '
'; - }, - ustream: function ustream(match, options) { - var id = match.split('/'); - id.splice(1, 0, 'embed'); - return '
'; - }, - detailsVimeo: function detailsVimeo(data, fullData, embedUrl) { - return '
' + data.description + '
' + data.views + '' + data.likes + '
'; - }, - detailsYoutube: function detailsYoutube(data, fullData, embedUrl) { - return '
' + data.description + '
' + data.views + '' + data.likes + '
'; - }, - vine: function vine(match, options) { - var id = lastElement(match.split('/')); - var config = options.vineOptions; - return '
'; - }, - vimeo: function vimeo(url, options) { - return options.plyr ? '
' : '
'; - }, - youtube: function youtube(url, options) { - return options.plyr ? '
' : '
'; - }, - openGraph: function openGraph(data, options) { - return '
' + data.description + '
'; - }, - github: function github(data, options) { - return '
' + data.description + '
' + data.stargazers_count + '' + data.network_count + '
'; - }, - gmap: function gmap(latitude, longitude, location, options) { - var config = options.mapOptions; - if (config.mode === 'place') { - return '
'; - } else if (config.mode === 'streetview') { - return '
'; - } else if (config.mode === 'view') { - return '
'; - } - } -}; - -var regex = { - mentions: /(^|\s)(@[a-z0-9_-]+)/gi, - hashtag: /(^|\s)(#[a-z\d-]+)/gi, - basicAudio: /((?:https?):\/\/\S*\.(?:wav|mp3|ogg))/gi, - soundCloud: /(soundcloud.com)\/[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+/gi, - spotify: /spotify.com\/track\/[a-zA-Z0-9_]+/gi, - codepen: /http:\/\/codepen.io\/([A-Za-z0-9_]+)\/pen\/([A-Za-z0-9_]+)/gi, - gist: /gist.github.com\/[a-zA-Z0-9_-]+\/([a-zA-Z0-9]+)/gi, - highlightCode: /(`{3})(\s|[a-z]+)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - inlineCode: /(`)\s*([\s\S]*?[^`])\s*\1(?!`)/gm, - ideone: /ideone.com\/[a-zA-Z0-9]{6}/gi, - jsbin: /jsbin.com\/[a-zA-Z0-9_]+\/[0-9_]+/gi, - jsfiddle: /jsfiddle.net\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_\/]+/gi, - plunker: /plnkr.co\/edit\/[a-zA-Z0-9\?=]+/gi, - basicImage: /((?:https?):\/\/\S*\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi, - flickr: /flickr.com\/[a-z]+\/[a-zA-Z@_$!\d\-\]+\/[\d]+/gi, - instagram: /instagram.com\/p\/[a-zA-Z0-9_\/\?\-\=]+/gi, - slideShare: /slideshare.net\/[a-zA-Z0-9_-]*\/[a-zA-Z0-9_-]*/gi, - github: /[^\.]github.com\/([\w\.\-]+)\/([\w\.\-]+)/gi, - basicVideo: /(?:https?):\/\/\S*\.(?:ogv|webm|mp4)/gi, - dailymotion: /dailymotion.com\/video\/[a-zA-Z0-9-_]+/gi, - liveleak: /liveleak.com\/view\?i=[a-zA-Z0-9_]+/gi, - ted: /ted.com\/talks\/[a-zA-Z0-9_]+/gi, - ustream: /ustream.tv\/[a-z\/0-9]*/gi, - vimeo: /https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)*/gi, - vine: /vine.co\/v\/[a-zA-Z0-9]+/gi, - youtube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*/gi, - gmap: /@\((.+)\)/gi, - twitter: /https:\/\/twitter\.com\/\w+\/\w+\/\d+/gi, - smileys: /(\:[\+\-\w]+\:|\<[\/\\]?3|[\(\)\\\D|\*\$][\-\^]?[\:\;\=]|[\:\;\=B8][\-\^]?[3DOPp\@\$\*\\\)\(\/\|])(?=\s|[\!\.\?]|$)/gi -}; - -function getEmoji(match) { - return match[0] === ':' && lastElement(match) === ':' && match.substring(1, match.length - 1); -} - -var emoji$1 = function (output, options) { - return output.replace(regex.smileys, function (match) { - var emoji = getEmoji(match); - if (emoji) { - return options.template.emoji(emoji, options); - } - return match; - }); -} - -var defaultIcons = [{ - 'text': ':)', - 'code': '' -}, { - 'text': ':D', - 'code': '' -}, { - 'text': ':d', - 'code': '' -}, { - 'text': ':(', - 'code': '' -}, { - 'text': ':/', - 'code': '' - -}, { - 'text': ':P', - 'code': '' -}, { - 'text': ':p', - 'code': '' -}, { - 'text': '3:)', - 'code': '' -}, { - 'text': '(^)', - 'code': '' -}, { - 'text': ';)', - 'code': '' -}, { - 'text': ':o', - 'code': '' -}, { - 'text': ':O', - 'code': '' -}, { - 'text': '-_-', - 'code': '' -}, { - 'text': '(y)', - 'code': '' -}, { - 'text': ':*', - 'code': '' -}, { - 'text': '<3', - 'code': '' -}, { - 'text': '<3', - 'code': '' -}, { - 'text': '</3', - 'code': '' -}, { - 'text': ']*' + _.regex.source + ')', 'gm') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gm'); - _.output = _.output.replace(regexInline, function (match) { - var url = _.options.link ? match.slice(0, -4) : match; - if (_.options.served.indexOf(url) === -1) { - _.options.served.push(url); - if (_.options.link) { - return !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4)); - } else { - return !_.options.inlineText ? _.template(match) : match + _.template(match); - } - } else { - return match; //TODO : check whether this should be `match` - } - }); - return [_.output, _.embeds]; -} - -function normalEmbed(_) { - var match = void 0; - while ((match = matches(_.regex, _.input)) !== null) { - var url = match[0]; - if (!(_.options.served.indexOf(url) === -1) || _.options.served.length && _.options.singleEmbed) continue; - _.options.served.push(url); - var text = _.template(url); - _.embeds.push({ - text: text, - index: match.index - }); - } - return [_.output, _.embeds]; -} - -function embed(_) { - return ifInline(_.options, _.service) ? inlineEmbed(_) : normalEmbed(_); -} - -var base = function (input, output, embeds, options, regex, service) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex, - service: service, - template: function template(match) { - return this.options.template[this.service](match, this.options); - } - }; - - return embed(args); -} - -function baseEmbed(input, output, embeds, options, regex, service, flag) { - return ifEmbed(options, service) || ifEmbed(options, service) && flag ? base(input, output, embeds, options, regex, service) : [output, embeds]; -} - -/** - * This is a private function which is used to get the actual text to be replaced for - * a particular url in inline embedding. This returns a promise - * @param {object} _ reference to this - * @param {function} urlToText The function that converts url to replaceable text - * @param {object} match object containing info of matching string - * @return {Promise} resolves to the text - */ -function getInlineData(_, urlToText, match) { - var url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1]; - if (_.options.served.indexOf(url) >= 0) return Promise.resolve(null); - - return new Promise(function (resolve) { - urlToText(_, match, url).then(function (text) { - if (!text) return resolve(); - _.options.served.push(url); - resolve(text); - }); - }); -} - -/** - * A helper function for inline embedding - * @param _ - * @param urlToText - * @returns Promise - */ -function inlineAsyncEmbed(_, urlToText) { - var regexInline = _.options.link ? new RegExp('([^>]*' + _.regex.source + ')', 'gi') : new RegExp('([^\\s]*' + _.regex.source + ')', 'gi'); - var match = void 0, - promises = []; - - while ((match = matches(regexInline, _.output)) !== null) { - promises.push(getInlineData(_, urlToText, match)); - }return new Promise(function (resolve) { - if (matches.length) Promise.all(promises).then(function (data) { - var i = 0; - _.output = _.output.replace(regexInline, function (match) { - if (_.options.link) return !_.options.inlineText ? data[i] + '' : match + data[i++];else return !_.options.inlineText ? data[i] : match + data[i++]; - }); - resolve(_.output); - });else resolve(_.output); - }); -} - -function getNormalData(_, urlToText, match) { - var url = match[0]; - if (_.options.served.indexOf(url) >= 0) return; - - return new Promise(function (resolve) { - urlToText(_, match, url, true).then(function (text) { - if (!text) resolve(); - _.options.served.push(url); - _.embeds.push({ - text: text, - index: match.index - }); - resolve(); - }); - }); -} - -/** - * A helper function for normal embedding - * @param {object} _ - * @param {function} urlToText - * @return {Promise} - */ -function normalAsyncEmbed(_, urlToText) { - var match = void 0, - promises = []; - while ((match = matches(_.regex, _.input)) !== null) { - promises.push(getNormalData(_, urlToText, match)); - }return new Promise(function (resolve) { - Promise.all(promises).then(function () { - resolve(_.embeds); - }); - }); -} - -function asyncEmbed(_, urlToText) { - return new Promise(function (resolve) { - if (ifInline(_.options, _.service)) inlineAsyncEmbed(_, urlToText).then(function (output) { - return resolve([output, _.embeds]); - });else normalAsyncEmbed(_, urlToText).then(function (embeds) { - return resolve([_.output, embeds]); - }); - }); -} - -var Twitter = function () { - function Twitter(input, output, options, embeds) { - babelHelpers.classCallCheck(this, Twitter); - - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.twitter; - this.service = 'twitter'; - - this.load = this.load.bind(this); - if (typeof this.options.input !== 'string') { - this.options.input.addEventListener('rendered', this.load, false); - } - } - - /** - * Fetches the data from twitter's oEmbed API - * @param {string} url URL of the tweet - * @return {object} data containing the tweet info - */ - - - babelHelpers.createClass(Twitter, [{ - key: 'tweetData', - value: function tweetData(url) { - var config = this.options.tweetOptions; - var apiUrl = 'https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=' + url + '&maxwidth=' + config.maxWidth + '&hide_media=' + config.hideMedia + '&hide_thread=' + config.hideThread + '&align=' + config.align + '&lang=' + config.lang; - return new Promise(function (resolve) { - fetchJsonp$1(apiUrl, { credentials: 'include' }).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json); - }); - }); - } - - /** - * Load twitter widgets - * @return null - */ - - }, { - key: 'load', - value: function load() { - var twitter = this.options.plugins.twitter; - twitter.widgets.load(this.options.element); //here this refers to the element - - //Execute the function after the widget is loaded - twitter.events.bind('loaded', this.options.onTweetsLoad); - } - }, { - key: 'process', - value: function process() { - var _this2 = this; - - return new Promise(function (resolve) { - return asyncEmbed(_this2, Twitter.urlToText).then(function (data) { - return resolve(data); - }); - }); - } - }], [{ - key: 'urlToText', - value: function urlToText(_this, match, url) { - return new Promise(function (resolve) { - return _this.tweetData(url).then(function (data) { - return resolve(data.html); - }); - }); - } - }]); - return Twitter; -}(); - -(function (self) { - 'use strict'; - - if (self.fetch) { - return; - } - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: 'FileReader' in self && 'Blob' in self && function () { - try { - new Blob(); - return true; - } catch (e) { - return false; - } - }(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name'); - } - return name.toLowerCase(); - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value; - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function next() { - var value = items.shift(); - return { done: value === undefined, value: value }; - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function () { - return iterator; - }; - } - - return iterator; - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function (value, name) { - this.append(name, value); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function (name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function (name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var list = this.map[name]; - if (!list) { - list = []; - this.map[name] = list; - } - list.push(value); - }; - - Headers.prototype['delete'] = function (name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function (name) { - var values = this.map[normalizeName(name)]; - return values ? values[0] : null; - }; - - Headers.prototype.getAll = function (name) { - return this.map[normalizeName(name)] || []; - }; - - Headers.prototype.has = function (name) { - return this.map.hasOwnProperty(normalizeName(name)); - }; - - Headers.prototype.set = function (name, value) { - this.map[normalizeName(name)] = [normalizeValue(value)]; - }; - - Headers.prototype.forEach = function (callback, thisArg) { - Object.getOwnPropertyNames(this.map).forEach(function (name) { - this.map[name].forEach(function (value) { - callback.call(thisArg, value, name, this); - }, this); - }, this); - }; - - Headers.prototype.keys = function () { - var items = []; - this.forEach(function (value, name) { - items.push(name); - }); - return iteratorFor(items); - }; - - Headers.prototype.values = function () { - var items = []; - this.forEach(function (value) { - items.push(value); - }); - return iteratorFor(items); - }; - - Headers.prototype.entries = function () { - var items = []; - this.forEach(function (value, name) { - items.push([name, value]); - }); - return iteratorFor(items); - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')); - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function (resolve, reject) { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - reader.readAsArrayBuffer(blob); - return fileReaderReady(reader); - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - reader.readAsText(blob); - return fileReaderReady(reader); - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function (body) { - this._bodyInit = body; - if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (!body) { - this._bodyText = ''; - } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) { - // Only support ArrayBuffers for POST method. - // Receiving ArrayBuffers happens via Blobs, instead. - } else { - throw new Error('unsupported BodyInit type'); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob'); - } else { - return Promise.resolve(new Blob([this._bodyText])); - } - }; - - this.arrayBuffer = function () { - return this.blob().then(readBlobAsArrayBuffer); - }; - - this.text = function () { - var rejected = consumed(this); - if (rejected) { - return rejected; - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob); - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text'); - } else { - return Promise.resolve(this._bodyText); - } - }; - } else { - this.text = function () { - var rejected = consumed(this); - return rejected ? rejected : Promise.resolve(this._bodyText); - }; - } - - if (support.formData) { - this.formData = function () { - return this.text().then(decode); - }; - } - - this.json = function () { - return this.text().then(JSON.parse); - }; - - return this; - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method; - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - if (Request.prototype.isPrototypeOf(input)) { - if (input.bodyUsed) { - throw new TypeError('Already read'); - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - if (!body) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = input; - } - - this.credentials = options.credentials || this.credentials || 'omit'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests'); - } - this._initBody(body); - } - - Request.prototype.clone = function () { - return new Request(this); - }; - - function decode(body) { - var form = new FormData(); - body.trim().split('&').forEach(function (bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form; - } - - function headers(xhr) { - var head = new Headers(); - var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n'); - pairs.forEach(function (header) { - var split = header.trim().split(':'); - var key = split.shift().trim(); - var value = split.join(':').trim(); - head.append(key, value); - }); - return head; - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = options.statusText; - this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function () { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }); - }; - - Response.error = function () { - var response = new Response(null, { status: 0, statusText: '' }); - response.type = 'error'; - return response; - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function (url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code'); - } - - return new Response(null, { status: status, headers: { location: url } }); - }; - - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - - self.fetch = function (input, init) { - return new Promise(function (resolve, reject) { - var request; - if (Request.prototype.isPrototypeOf(input) && !init) { - request = input; - } else { - request = new Request(input, init); - } - - var xhr = new XMLHttpRequest(); - - function responseURL() { - if ('responseURL' in xhr) { - return xhr.responseURL; - } - - // Avoid security warnings on getResponseHeader when not allowed by CORS - if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) { - return xhr.getResponseHeader('X-Request-URL'); - } - - return; - } - - xhr.onload = function () { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: headers(xhr), - url: responseURL() - }; - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function () { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function () { - reject(new TypeError('Network request failed')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function (value, name) { - xhr.setRequestHeader(name, value); - }); - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }); - }; - self.fetch.polyfill = true; -})(typeof self !== 'undefined' ? self : undefined); - -/** - * Takes the location name and returns the coordinates of that location using the Google - * Map API v3. This is an async function so it will return a promise. - * @param {string} location The name of any location - * @return {array} Returns an array in the form [latitude, longitude] - */ -function getCoordinate(location) { - var url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' + location + '&sensor=false'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]); - }); - }); -} - -/** - * Returns the template of the Map widget. The source of the iframe is based on whether the - * mode set in options is 'place', 'streetview' or 'view'. - * @param {string} match The matching string in the form of @(location name). - * @param {number} latitude Latitude of the location - * @param {number} longitude Longitude of the location - * @param {object} options plugin options - * @return {string} Template of the map widget. - */ -function template$2(match, latitude, longitude, options) { - var location = locationText(match); - return options.template.gmap(latitude, longitude, location, options); -} - -/** - * Extracts out the location name from the format @(locationName) - * @param {string} match The string in the supported format. Eg : @(Delhi) - * @return {string} Only the location name removing @ and brackets. Eg: Delhi - */ -function locationText(match) { - return match.split('(')[1].split(')')[0]; -} - -var gmap$1 = function (input, output, options, embeds) { - var match = void 0, - promises = [], - allMatches = []; - - var service = 'map'; - - while ((match = matches(regex.gmap, output)) !== null) { - options.served.push(match); - var promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]); - promises.push(promise); - allMatches.push(match); - } - - return new Promise(function (resolve) { - Promise.all(promises).then(function (coordinatesArr) { - var _loop = function _loop() { - var _coordinatesArr$i = babelHelpers.slicedToArray(coordinatesArr[i], 2); - - var latitude = _coordinatesArr$i[0]; - var longitude = _coordinatesArr$i[1]; - - var text = template$2(allMatches[i][0], latitude, longitude, options); - if (ifInline(options, service)) { - output = output.replace(regex.gmap, function (regexMatch) { - return '' + locationText(regexMatch) + '' + text; - }); - } else { - embeds.push({ - text: text, - index: allMatches[i][0].index - }); - output = output.replace(regex.gmap, function (regexMatch) { - return '' + locationText(regexMatch) + ''; - }); - } - }; - - for (var i in promises) { - _loop(); - } - resolve([output, embeds]); - }); - }); -} - -var markdown = function (output, options) { - if (!options.plugins.marked) throw new ReferenceError('marked.js is not loaded.'); - - var Marked = options.plugins.marked; - var renderer = new Marked.Renderer(); - - renderer.link = function (href, title, text) { - if (href.indexOf('</a') === -1) return href; - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return '' + text + ''; - } - }; - - renderer.image = function (href, title, text) { - if (href.match(/>(.+)<\/a/gi)) { - if (!title) title = ''; - return '
' + text + '
'; - } - return '
' + text + '
'; - }; - - renderer.paragraph = function (text) { - return '

' + text + '

'; - }; //for font smiley in end. - - //Fix for heading that should be actually present in marked.js - //if gfm is true the `## Heading` is acceptable but `##Heading` is not - Marked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading; - Marked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading; - - options.markedOptions.renderer = renderer; - options.markedOptions.highlight = false; - return Marked(output, options.markedOptions); -} - -/** - * Encodes the characters like <, > and space and replaces them with - * <, > and > respectively. - * @param {string} code The string that has to be encoded. - * @return {string} The encoded string - */ -function encode(code) { - code = code.replace(/&/gm, ''); - code = code.replace(/</g, '<'); - code = code.replace(/>/g, '>'); - return code; -} - -/** - * removes whitespace characters - * @param {string} code The string from which the whitespace has to be removed - * @return {string} - */ -function trimSpace(code) { - code = code.replace(/^([ \t]*)/g, ''); // leading whitespace - code = code.replace(/[ \t]*$/g, ''); // trailing whitespace - return code; -} - -/** - * Places the code and the language name in the required template - * @param {string} processedCode - * @param {string} language - * @return {string} - */ -function addTemplate(processedCode, language) { - return '
' + (processedCode.value || processedCode) + '
'; -} - -/** - * Replaces the code block with the pre tags and returns a string having the code - * formatting using Highlight.js. - * => Matches the string with the regex and finds the code written in three back-ticks ``` - * => Detects whether any language has been provided by the user. - * The format supported by embed.js is - * ```[language-name] - * var a = 2; - * ``` - * => Trims all the unnecessary spaces and newlines from the code. - * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string - * having the html tags for styling. The `language` here is optional. In case we don't pass the - * language, it tries to detect the language itself. - * => Replaces the code string in the template with the formatted string - * @return {string} The string in which the code is formatted - */ -var highlight = function (output, options) { - output = output.replace(regex.inlineCode, function (match, group1, group2) { - return '' + group2 + ''; - }); - - return output.replace(regex.highlightCode, function (match, group1, group2, group3) { - var code = group3; - code = trimSpace(code); - code = encode(code); - - // to prevent auto-linking. Not necessary in code - // *blocks*, but in code spans. Will be converted - // back after the auto-linker runs. - code = code.replace(/:\/\//g, '~P'); - - var language = group2.split('\n')[0]; - var highlightedCode = void 0; - - var HighlightJS = options.plugins.highlightjs; - if (language) { - highlightedCode = HighlightJS.highlightAuto(code, [language]); - } else { - highlightedCode = HighlightJS.highlightAuto(code); - language = highlightedCode.language; - } - - return addTemplate(highlightedCode, language); - }); -} - -var Gist = function () { - function Gist(input, output, options, embeds) { - var _this = this; - - babelHelpers.classCallCheck(this, Gist); - - this.input = input; - this.output = output; - this.options = options; - this.embeds = embeds; - this.regex = regex.gist; - this.service = 'gist'; - - if (typeof this.options.input !== 'string') { - this.options.input.addEventListener('rendered', function () { - _this.load(); - }); - } - } - - babelHelpers.createClass(Gist, [{ - key: 'template', - value: function template(match) { - return '
'; - } - }, { - key: 'load', - value: function load() { - var gists = this.options.input.getElementsByClassName('ejs-gist'); - for (var i = 0; i < gists.length; i++) { - var gistFrame = document.createElement("iframe"); - gistFrame.setAttribute("width", "100%"); - gistFrame.id = 'ejs-gist-' + i; - - var zone = gists[i]; - zone.innerHTML = ""; - zone.appendChild(gistFrame); - - // Create the iframe's document - var url = gists[i].getAttribute('data-src'); - url = url.indexOf('http') === -1 ? 'https://' + url : url; - var gistFrameHTML = ''; - - // Set iframe's document with a trigger for this document to adjust the height - var gistFrameDoc = gistFrame.document; - - if (gistFrame.contentDocument) { - gistFrameDoc = gistFrame.contentDocument; - } else if (gistFrame.contentWindow) { - gistFrameDoc = gistFrame.contentWindow.document; - } - - gistFrameDoc.open(); - gistFrameDoc.writeln(gistFrameHTML); - gistFrameDoc.close(); - } - } - }, { - key: 'process', - value: function process() { - return embed(this); - } - }]); - return Gist; -}(); - -function formatData(data) { - return { - title: data.snippet.title, - thumbnail: data.snippet.thumbnails.medium.url, - rawDescription: data.snippet.description, - views: data.statistics.viewCount, - likes: data.statistics.likeCount, - description: truncate(data.snippet.description, 150), - url: 'https://www.youtube.com/watch?v=' + data.id, - id: data.id, - host: 'youtube' - }; -} - -function data(id, options) { - var url = 'https://www.googleapis.com/youtube/v3/videos?id=' + id + '&key=' + options.googleAuthKey + '&part=snippet,statistics'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json.items[0]); - }); - }); -} - -function urlToText$1(args, match, url, normalEmbed) { - var id = normalEmbed ? match[1] : match[2]; - var embedUrl = 'https://www.youtube.com/embed/' + id; - if (args.options.videoDetails) { - return new Promise(function (resolve) { - data(id, args.options).then(function (data) { - return resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)); - }); - }); - } else { - return new Promise(function (resolve) { - return resolve(template$1(embedUrl, args.options)); - }); - } -} - -var youtube$1 = function (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex.youtube, - service: 'youtube' - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$1).then(function (data) { - return resolve(data); - }); - }); -} - -function formatData$1(data, truncate$$1) { - return { - title: data.title, - thumbnail: data.thumbnail_medium, - rawDescription: data.description.replace(/\n/g, '
').replace(/ /g, '
'), - views: data.stats_number_of_plays, - likes: data.stats_number_of_likes, - description: truncate$$1(data.description.replace(/((<|<)br\s*\/*(>|>)\r\n)/g, ' '), 150), - url: data.url, - id: data.id, - host: 'vimeo' - }; -} - -function data$1(id) { - var url = 'https://vimeo.com/api/v2/video/' + id + '.json'; - return new Promise(function (resolve) { - fetch(url).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json[0]); - }); - }); -} - -function urlToText$2(args, match, url, normalEmbed) { - var id = void 0; - if (!normalEmbed) { - id = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop(); - } else { - id = match[3]; - } - if (!id) return; - var embedUrl = 'https://player.vimeo.com/video/' + id; - if (args.options.videoDetails) { - return new Promise(function (resolve) { - data$1(id).then(function (data) { - return resolve(getDetailsTemplate(formatData$1(data, truncate), data, embedUrl, args.options)); - }); - }); - } else { - return new Promise(function (resolve) { - return resolve(template$1(embedUrl, args.options)); - }); - } -} - -var vimeo$1 = function (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - regex: regex.vimeo, - service: 'vimeo' - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$2).then(function (data) { - return resolve(data); - }); - }); -} - -function fetchData(args, url) { - var api = 'http://www.slideshare.net/api/oembed/2?url=' + url + '&format=jsonp&maxwidth=' + args.options.videoWidth + '&maxheight=' + args.options.videoHeight; - return new Promise(function (resolve) { - fetchJsonp$1(api, { credentials: 'include' }).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json.html); - }); - }); -} - -function urlToText$3(args, match, url) { - return new Promise(function (resolve) { - fetchData(args, url).then(function (html) { - return resolve(args.template(html)); - }); - }); -} - -var slideShare$1 = function (input, output, options, embeds) { - var args = { - input: input, output: output, options: options, embeds: embeds, - regex: regex.slideShare, - service: 'slideshare', - template: function template(html) { - return this.options.template.slideShare(html, this.options); - } - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$3).then(function (data) { - return resolve(data); - }); - }); -} - -function fetchData$1(url, _) { - url = encodeURIComponent(url); - var api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url); - return new Promise(function (resolve) { - fetch(api).then(function (res) { - return res.json(); - }).then(function (json) { - return resolve(_.options.onOpenGraphFetch(json) || json); - }); - }); -} - -function urlToText$4(_, match, url) { - if (url.match(_.excludeRegex)) return Promise.resolve(); - - return new Promise(function (resolve) { - fetchData$1(url, _).then(function (data) { - return resolve(data && data.success ? _.template(data) : ''); - }); - }); -} - -var openGraph$1 = function (input, output, options, embeds) { - var args = { - input: input, - output: output, - options: options, - embeds: embeds, - service: 'opengraph', - regex: urlRegex(), - excludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'), - template: function template(data) { - return this.options.template.openGraph(data, this.options); - } - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$4).then(function (data) { - return resolve(data); - }); - }); -} - -function template$3(data, options) { - return options.template.github(data, options); -} - -function fetchRepo(data) { - var api = 'https://api.github.com/repos/' + data.user + '/' + data.repo; - return new Promise(function (resolve) { - fetch(api).then(function (data) { - return data.json(); - }).then(function (json) { - return resolve(json); - }); - }); -} - -function urlToText$5(_this, match, url, normalEmbed) { - var data = !normalEmbed ? { - user: match[2], - repo: match[3] - } : { - user: match[1], - repo: match[2] - }; - - if (!data.repo) return; - return new Promise(function (resolve) { - fetchRepo(data).then(function (response) { - return resolve(template$3(response, _this.options)); - }); - }); -} - -var github$1 = function (input, output, options, embeds) { - var args = { - input: input, output: output, options: options, embeds: embeds, - service: 'github', - regex: regex.github - }; - - return new Promise(function (resolve) { - return asyncEmbed(args, urlToText$5).then(function (data) { - return resolve(data); - }); - }); -} - -var mentions = function (input, options) { - var mRegex = regex.mentions; - return input.replace(mRegex, function (match, $1, $2) { - var username = $2.split('@')[1]; - return $1 + options.mentionsUrl(username); - }); -} - -var hashtag = function (input, options) { - var hRegex = regex.hashtag; - return input.replace(hRegex, function (match, $1, $2) { - var username = $2.split('#')[1]; - return $1 + options.hashtagUrl(username); - }); -} - -var globalOptions = {}; - -var defaultOptions = { - marked: false, - markedOptions: {}, - link: true, - linkOptions: { - target: 'self', - exclude: ['pdf'], - rel: '' - }, - emoji: true, - customEmoji: [], - fontIcons: true, - customFontIcons: [], - highlightCode: false, - mentions: false, - hashtag: false, - videoJS: false, - videojsOptions: { - fluid: true, - preload: 'metadata' - }, - plyr: false, - plyrOptions: {}, - locationEmbed: true, - mapOptions: { - mode: 'place' - }, - tweetsEmbed: false, - tweetOptions: { - maxWidth: 550, - hideMedia: false, - hideThread: false, - align: 'none', - lang: 'en' - }, - singleEmbed: false, - openGraphEndpoint: null, - openGraphExclude: [], - videoEmbed: true, - videoHeight: null, - videoWidth: null, - videoDetails: true, - audioEmbed: true, - imageEmbed: true, - excludeEmbed: [], - inlineEmbed: [], - inlineText: true, - codeEmbedHeight: 500, - vineOptions: { - maxWidth: null, - type: 'postcard', //'postcard' or 'simple' embedding - responsive: true, - width: 350, - height: 460 - }, - plugins: { - marked: window.marked, - videojs: window.videojs, - plyr: window.plyr, - highlightjs: window.hljs, - prismjs: window.Prism, - twitter: window.twttr - }, - googleAuthKey: '', - soundCloudOptions: { - height: 160, - themeColor: 'f50000', //Hex Code of the player theme color - autoPlay: false, - hideRelated: false, - showComments: true, - showUser: true, - showReposts: false, - visual: false, //Show/hide the big preview image - download: false //Show/Hide download buttons - }, - videoClickClass: 'ejs-video-thumb', - customVideoClickHandler: false, - mentionsUrl: function mentionsUrl() {}, - hashtagUrl: function hashtagUrl() {}, - beforeEmbedJSApply: function beforeEmbedJSApply() {}, - afterEmbedJSApply: function afterEmbedJSApply() {}, - onVideoShow: function onVideoShow() {}, - onTweetsLoad: function onTweetsLoad() {}, - videojsCallback: function videojsCallback() {}, - onOpenGraphFetch: function onOpenGraphFetch() {}, - onOpenGraphFail: function onOpenGraphFail() {}, - videoClickHandler: function videoClickHandler() {}, - served: [] //Private variable used to store processed urls so that they are not processed multiple times. -}; - -var instances = []; -var allInstances = []; -var promises = []; - -var EmbedJS = function () { - /** - * The constructor takes two arguments. The first one is the options object and the second one is the - * optional string . If the user wants to provide a string directly instead of the element, he can do that. - * In case the user provides both the input element and the string, the input string will be taken from the element - * and the provided string won't be processed. - * - * @param {object} options The options object - * @param template - * @return {null} - */ - function EmbedJS(options, template$$1) { - babelHelpers.classCallCheck(this, EmbedJS); - - /** - * We have created a clone of the original options to make sure that the original object - * isn't altered. - */ - var defOpts = cloneObject(defaultOptions); - var globOpts = cloneObject(globalOptions); - - //merge global options with the default options - var globOptions = deepExtend(defOpts, globOpts); - - //deepExtend global options with the overriding options provided by the user as an options - //object while creating a new instance of embed.js - this.options = deepExtend(globOptions, options); - - this.options.template = template$$1 || renderer; - - if (!(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); - - this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; - } - - /** - * Processes the string and performs all the insertions and manipulations based on - * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready - * @return {Promise} The processes resulting string - */ - - - babelHelpers.createClass(EmbedJS, [{ - key: 'process', - value: function process() { - var _this = this; - - var input = this.input; - - if (input === '') return Promise.resolve(''); - - var options = processOptions(this.options); - var embeds = []; - var output = input; - - this.options.beforeEmbedJSApply(); - - return new Promise(function (resolve) { - if (options.link) output = url$1(input, options); - - var openGraphPromise = options.openGraphEndpoint ? openGraph$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - - openGraphPromise.then(function (_ref) { - var _ref2 = babelHelpers.slicedToArray(_ref, 2); - - var output = _ref2[0]; - var embeds = _ref2[1]; - - if (options.highlightCode) { - output = highlight(output, options); - } - if (options.marked) { - output = markdown(output, options); - } - if (options.emoji) { - output = emoji$1(output, options); - } - if (options.fontIcons) { - output = smiley$1(output, options); - } - if (options.mentions) { - output = mentions(output, options); - } - if (options.hashtag) { - output = hashtag(output, options); - } - - var _baseEmbed = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone'); - - var _baseEmbed2 = babelHelpers.slicedToArray(_baseEmbed, 2); - - output = _baseEmbed2[0]; - embeds = _baseEmbed2[1]; - - var _baseEmbed3 = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker'); - - var _baseEmbed4 = babelHelpers.slicedToArray(_baseEmbed3, 2); - - output = _baseEmbed4[0]; - embeds = _baseEmbed4[1]; - - var _baseEmbed5 = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin'); - - var _baseEmbed6 = babelHelpers.slicedToArray(_baseEmbed5, 2); - - output = _baseEmbed6[0]; - embeds = _baseEmbed6[1]; - - var _baseEmbed7 = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen'); - - var _baseEmbed8 = babelHelpers.slicedToArray(_baseEmbed7, 2); - - output = _baseEmbed8[0]; - embeds = _baseEmbed8[1]; - - var _baseEmbed9 = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle'); - - var _baseEmbed10 = babelHelpers.slicedToArray(_baseEmbed9, 2); - - output = _baseEmbed10[0]; - embeds = _baseEmbed10[1]; - - var _baseEmbed11 = baseEmbed(input, output, embeds, options, regex.ted, 'ted'); - - var _baseEmbed12 = babelHelpers.slicedToArray(_baseEmbed11, 2); - - output = _baseEmbed12[0]; - embeds = _baseEmbed12[1]; - - var _baseEmbed13 = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion'); - - var _baseEmbed14 = babelHelpers.slicedToArray(_baseEmbed13, 2); - - output = _baseEmbed14[0]; - embeds = _baseEmbed14[1]; - - var _baseEmbed15 = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream'); - - var _baseEmbed16 = babelHelpers.slicedToArray(_baseEmbed15, 2); - - output = _baseEmbed16[0]; - embeds = _baseEmbed16[1]; - - var _baseEmbed17 = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak'); - - var _baseEmbed18 = babelHelpers.slicedToArray(_baseEmbed17, 2); - - output = _baseEmbed18[0]; - embeds = _baseEmbed18[1]; - - var _baseEmbed19 = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed); - - var _baseEmbed20 = babelHelpers.slicedToArray(_baseEmbed19, 2); - - output = _baseEmbed20[0]; - embeds = _baseEmbed20[1]; - - var _baseEmbed21 = baseEmbed(input, output, embeds, options, regex.vine, 'vine'); - - var _baseEmbed22 = babelHelpers.slicedToArray(_baseEmbed21, 2); - - output = _baseEmbed22[0]; - embeds = _baseEmbed22[1]; - - var _baseEmbed23 = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud'); - - var _baseEmbed24 = babelHelpers.slicedToArray(_baseEmbed23, 2); - - output = _baseEmbed24[0]; - embeds = _baseEmbed24[1]; - - var _baseEmbed25 = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify'); - - var _baseEmbed26 = babelHelpers.slicedToArray(_baseEmbed25, 2); - - output = _baseEmbed26[0]; - embeds = _baseEmbed26[1]; - - var _baseEmbed27 = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed); - - var _baseEmbed28 = babelHelpers.slicedToArray(_baseEmbed27, 2); - - output = _baseEmbed28[0]; - embeds = _baseEmbed28[1]; - - var _baseEmbed29 = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr'); - - var _baseEmbed30 = babelHelpers.slicedToArray(_baseEmbed29, 2); - - output = _baseEmbed30[0]; - embeds = _baseEmbed30[1]; - - var _baseEmbed31 = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram'); - - var _baseEmbed32 = babelHelpers.slicedToArray(_baseEmbed31, 2); - - output = _baseEmbed32[0]; - embeds = _baseEmbed32[1]; - - var _baseEmbed33 = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed); - - var _baseEmbed34 = babelHelpers.slicedToArray(_baseEmbed33, 2); - - output = _baseEmbed34[0]; - embeds = _baseEmbed34[1]; - - - if (ifEmbed(options, 'gist')) { - var _process = new Gist(input, output, options, embeds).process(); - - var _process2 = babelHelpers.slicedToArray(_process, 2); - - output = _process2[0]; - embeds = _process2[1]; - } - - return ifEmbed(options, 'youtube') ? youtube$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref3) { - var _ref4 = babelHelpers.slicedToArray(_ref3, 2); - - var output = _ref4[0]; - var embeds = _ref4[1]; - - return ifEmbed(options, 'vimeo') ? vimeo$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref5) { - var _ref6 = babelHelpers.slicedToArray(_ref5, 2); - - var output = _ref6[0]; - var embeds = _ref6[1]; - - return ifEmbed(options, 'github') ? github$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref7) { - var _ref8 = babelHelpers.slicedToArray(_ref7, 2); - - var output = _ref8[0]; - var embeds = _ref8[1]; - - return options.locationEmbed && ifEmbed(options, 'gmap') ? gmap$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref9) { - var _ref10 = babelHelpers.slicedToArray(_ref9, 2); - - var output = _ref10[0]; - var embeds = _ref10[1]; - - return ifEmbed(options, 'slideshare') ? slideShare$1(input, output, options, embeds) : Promise.resolve([output, embeds]); - }).then(function (_ref11) { - var _ref12 = babelHelpers.slicedToArray(_ref11, 2); - - var output = _ref12[0]; - var embeds = _ref12[1]; - - if (options.tweetsEmbed && ifEmbed(options, 'twitter')) { - _this.twitter = new Twitter(input, output, options, embeds); - return _this.twitter.process(); - } else { - return Promise.resolve([output, embeds]); - } - }).then(function (_ref13) { - var _ref14 = babelHelpers.slicedToArray(_ref13, 2); - - var output = _ref14[0]; - var embeds = _ref14[1]; - - _this.data = { - input: options.input, - output: output, - options: options, - inputString: _this.input, - services: options.served, - template: options.template - }; - - resolve(createText(output, embeds)); - }); - }); - } - - /** - * First processes the data by calling the .process() and then renders the data in the div - * => Loads the twitter widgets - * => Executes the onTweetsLoad() once all the tweets have been rendered - * => Applies video.js on the media (both audio and video) - * => Triggers video loading on click of the video preview - * => Executes afterEmbedJSApply() once everything is done. - * - * @return Promise - */ - - }, { - key: 'render', - value: function render() { - var _this2 = this; - - if (typeof this.options.input === 'string') throw new Error('You cannot call render method for a string'); - if (!this.options.input) throw new Error('You didn\'t pass an element while creating this instance. render() method can\'t work without an input element'); - - return new Promise(function (resolve) { - _this2.process().then(function (data) { - _this2.options.input.innerHTML = data; - _this2.applyListeners(); - resolve(_this2.data); - }); - }); - } - - /** - * This method listens to all the events like click, handle - * events to be done after an element has been rendered. These - * include twitter widget rendering, gist embedding, click event listeners . - */ - - }, { - key: 'applyListeners', - value: function applyListeners() { - applyVideoJS(this.options); - applyPlyr(this.options); - - playVideo(this.options); - - var event = new Event('rendered'); - this.options.input.dispatchEvent(event); - - this.options.afterEmbedJSApply(); - } - - /** - * This function updates the parametrs of the current instance - * @param options New updated options object. will be extended with the older options - * @param template [optional] the new template instance - */ - - }, { - key: 'update', - value: function update(options, template$$1) { - - if (options) this.options = deepExtend(this.options, options); - - if (template$$1) this.options.template = template$$1; - - if (!this.options.input || !(typeof this.options.input === 'string' || babelHelpers.typeof(this.options.input) === 'object')) throw ReferenceError("You need to pass an element or the string that needs to be processed"); - - this.input = babelHelpers.typeof(this.options.input) === 'object' ? this.options.input.innerHTML : this.options.input; - } - - /** - * returns the resulting string based on the input and the options passed by the user. - * @return Promise - */ - - }, { - key: 'text', - value: function text(callback) { - var _this3 = this; - - this.process().then(function (data) { - return callback(data, _this3.input); - }); - } - - /** - * The destroy method destroys all the listeners and replaces the rih text with the original text in the - * element. - * @return {null} - */ - - }, { - key: 'destroy', - value: function destroy() { - if (babelHelpers.typeof(this.options.input) !== 'object') throw new Error('destroy() method only works if an element had been passed in the options object'); - destroyVideos('ejs-video-thumb'); - if (this.options.tweetsEmbed) this.options.input.removeEventListener('rendered', this.twitter.load(), false); - this.options.input.innerHTML = this.input; - } - - /** - * Sets options globally - * @param {object} options - */ - - }], [{ - key: 'setOptions', - value: function setOptions(options) { - globalOptions = deepExtend(defaultOptions, options); - } - - /** - * Applies embed.js to all the elements with the class name provided as option - * @return {Promise} - * @param selectorName - * @param options - * @param template - */ - - }, { - key: 'applyEmbedJS', - value: function applyEmbedJS(selectorName) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var template$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : renderer; - - var elements = document.querySelectorAll(selectorName); - for (var i = 0; i < elements.length; i++) { - options.input = elements[i]; - instances[i] = new EmbedJS(options, template$$1); - promises[i] = instances[i].render(); - } - return new Promise(function (resolve) { - Promise.all(promises).then(function (val) { - resolve(val); - }); - }); - } - - /** - * Destroys all the instances of EmbedJS created by using applyEmbedJS() method. - * @return {null} - */ - - }, { - key: 'destroyEmbedJS', - value: function destroyEmbedJS() { - for (var i = 0; i < instances.length; i++) { - instances[i].destroy(); - } - } - - /** - * Destroys all instances of EmbedJS on the page - * @return {null} - */ - - }, { - key: 'destroyAll', - value: function destroyAll() { - for (var i = 0; i < allInstances.length; i++) { - allInstances[i].destroy(); - } - } - - /** - * Creates a new instance of the Template constructor. This has been done so that multiple - * templates of a single service can be used by creating different instances of the Template. - * - * The usage of the plugin is described below. - * - * => Create a new Instance of the template by using .Template() method of EmbedJS. - * - * var template = EmbedJS.Template() - * - * => Now create different templates for different service names. - * - * template.url = function(match, options){ - * return ' + match + ' - * } - * - * template.instagram = function(match, dimensions, options){ - * var config = options.soundCloudOptions; - * return `
`; - * } - * - */ - - }, { - key: 'Template', - value: function Template() { - return renderer; - } - }]); - return EmbedJS; -}(); - -return EmbedJS; - -}))); -//# sourceMappingURL=embed.js.map diff --git a/src/embed.js.map b/src/embed.js.map deleted file mode 100644 index b238174..0000000 --- a/src/embed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":null,"sources":["js/modules/utils.js","js/modules/template.js","js/modules/regex.js","js/modules/emoticons/emoji.js","js/modules/emoticons/smiley.js","js/modules/url.js","../node_modules/fetch-jsonp/build/fetch-jsonp.js","js/helpers/template.js","js/helpers/playVideo.js","js/helpers/getDetailsTemplate.js","js/helpers/applyPlyr.js","js/helpers/applyVideoJS.js","js/helpers/destroyVideos.js","js/helpers/embed.js","js/modules/base.js","js/helpers/baseEmbed.js","js/helpers/asyncEmbed.js","js/modules/twitter/twitter.js","../node_modules/whatwg-fetch/fetch.js","js/modules/map/map.js","js/modules/markdown.js","js/modules/code/highlight.js","js/modules/code/gist.js","js/modules/video/youtube.js","js/modules/video/vimeo.js","js/modules/image/slideshare.js","js/modules/openGraph.js","js/modules/github.js","js/modules/mentions.js","js/modules/hashtag.js","js/main.js"],"sourcesContent":["/**\n * Trucates the string and adds ellipsis at the end.\n * @param string The string to be truncated\n * @param n Length to which it should be truncated\n * @returns {string} The truncated string\n */\nexport function truncate(string, n) {\n return string.substr(0, n - 1) + (string.length > n ? '...' : '');\n}\n\n/**\n * Returns an array after removing the duplicates.\n * @param array The array containing the duplicates\n * @returns {Array} Array with unique values.\n */\nexport function getUnique(array) {\n var u = {},\n a = [];\n\n array.forEach((value) => {\n if (!u.hasOwnProperty(value)) {\n a.push(value);\n u[value] = 1;\n }\n });\n return a;\n}\n\n/**\n * Converts a string into legitimate url.\n * @param string\n */\nexport function toUrl(string) {\n return (string.indexOf('//') === -1) ? ('//' + string) : string\n}\n\n/**\n * Extends an Object\n * @param destination\n * @param source\n * @returns {*}\n */\nexport function deepExtend(destination, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property) && source[property] && source[property].constructor === Object) {\n destination[property] = destination[property] || {};\n deepExtend(destination[property], source[property]);\n } else {\n destination[property] = source[property];\n }\n }\n return destination;\n}\n\nexport function escapeRegExp(str) {\n return str.replace(/[\\-\\[\\]\\/\\{}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n\n/**\n * Sort an array of objects based on the index value\n * @param {Array} arr Array to be sorted\n * @return {Array} Sorted array\n */\nfunction sortObject(arr) {\n return arr.sort((a, b) => (a.index - b.index));\n}\n\n/**\n * Creates the string of the iframes after sorting them and finally returning a string\n * @param {string} str String to which the created text has to be added\n * @param {object} embeds Sorted array of iframe html\n * @return {string} String to be rendered\n */\nexport function createText(str, embeds) {\n let sortedEmbeds = sortObject(embeds);\n for (let i = 0; i < sortedEmbeds.length; i++) {\n str += ` ${sortedEmbeds[i].text}`;\n }\n return str;\n}\n\n/**\n * Matches the string and finds the substrings matching to the provided regex pattern\n * @param {object} regex Regex pattern\n * @param {string} input The string to be analyzed\n * @return {object} Returns the matched substring with their corresponding positions\n */\nexport function matches(regex, input) {\n return regex.exec(input);\n}\n\n/**\n * Checks whether a particular service should be embedded or not based on\n * the setting provided by the user\n * @param {object} options The options provided by the user\n * @param {string} service Name of the service for which the condition is to be analyzed\n * @return {boolean} True if it should be embedded\n */\nexport function ifEmbed(options, service) {\n if (options.singleEmbed && options.served.length) return;\n return ((options.excludeEmbed.indexOf(service) == -1) && !(options.excludeEmbed === 'all'));\n}\n\nexport function ifInline(options, service) {\n return ((options.inlineEmbed.indexOf(service) >= 0) || (options.inlineEmbed === 'all'));\n}\n\n/**\n * Calculates the dimensions for the elements based on a aspect ratio\n * @param {object} options Plugin options\n * @return {object} The width and height of the elements\n */\nfunction setDimensions(options) {\n\toptions.videoWidth = options.videoWidth || ((options.videoHeight) / 3) * 4 || 800;\n\toptions.videoHeight = options.videoHeight || ((options.videoWidth) / 4) * 3 || 600;\n\treturn options;\n}\n\n/**\n * Returns a cloned object\n * @param {object} obj\n * @return {object} cloned object\n */\nexport function cloneObject(obj) {\n if (obj === null || typeof obj !== 'object') return obj;\n var temp = obj.constructor(); // give temp the original obj's constructor\n for (var key in obj) {\n temp[key] = cloneObject(obj[key])\n }\n return temp\n}\n\nexport function urlRegex() {\n return /((href|src)=[\"']|)(\\b(https?|ftp|file):\\/\\/[^,.\\s]+[^\\s]*[^,.\\s]+)|(?:https?:\\/\\/)?(?:(?:0rz\\.tw)|(?:1link\\.in)|(?:1url\\.com)|(?:2\\.gp)|(?:2big\\.at)|(?:2tu\\.us)|(?:3\\.ly)|(?:307\\.to)|(?:4ms\\.me)|(?:4sq\\.com)|(?:4url\\.cc)|(?:6url\\.com)|(?:7\\.ly)|(?:a\\.gg)|(?:a\\.nf)|(?:aa\\.cx)|(?:abcurl\\.net)|(?:ad\\.vu)|(?:adf\\.ly)|(?:adjix\\.com)|(?:afx\\.cc)|(?:all\\.fuseurl.com)|(?:alturl\\.com)|(?:amzn\\.to)|(?:ar\\.gy)|(?:arst\\.ch)|(?:atu\\.ca)|(?:azc\\.cc)|(?:b23\\.ru)|(?:b2l\\.me)|(?:bacn\\.me)|(?:bcool\\.bz)|(?:binged\\.it)|(?:bit\\.ly)|(?:buff\\.ly)|(?:bizj\\.us)|(?:bloat\\.me)|(?:bravo\\.ly)|(?:bsa\\.ly)|(?:budurl\\.com)|(?:canurl\\.com)|(?:chilp\\.it)|(?:chzb\\.gr)|(?:cl\\.lk)|(?:cl\\.ly)|(?:clck\\.ru)|(?:cli\\.gs)|(?:cliccami\\.info)|(?:clickthru\\.ca)|(?:clop\\.in)|(?:conta\\.cc)|(?:cort\\.as)|(?:cot\\.ag)|(?:crks\\.me)|(?:ctvr\\.us)|(?:cutt\\.us)|(?:dai\\.ly)|(?:decenturl\\.com)|(?:dfl8\\.me)|(?:digbig\\.com)|(?:digg\\.com)|(?:disq\\.us)|(?:dld\\.bz)|(?:dlvr\\.it)|(?:do\\.my)|(?:doiop\\.com)|(?:dopen\\.us)|(?:easyuri\\.com)|(?:easyurl\\.net)|(?:eepurl\\.com)|(?:eweri\\.com)|(?:fa\\.by)|(?:fav\\.me)|(?:fb\\.me)|(?:fbshare\\.me)|(?:ff\\.im)|(?:fff\\.to)|(?:fire\\.to)|(?:firsturl\\.de)|(?:firsturl\\.net)|(?:flic\\.kr)|(?:flq\\.us)|(?:fly2\\.ws)|(?:fon\\.gs)|(?:freak\\.to)|(?:fuseurl\\.com)|(?:fuzzy\\.to)|(?:fwd4\\.me)|(?:fwib\\.net)|(?:g\\.ro.lt)|(?:gizmo\\.do)|(?:gl\\.am)|(?:go\\.9nl.com)|(?:go\\.ign.com)|(?:go\\.usa.gov)|(?:goo\\.gl)|(?:goshrink\\.com)|(?:gurl\\.es)|(?:hex\\.io)|(?:hiderefer\\.com)|(?:hmm\\.ph)|(?:href\\.in)|(?:hsblinks\\.com)|(?:htxt\\.it)|(?:huff\\.to)|(?:hulu\\.com)|(?:hurl\\.me)|(?:hurl\\.ws)|(?:icanhaz\\.com)|(?:idek\\.net)|(?:ilix\\.in)|(?:is\\.gd)|(?:its\\.my)|(?:ix\\.lt)|(?:j\\.mp)|(?:jijr\\.com)|(?:kl\\.am)|(?:klck\\.me)|(?:korta\\.nu)|(?:krunchd\\.com)|(?:l9k\\.net)|(?:lat\\.ms)|(?:liip\\.to)|(?:liltext\\.com)|(?:linkbee\\.com)|(?:linkbun\\.ch)|(?:liurl\\.cn)|(?:ln-s\\.net)|(?:ln-s\\.ru)|(?:lnk\\.gd)|(?:lnk\\.ms)|(?:lnkd\\.in)|(?:lnkurl\\.com)|(?:lru\\.jp)|(?:lt\\.tl)|(?:lurl\\.no)|(?:macte\\.ch)|(?:mash\\.to)|(?:merky\\.de)|(?:migre\\.me)|(?:miniurl\\.com)|(?:minurl\\.fr)|(?:mke\\.me)|(?:moby\\.to)|(?:moourl\\.com)|(?:mrte\\.ch)|(?:myloc\\.me)|(?:myurl\\.in)|(?:n\\.pr)|(?:nbc\\.co)|(?:nblo\\.gs)|(?:nn\\.nf)|(?:not\\.my)|(?:notlong\\.com)|(?:nsfw\\.in)|(?:nutshellurl\\.com)|(?:nxy\\.in)|(?:nyti\\.ms)|(?:o-x\\.fr)|(?:oc1\\.us)|(?:om\\.ly)|(?:omf\\.gd)|(?:omoikane\\.net)|(?:on\\.cnn.com)|(?:on\\.mktw.net)|(?:onforb\\.es)|(?:orz\\.se)|(?:ow\\.ly)|(?:ping\\.fm)|(?:pli\\.gs)|(?:pnt\\.me)|(?:politi\\.co)|(?:post\\.ly)|(?:pp\\.gg)|(?:profile\\.to)|(?:ptiturl\\.com)|(?:pub\\.vitrue.com)|(?:qlnk\\.net)|(?:qte\\.me)|(?:qu\\.tc)|(?:qy\\.fi)|(?:r\\.im)|(?:rb6\\.me)|(?:read\\.bi)|(?:readthis\\.ca)|(?:reallytinyurl\\.com)|(?:redir\\.ec)|(?:redirects\\.ca)|(?:redirx\\.com)|(?:retwt\\.me)|(?:ri\\.ms)|(?:rickroll\\.it)|(?:riz\\.gd)|(?:rt\\.nu)|(?:ru\\.ly)|(?:rubyurl\\.com)|(?:rurl\\.org)|(?:rww\\.tw)|(?:s4c\\.in)|(?:s7y\\.us)|(?:safe\\.mn)|(?:sameurl\\.com)|(?:sdut\\.us)|(?:shar\\.es)|(?:shink\\.de)|(?:shorl\\.com)|(?:short\\.ie)|(?:short\\.to)|(?:shortlinks\\.co.uk)|(?:shorturl\\.com)|(?:shout\\.to)|(?:show\\.my)|(?:shrinkify\\.com)|(?:shrinkr\\.com)|(?:shrt\\.fr)|(?:shrt\\.st)|(?:shrten\\.com)|(?:shrunkin\\.com)|(?:simurl\\.com)|(?:slate\\.me)|(?:smallr\\.com)|(?:smsh\\.me)|(?:smurl\\.name)|(?:sn\\.im)|(?:snipr\\.com)|(?:snipurl\\.com)|(?:snurl\\.com)|(?:sp2\\.ro)|(?:spedr\\.com)|(?:srnk\\.net)|(?:srs\\.li)|(?:starturl\\.com)|(?:su\\.pr)|(?:surl\\.co.uk)|(?:surl\\.hu)|(?:t\\.cn)|(?:t\\.co)|(?:t\\.lh.com)|(?:ta\\.gd)|(?:tbd\\.ly)|(?:tcrn\\.ch)|(?:tgr\\.me)|(?:tgr\\.ph)|(?:tighturl\\.com)|(?:tiniuri\\.com)|(?:tiny\\.cc)|(?:tiny\\.ly)|(?:tiny\\.pl)|(?:tinylink\\.in)|(?:tinyuri\\.ca)|(?:tinyurl\\.com)|(?:tl\\.gd)|(?:tmi\\.me)|(?:tnij\\.org)|(?:tnw\\.to)|(?:tny\\.com)|(?:to\\.ly)|(?:togoto\\.us)|(?:totc\\.us)|(?:toysr\\.us)|(?:tpm\\.ly)|(?:tr\\.im)|(?:tra\\.kz)|(?:trunc\\.it)|(?:twhub\\.com)|(?:twirl\\.at)|(?:twitclicks\\.com)|(?:twitterurl\\.net)|(?:twitterurl\\.org)|(?:twiturl\\.de)|(?:twurl\\.cc)|(?:twurl\\.nl)|(?:u\\.mavrev.com)|(?:u\\.nu)|(?:u76\\.org)|(?:ub0\\.cc)|(?:ulu\\.lu)|(?:updating\\.me)|(?:ur1\\.ca)|(?:url\\.az)|(?:url\\.co.uk)|(?:url\\.ie)|(?:url360\\.me)|(?:url4\\.eu)|(?:urlborg\\.com)|(?:urlbrief\\.com)|(?:urlcover\\.com)|(?:urlcut\\.com)|(?:urlenco\\.de)|(?:urli\\.nl)|(?:urls\\.im)|(?:urlshorteningservicefortwitter\\.com)|(?:urlx\\.ie)|(?:urlzen\\.com)|(?:usat\\.ly)|(?:use\\.my)|(?:vb\\.ly)|(?:vgn\\.am)|(?:vl\\.am)|(?:vm\\.lc)|(?:w55\\.de)|(?:wapo\\.st)|(?:wapurl\\.co.uk)|(?:wipi\\.es)|(?:wp\\.me)|(?:x\\.vu)|(?:xr\\.com)|(?:xrl\\.in)|(?:xrl\\.us)|(?:xurl\\.es)|(?:xurl\\.jp)|(?:y\\.ahoo.it)|(?:yatuc\\.com)|(?:ye\\.pe)|(?:yep\\.it)|(?:yfrog\\.com)|(?:yhoo\\.it)|(?:yiyd\\.com)|(?:youtu\\.be)|(?:yuarel\\.com)|(?:z0p\\.de)|(?:zi\\.ma)|(?:zi\\.mu)|(?:zipmyurl\\.com)|(?:zud\\.me)|(?:zurl\\.ws)|(?:zz\\.gd)|(?:zzang\\.kr)|(?:›\\.ws)|(?:✩\\.ws)|(?:✿\\.ws)|(?:❥\\.ws)|(?:➔\\.ws)|(?:➞\\.ws)|(?:➡\\.ws)|(?:➨\\.ws)|(?:➯\\.ws)|(?:➹\\.ws)|(?:➽\\.ws))\\/[a-z0-9]*/gi;\n}\n\nfunction arrayLowercase(options, property){\n\tif(typeof options[property] !== 'string'){\n\t\toptions[property] = options[property].map(function(elem){\n\t\t\treturn elem.toLowerCase();\n\t\t})\n\t}\n\treturn options;\n}\n\n/**\n * Sets the dimensions and converts options values' Array into lowercase.\n * @param options\n * @returns {Object|*}\n */\nexport function processOptions(options){\n\toptions = setDimensions(options);\n\toptions = arrayLowercase(options, 'excludeEmbed');\n\toptions = arrayLowercase(options, 'inlineEmbed');\n\treturn arrayLowercase(options, 'openGraphExclude');\n}\n\n/**\n * Get the last element of an array or string\n * @param elem [String|Array]\n * @returns last element of the Array or String\n */\nexport function lastElement(elem){\n\treturn elem[elem.length - 1];\n}\n","import { toUrl, lastElement } from './utils'\n\nexport default {\n\turl(match, options){\n\t\tlet config = options.linkOptions;\n\t\treturn `${match}`;\n\t},\n\n\tsmiley(text, pre, code) {\n\t\treturn `${pre}${code}`;\n\t},\n\n\temoji(text){\n\t\treturn ``;\n\t},\n\n\taudio(match){\n\t\treturn `
`\n\t},\n\n\tsoundcloud(match, options){\n\t\tlet config = options.soundCloudOptions;\n\t\treturn `
\n\t\t\n\t\t
`\n\t},\n\n\tspotify(match){\n\t\tlet id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tcodepen(id, options){\n\t\treturn `
`\n\t},\n\n\tideone(match, options){\n\t\treturn `
`\n\t},\n\n\tjsbin(id, options){\n\t\treturn `
`\n\t},\n\n\tjsfiddle(id, options){\n\t\tid = lastElement(id) == '/' ? id.slice(0, - 1) : id;\n\t\tid = (id.indexOf('//') !== -1) ? id : `//${id}`;\n\t\treturn `
`\n\t},\n\n\tplunker(id, options){\n\t\treturn `
`\n\t},\n\n\timage(match){\n\t\treturn `
`\n\t},\n\n\tflickr(match, options){\n\t\treturn `
`\n\t},\n\n\tinstagram(match, options){\n\t\treturn `
`;\n\t},\n\n\tslideShare(html){\n\t\treturn `
${html}
`;\n\t},\n\n\tvideo(match){\n\t\treturn `
`\n\t},\n\n\tdailymotion(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\treturn `
`\n\t},\n\n\tliveleak(match, options){\n\t\treturn `
`\n\t},\n\n\tted(match, options){\n\t\tlet a = match.split('/');\n\t\tconst id = a[a.length - 1];\n\t\treturn `
`\n\t},\n\n\tustream(match, options){\n\t\tlet id = match.split('/');\n\t\tid.splice(1, 0, 'embed');\n\t\treturn `
`\n\t},\n\n\tdetailsVimeo(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tdetailsYoutube(data, fullData, embedUrl){\n\t\treturn `
${data.description}
${data.views}${data.likes}
`\n\t},\n\n\tvine(match, options){\n\t\tconst id = lastElement(match.split('/'));\n\t\tconst config = options.vineOptions;\n\t\treturn `
`\n\t},\n\n\tvimeo(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\tyoutube(url, options){\n\t\treturn options.plyr ?\n\t\t\t`
` :\n\t\t\t`
`\n\t},\n\n\topenGraph(data, options){\n\t\treturn `
${data.description}
`\n\t},\n\n\tgithub(data, options){\n\t\treturn `
${data.description}
${data.stargazers_count}${data.network_count}
`\n\t},\n\n\tgmap(latitude, longitude, location, options){\n\t\tconst config = options.mapOptions;\n\t\tif (config.mode === 'place') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'streetview') {\n\t\t\treturn `
`;\n\t\t} else if (config.mode === 'view') {\n\t\t\treturn `
`\n\t\t}\n\t}\n}\n","const regex = {\n\tmentions : /(^|\\s)(@[a-z0-9_-]+)/gi,\n\thashtag : /(^|\\s)(#[a-z\\d-]+)/gi,\n\tbasicAudio : /((?:https?):\\/\\/\\S*\\.(?:wav|mp3|ogg))/gi,\n\tsoundCloud : /(soundcloud.com)\\/[a-zA-Z0-9-_]+\\/[a-zA-Z0-9-_]+/gi,\n\tspotify : /spotify.com\\/track\\/[a-zA-Z0-9_]+/gi,\n\tcodepen : /http:\\/\\/codepen.io\\/([A-Za-z0-9_]+)\\/pen\\/([A-Za-z0-9_]+)/gi,\n\tgist : /gist.github.com\\/[a-zA-Z0-9_-]+\\/([a-zA-Z0-9]+)/gi,\n\thighlightCode: /(`{3})(\\s|[a-z]+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tinlineCode : /(`)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/gm,\n\tideone : /ideone.com\\/[a-zA-Z0-9]{6}/gi,\n\tjsbin : /jsbin.com\\/[a-zA-Z0-9_]+\\/[0-9_]+/gi,\n\tjsfiddle : /jsfiddle.net\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9_\\/]+/gi,\n\tplunker : /plnkr.co\\/edit\\/[a-zA-Z0-9\\?=]+/gi,\n\tbasicImage : /((?:https?):\\/\\/\\S*\\.(?:gif|jpg|jpeg|tiff|png|svg|webp))/gi,\n\tflickr : /flickr.com\\/[a-z]+\\/[a-zA-Z@_$!\\d\\-\\]+\\/[\\d]+/gi,\n\tinstagram : /instagram.com\\/p\\/[a-zA-Z0-9_\\/\\?\\-\\=]+/gi,\n\tslideShare : /slideshare.net\\/[a-zA-Z0-9_-]*\\/[a-zA-Z0-9_-]*/gi,\n\tgithub : /[^\\.]github.com\\/([\\w\\.\\-]+)\\/([\\w\\.\\-]+)/gi,\n\tbasicVideo : /(?:https?):\\/\\/\\S*\\.(?:ogv|webm|mp4)/gi,\n\tdailymotion : /dailymotion.com\\/video\\/[a-zA-Z0-9-_]+/gi,\n\tliveleak : /liveleak.com\\/view\\?i=[a-zA-Z0-9_]+/gi,\n\tted : /ted.com\\/talks\\/[a-zA-Z0-9_]+/gi,\n\tustream : /ustream.tv\\/[a-z\\/0-9]*/gi,\n\tvimeo : /https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)*/gi,\n\tvine : /vine.co\\/v\\/[a-zA-Z0-9]+/gi,\n\tyoutube : /https?:\\/\\/(?:[0-9A-Z-]+\\.)?(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/ytscreeningroom\\?v=|\\/feeds\\/api\\/videos\\/|\\/user\\S*[^\\w\\-\\s]|\\S*[^\\w\\-\\s]))([\\w\\-]{11})[?=&+%\\w-]*/gi,\n\tgmap : /@\\((.+)\\)/gi,\n\ttwitter : /https:\\/\\/twitter\\.com\\/\\w+\\/\\w+\\/\\d+/gi,\n\tsmileys : /(\\:[\\+\\-\\w]+\\:|\\<[\\/\\\\]?3|[\\(\\)\\\\\\D|\\*\\$][\\-\\^]?[\\:\\;\\=]|[\\:\\;\\=B8][\\-\\^]?[3DOPp\\@\\$\\*\\\\\\)\\(\\/\\|])(?=\\s|[\\!\\.\\?]|$)/gi\n};\n\nexport default regex;\n","import regex from '../regex';\nimport {lastElement} from '../utils';\n\nfunction getEmoji(match) {\n\treturn match[0] === ':' && (lastElement(match) === ':') && match.substring(1, match.length - 1)\n}\n\nexport default function (output, options) {\n\treturn output.replace(regex.smileys, function (match) {\n\t\tconst emoji = getEmoji(match);\n\t\tif (emoji) {\n\t\t\treturn options.template.emoji(emoji, options)\n\t\t}\n\t\treturn match;\n\t});\n}\n","import {escapeRegExp} from '../utils'\n\nconst defaultIcons = [{\n\t'text': ':)',\n\t'code': ''\n}, {\n\t'text': ':D',\n\t'code': ''\n}, {\n\t'text': ':d',\n\t'code': ''\n}, {\n\t'text': ':(',\n\t'code': ''\n}, {\n\t'text': ':/',\n\t'code': ''\n\n}, {\n\t'text': ':P',\n\t'code': ''\n}, {\n\t'text': ':p',\n\t'code': ''\n}, {\n\t'text': '3:)',\n\t'code': ''\n}, {\n\t'text': '(^)',\n\t'code': ''\n}, {\n\t'text': ';)',\n\t'code': ''\n}, {\n\t'text': ':o',\n\t'code': ''\n}, {\n\t'text': ':O',\n\t'code': ''\n}, {\n\t'text': '-_-',\n\t'code': ''\n}, {\n\t'text': '(y)',\n\t'code': ''\n}, {\n\t'text': ':*',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '<3',\n\t'code': ''\n}, {\n\t'text': '</3',\n\t'code': ''\n}, {\n\t'text': ' escapeRegExp(val.text));\n\n\tconst smileyRegex = new RegExp(`(^|\\\\s)(${escapedSymbols.join('|')})(?=\\\\s|$)`, 'gi');\n\n\treturn input.replace(smileyRegex, (match, pre, text) => {\n\t\tlet index = escapedSymbols.indexOf(escapeRegExp(text));\n\t\tif (index === -1) return match;\n\t\tlet code = icons[index].code;\n\t\treturn options.template.smiley(text, pre, code, options);\n\t});\n}\n\n","import {urlRegex, lastElement} from './utils'\n\nexport default function (input, options) {\n\tconst config = options.linkOptions;\n\treturn input.replace(urlRegex(), function(match) {\n\t\tif(lastElement(match) === ')') return match; //hack for markdown image\n\t\tlet extension = lastElement(match.split('.'));\n\t\tif ((lastElement(match) === '/'))\n\t\t\tmatch = match.slice(0, -1);\n\t\tif (config.exclude.indexOf(extension) === -1)\n\t\t\treturn options.template.url(match, options);\n\t\treturn match;\n\t});\n}\n","(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['exports', 'module'], factory);\n } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {\n factory(exports, module);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports, mod);\n global.fetchJsonp = mod.exports;\n }\n})(this, function (exports, module) {\n 'use strict';\n\n var defaultOptions = {\n timeout: 5000,\n jsonpCallback: 'callback',\n jsonpCallbackFunction: null\n };\n\n function generateCallbackFunction() {\n return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);\n }\n\n // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined'\n // error if request timeout\n function clearFunction(functionName) {\n // IE8 throws an exception when you try to delete a property on window\n // http://stackoverflow.com/a/1824228/751089\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n }\n\n function removeScript(scriptId) {\n var script = document.getElementById(scriptId);\n document.getElementsByTagName('head')[0].removeChild(script);\n }\n\n function fetchJsonp(_url) {\n var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n // to avoid param reassign\n var url = _url;\n var timeout = options.timeout || defaultOptions.timeout;\n var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;\n\n var timeoutId = undefined;\n\n return new Promise(function (resolve, reject) {\n var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();\n var scriptId = jsonpCallback + '_' + callbackFunction;\n\n window[callbackFunction] = function (response) {\n resolve({\n ok: true,\n // keep consistent with fetch API\n json: function json() {\n return Promise.resolve(response);\n }\n });\n\n if (timeoutId) clearTimeout(timeoutId);\n\n removeScript(scriptId);\n\n clearFunction(callbackFunction);\n };\n\n // Check if the user set their own params, and if not add a ? to start a list of params\n url += url.indexOf('?') === -1 ? '?' : '&';\n\n var jsonpScript = document.createElement('script');\n jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);\n jsonpScript.id = scriptId;\n document.getElementsByTagName('head')[0].appendChild(jsonpScript);\n\n timeoutId = setTimeout(function () {\n reject(new Error('JSONP request to ' + url + ' timed out'));\n\n clearFunction(callbackFunction);\n removeScript(scriptId);\n }, timeout);\n });\n }\n\n // export as global function\n /*\n let local;\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n local.fetchJsonp = fetchJsonp;\n */\n\n module.exports = fetchJsonp;\n});","/**\n * Common template for vimeo and youtube iframes\n * @param {string} url URL of the embedding video\n * @param {object} options Options object\n * @return {string} compiled template with variables replaced\n */\nexport default function template(url, options) {\n\treturn options.template.vimeo(url, options) || options.template.youtube(url, options)\n}\n","import template from './template'\n\n/**\n * Plays the video after clicking on the thumbnail\n * @param {object} options Options object\n * @return {null}\n */\nexport default function playVideo(options) {\n\t/** Execute the customVideoClickHandler if the user wants to handle it on his own. */\n\tif (options.customVideoClickHandler) return options.videoClickHandler(options, template);\n\n\tlet classes = document.getElementsByClassName(options.videoClickClass);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = function () {\n\t\t\toptions.onVideoShow();\n\t\t\tlet url = this.getAttribute('data-ejs-url') + \"?autoplay=true\";\n\t\t\tthis.parentNode.parentNode.innerHTML = template(url, options);\n\t\t};\n\t}\n}\n","export default function (data, fullData, embedUrl, options) {\n\tif (data.host === 'vimeo') {\n\t\treturn options.template.detailsVimeo(data, fullData, embedUrl, options)\n\t} else if (data.host === 'youtube') {\n\t\treturn options.template.detailsYoutube(data, fullData, embedUrl, options)\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function (options) {\n\tif (options.plyr) {\n\t\tif (!options.plugins.plyr) throw new ReferenceError(\"You have enabled plyr but you haven't loaded the library.Find it at https://plyr.io/\");\n\t\tlet plyr = options.plugins.plyr;\n\t\tplyr.setup('.ejs-plyr', options.plyrOptions);\n\t}\n}\n","/**\n * Applies video.js to all audio and video dynamically\n * @param {object} options Options object\n * @return {null}\n */\nexport default function applyVideoJS(options) {\n\toptions.videojsOptions.width = options.videoWidth;\n\toptions.videojsOptions.height = options.videoHeight;\n\tif (options.videoJS) {\n\t\tif (!options.plugins.videojs) throw new ReferenceError(\"You have enabled videojs but you haven't loaded the library.Find it at http://videojs.com/\");\n\t\tlet VideoJS = options.plugins.videojs;\n\t\tlet elements = options.input.getElementsByClassName('ejs-video-js');\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tVideoJS(elements[i], options.videojsOptions, () => options.videojsCallback());\n\t\t}\n\t}\n}\n","/**\n * Destroys the onclick event for opening the video template from the details template\n * @param {className} className\n * @return {null}\n */\nexport default function (className) {\n\tconst classes = document.getElementsByClassName(className);\n\tfor (let i = 0; i < classes.length; i++) {\n\t\tclasses[i].onclick = null\n\t}\n}\n","import { ifInline, matches } from '../modules/utils'\n\nfunction inlineEmbed(_){\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gm') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gm');\n\t_.output = _.output.replace(regexInline, function(match) {\n\t\tlet url = _.options.link ? match.slice(0, -4) : match;\n\t\tif (_.options.served.indexOf(url) === -1) {\n\t\t\t_.options.served.push(url);\n\t\t\tif (_.options.link) {\n\t\t\t\treturn !_.options.inlineText ? _.template(match.slice(0, -4)) + '' : match + _.template(match.slice(0, -4))\n\t\t\t} else {\n\t\t\t\treturn !_.options.inlineText ? _.template(match) : match + _.template(match)\n\t\t\t}\n\t\t} else {\n\t\t\treturn match; //TODO : check whether this should be `match`\n\t\t}\n\t});\n\treturn [_.output, _.embeds];\n}\n\nfunction normalEmbed(_){\n\tlet match;\n\twhile ((match = matches(_.regex, _.input)) !== null) {\n\t\tlet url = match[0];\n\t\tif (!(_.options.served.indexOf(url) === -1) || (_.options.served.length && _.options.singleEmbed)) continue;\n\t\t_.options.served.push(url);\n\t\tlet text = _.template(url);\n\t\t_.embeds.push({\n\t\t\ttext : text,\n\t\t\tindex: match.index\n\t\t})\n\t}\n\treturn [_.output, _.embeds];\n}\n\nexport default function embed(_){\n\treturn (ifInline(_.options, _.service)) ? inlineEmbed(_) : normalEmbed(_)\n}\n","import { embed } from '../helpers'\n\nexport default function (input, output, embeds, options, regex, service) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex,\n\t\tservice,\n\t\ttemplate(match){\n\t\t\treturn this.options.template[this.service](match, this.options);\n\t\t}\n\t};\n\n\treturn embed(args);\n}\n","import { ifEmbed } from '../modules/utils'\nimport base from '../modules/base'\n\nexport default function baseEmbed(input, output, embeds, options, regex, service, flag){\n\treturn ifEmbed(options, service) || (ifEmbed(options, service) && flag) ? base(input, output, embeds, options, regex, service) : [output, embeds]\n}\n","import { matches, ifInline } from '../modules/utils'\n\n/**\n * This is a private function which is used to get the actual text to be replaced for\n * a particular url in inline embedding. This returns a promise\n * @param {object} _ reference to this\n * @param {function} urlToText The function that converts url to replaceable text\n * @param {object} match object containing info of matching string\n * @return {Promise} resolves to the text\n */\nfunction getInlineData(_, urlToText, match) {\n\tlet url = (_.options.link ? match[0].slice(0, -4) : match[0]) || match[1];\n\tif (_.options.served.indexOf(url) >= 0) return Promise.resolve(null);\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url).then((text) => {\n\t\t\tif (!text) return resolve();\n\t\t\t_.options.served.push(url);\n\t\t\tresolve(text);\n\t\t})\n\t})\n}\n\n/**\n * A helper function for inline embedding\n * @param _\n * @param urlToText\n * @returns Promise\n */\nfunction inlineAsyncEmbed(_, urlToText) {\n\tlet regexInline = _.options.link ? new RegExp(`([^>]*${_.regex.source})<\\/a>`, 'gi') : new RegExp(`([^\\\\s]*${_.regex.source})`, 'gi');\n\tlet match, promises = [];\n\n\twhile ((match = matches(regexInline, _.output)) !== null)\n\t\tpromises.push(getInlineData(_, urlToText, match));\n\n\treturn new Promise((resolve) => {\n\t\tif (matches.length)\n\t\t\tPromise.all(promises).then((data) => {\n\t\t\t\tlet i = 0;\n\t\t\t\t_.output = _.output.replace(regexInline, (match) => {\n\t\t\t\t\tif (_.options.link)\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] + '' : match + data[i++];\n\t\t\t\t\telse\n\t\t\t\t\t\treturn !_.options.inlineText ? data[i] : match + data[i++];\n\t\t\t\t});\n\t\t\t\tresolve(_.output)\n\t\t\t});\n\t\telse\n\t\t\tresolve(_.output)\n\t})\n}\n\n\nfunction getNormalData(_, urlToText, match) {\n\tlet url = match[0];\n\tif (_.options.served.indexOf(url) >= 0) return;\n\n\treturn new Promise((resolve) => {\n\t\turlToText(_, match, url, true).then(function (text) {\n\t\t\tif (!text) resolve();\n\t\t\t_.options.served.push(url);\n\t\t\t_.embeds.push({\n\t\t\t\ttext : text,\n\t\t\t\tindex: match.index\n\t\t\t});\n\t\t\tresolve()\n\t\t})\n\t})\n}\n\n/**\n * A helper function for normal embedding\n * @param {object} _\n * @param {function} urlToText\n * @return {Promise}\n */\nfunction normalAsyncEmbed(_, urlToText) {\n\tlet match, promises = [];\n\twhile ((match = matches(_.regex, _.input)) !== null)\n\t\tpromises.push(getNormalData(_, urlToText, match));\n\treturn new Promise(function (resolve) {\n\t\tPromise.all(promises).then(function () {\n\t\t\tresolve(_.embeds)\n\t\t});\n\t})\n}\n\nexport default function asyncEmbed(_, urlToText) {\n\treturn new Promise(function (resolve) {\n\t\tif (ifInline(_.options, _.service))\n\t\t\tinlineAsyncEmbed(_, urlToText).then((output) => resolve([output, _.embeds]));\n\t\telse\n\t\t\tnormalAsyncEmbed(_, urlToText).then((embeds) => resolve([_.output, embeds]))\n\t})\n}\n","import fetchJsonp from 'fetch-jsonp'\nimport { asyncEmbed } from '../../helpers'\nimport regex from '../regex'\n\nexport default class Twitter {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.twitter;\n\t\tthis.service = 'twitter';\n\n\t\tthis.load = this.load.bind(this);\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', this.load, false);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the data from twitter's oEmbed API\n\t * @param {string} url URL of the tweet\n\t * @return {object} data containing the tweet info\n\t */\n\ttweetData(url) {\n\t\tlet config = this.options.tweetOptions;\n\t\tlet apiUrl = `https://api.twitter.com/1/statuses/oembed.json?omit_script=true&url=${url}&maxwidth=${config.maxWidth}&hide_media=${config.hideMedia}&hide_thread=${config.hideThread}&align=${config.align}&lang=${config.lang}`;\n\t\treturn new Promise((resolve) => {\n\t\t\tfetchJsonp(apiUrl, {credentials: 'include'})\n\t\t\t\t.then((data)=>data.json())\n\t\t\t\t.then((json)=>resolve(json))\n\t\t})\n\t}\n\n\t/**\n\t * Load twitter widgets\n\t * @return null\n\t */\n\tload() {\n\t\tconst twitter = this.options.plugins.twitter;\n\t\ttwitter.widgets.load(this.options.element); //here this refers to the element\n\n\t\t//Execute the function after the widget is loaded\n\t\ttwitter.events.bind('loaded', this.options.onTweetsLoad);\n\t}\n\n\tstatic urlToText(_this, match, url) {\n\t\treturn new Promise((resolve) => _this.tweetData(url).then((data) => resolve(data.html)))\n\t}\n\n\tprocess() {\n\t\treturn new Promise((resolve) => asyncEmbed(this, Twitter.urlToText).then((data) => resolve(data)))\n\t}\n}\n","(function(self) {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob()\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n Headers.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) { items.push(name) })\n return iteratorFor(items)\n }\n\n Headers.prototype.values = function() {\n var items = []\n this.forEach(function(value) { items.push(value) })\n return iteratorFor(items)\n }\n\n Headers.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) { items.push([name, value]) })\n return iteratorFor(items)\n }\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n function Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (!body) {\n this._bodyText = ''\n } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {\n // Only support ArrayBuffers for POST method.\n // Receiving ArrayBuffers happens via Blobs, instead.\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {}\n var body = options.body\n if (Request.prototype.isPrototypeOf(input)) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n if (!body) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = input\n }\n\n this.credentials = options.credentials || this.credentials || 'omit'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n }\n\n Request.prototype.clone = function() {\n return new Request(this)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n }\n\n Body.call(Response.prototype)\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n }\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n }\n\n var redirectStatuses = [301, 302, 303, 307, 308]\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n }\n\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n","import {ifInline, matches} from '../utils'\nimport regex from '../regex'\nimport 'whatwg-fetch'\n\n/**\n * Takes the location name and returns the coordinates of that location using the Google\n * Map API v3. This is an async function so it will return a promise.\n * @param {string} location The name of any location\n * @return {array} Returns an array in the form [latitude, longitude]\n */\nfunction getCoordinate(location) {\n\tlet url = `http://maps.googleapis.com/maps/api/geocode/json?address=${location}&sensor=false`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve([json.results[0].geometry.location.lat, json.results[0].geometry.location.lng]))\n\t})\n}\n\n/**\n * Returns the template of the Map widget. The source of the iframe is based on whether the\n * mode set in options is 'place', 'streetview' or 'view'.\n * @param {string} match The matching string in the form of @(location name).\n * @param {number} latitude Latitude of the location\n * @param {number} longitude Longitude of the location\n * @param {object} options plugin options\n * @return {string} Template of the map widget.\n */\nfunction template(match, latitude, longitude, options) {\n\tconst location = locationText(match);\n\treturn options.template.gmap(latitude, longitude, location, options);\n}\n\n/**\n * Extracts out the location name from the format @(locationName)\n * @param {string} match The string in the supported format. Eg : @(Delhi)\n * @return {string} Only the location name removing @ and brackets. Eg: Delhi\n */\nfunction locationText(match) {\n\treturn match.split('(')[1].split(')')[0]\n}\n\nexport default function (input, output, options, embeds) {\n\tlet match, promises = [], allMatches = [];\n\n\tconst service = 'map';\n\n\twhile ((match = matches(regex.gmap, output)) !== null) {\n\t\toptions.served.push(match);\n\t\tconst promise = options.mapOptions.mode !== 'place' ? getCoordinate(match[0]) : Promise.resolve([null, null]);\n\t\tpromises.push(promise);\n\t\tallMatches.push(match)\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tPromise.all(promises).then((coordinatesArr) => {\n\t\t\tfor (var i in promises) {\n\t\t\t\tlet [latitude, longitude] = coordinatesArr[i];\n\t\t\t\tlet text = template((allMatches[i])[0], latitude, longitude, options);\n\t\t\t\tif (ifInline(options, service)) {\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}${text}`\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tembeds.push({\n\t\t\t\t\t\ttext : text,\n\t\t\t\t\t\tindex: allMatches[i][0].index\n\t\t\t\t\t});\n\t\t\t\t\toutput = output.replace(regex.gmap, (regexMatch) => {\n\t\t\t\t\t\treturn `${locationText(regexMatch)}`\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve([output, embeds])\n\t\t})\n\t})\n}\n","export default function (output, options) {\n\tif (!options.plugins.marked) throw new ReferenceError(`marked.js is not loaded.`);\n\n\tconst Marked = options.plugins.marked;\n\tconst renderer = new Marked.Renderer();\n\n\trenderer.link = (href, title, text) => {\n\t\tif (href.indexOf('</a') === -1) return href;\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `${text}`\n\t\t}\n\t};\n\n\trenderer.image = (href, title, text) => {\n\t\tif (href.match(/>(.+)<\\/a/gi)) {\n\t\t\tif (!title) title = '';\n\t\t\treturn `
\"${text}\"/
`\n\t\t}\n\t\treturn `
\"${text}\"/
`\n\t};\n\n\trenderer.paragraph = (text) => `

${text}

`; //for font smiley in end.\n\n\t//Fix for heading that should be actually present in marked.js\n\t//if gfm is true the `## Heading` is acceptable but `##Heading` is not\n\tMarked.Lexer.rules.gfm.heading = Marked.Lexer.rules.normal.heading;\n\tMarked.Lexer.rules.tables.heading = Marked.Lexer.rules.normal.heading;\n\n\toptions.markedOptions.renderer = renderer;\n\toptions.markedOptions.highlight = false;\n\treturn Marked(output, options.markedOptions)\n}\n","import regex from '../regex'\n\n/**\n * Encodes the characters like <, > and space and replaces them with\n * <, > and > respectively.\n * @param {string} code The string that has to be encoded.\n * @return {string} The encoded string\n */\nfunction encode(code) {\n\tcode = code.replace(/&/gm, '');\n\tcode = code.replace(/</g, '<');\n\tcode = code.replace(/>/g, '>');\n\treturn code;\n}\n\n/**\n * removes whitespace characters\n * @param {string} code The string from which the whitespace has to be removed\n * @return {string}\n */\nfunction trimSpace(code) {\n\tcode = code.replace(/^([ \\t]*)/g, ''); // leading whitespace\n\tcode = code.replace(/[ \\t]*$/g, ''); // trailing whitespace\n\treturn code;\n}\n\n\n/**\n * Places the code and the language name in the required template\n * @param {string} processedCode\n * @param {string} language\n * @return {string}\n */\nfunction addTemplate(processedCode, language) {\n\treturn `
${processedCode.value || processedCode}
`\n}\n\n\n/**\n * Replaces the code block with the pre tags and returns a string having the code\n * formatting using Highlight.js.\n * => Matches the string with the regex and finds the code written in three back-ticks ```\n * => Detects whether any language has been provided by the user.\n * The format supported by embed.js is\n * ```[language-name]\n * var a = 2;\n * ```\n * => Trims all the unnecessary spaces and newlines from the code.\n * => Passes the code to `hljs.highlightAuto(code, language)` which returns a formatted string\n * having the html tags for styling. The `language` here is optional. In case we don't pass the\n * language, it tries to detect the language itself.\n * => Replaces the code string in the template with the formatted string\n * @return {string} The string in which the code is formatted\n */\nexport default function (output, options) {\n\toutput = output.replace(regex.inlineCode, function (match, group1, group2) {\n\t\treturn `${group2}`\n\t});\n\n\treturn output.replace(regex.highlightCode, (match, group1, group2, group3) => {\n\t\tlet code = group3;\n\t\tcode = trimSpace(code);\n\t\tcode = encode(code);\n\n\t\t// to prevent auto-linking. Not necessary in code\n\t\t// *blocks*, but in code spans. Will be converted\n\t\t// back after the auto-linker runs.\n\t\tcode = code.replace(/:\\/\\//g, '~P');\n\n\t\tlet language = group2.split('\\n')[0];\n\t\tlet highlightedCode;\n\n\t\tconst HighlightJS = options.plugins.highlightjs;\n\t\tif (language) {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code, [language]);\n\t\t} else {\n\t\t\thighlightedCode = HighlightJS.highlightAuto(code);\n\t\t\tlanguage = highlightedCode.language;\n\t\t}\n\n\t\treturn addTemplate(highlightedCode, language);\n\t});\n}\n","import regex from '../regex'\nimport { embed } from '../../helpers'\n\nexport default class Gist {\n\tconstructor(input, output, options, embeds) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.options = options;\n\t\tthis.embeds = embeds;\n\t\tthis.regex = regex.gist;\n\t\tthis.service = 'gist';\n\n\t\tif(typeof this.options.input !== 'string'){\n\t\t\tthis.options.input.addEventListener('rendered', () => {\n\t\t\t\tthis.load()\n\t\t\t})\n\t\t}\n\t}\n\n\ttemplate(match) {\n\t\treturn `
`\n\t}\n\n\tload() {\n\t\tlet gists = this.options.input.getElementsByClassName('ejs-gist');\n\t\tfor (let i = 0; i < gists.length; i++) {\n\t\t\tlet gistFrame = document.createElement(\"iframe\");\n\t\t\tgistFrame.setAttribute(\"width\", \"100%\");\n\t\t\tgistFrame.id = `ejs-gist-${i}`;\n\n\t\t\tlet zone = gists[i];\n\t\t\tzone.innerHTML = \"\";\n\t\t\tzone.appendChild(gistFrame);\n\n\t\t\t// Create the iframe's document\n\t\t\tlet url = gists[i].getAttribute('data-src');\n\t\t\turl = url.indexOf('http') === -1 ? `https://${url}` : url;\n\t\t\tlet gistFrameHTML = ``;\n\n\t\t\t// Set iframe's document with a trigger for this document to adjust the height\n\t\t\tlet gistFrameDoc = gistFrame.document;\n\n\t\t\tif (gistFrame.contentDocument) {\n\t\t\t\tgistFrameDoc = gistFrame.contentDocument;\n\t\t\t} else if (gistFrame.contentWindow) {\n\t\t\t\tgistFrameDoc = gistFrame.contentWindow.document;\n\t\t\t}\n\n\t\t\tgistFrameDoc.open();\n\t\t\tgistFrameDoc.writeln(gistFrameHTML);\n\t\t\tgistFrameDoc.close();\n\t\t}\n\t}\n\n\tprocess() {\n\t\treturn embed(this);\n\t}\n}\n","import { truncate } from '../utils'\nimport { getDetailsTemplate, template, asyncEmbed } from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\nfunction formatData(data) {\n\treturn {\n\t\ttitle : data.snippet.title,\n\t\tthumbnail : data.snippet.thumbnails.medium.url,\n\t\trawDescription: data.snippet.description,\n\t\tviews : data.statistics.viewCount,\n\t\tlikes : data.statistics.likeCount,\n\t\tdescription : truncate(data.snippet.description, 150),\n\t\turl : `https://www.youtube.com/watch?v=${data.id}`,\n\t\tid : data.id,\n\t\thost : 'youtube'\n\t}\n}\n\nfunction data(id, options) {\n\tlet url = `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${options.googleAuthKey}&part=snippet,statistics`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.items[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id = normalEmbed ? match[1] : match[2];\n\tlet embedUrl = `https://www.youtube.com/embed/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id, args.options).then((data) => resolve(getDetailsTemplate(formatData(data), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.youtube,\n\t\tservice: 'youtube'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {truncate} from '../utils'\nimport {getDetailsTemplate, template, asyncEmbed} from '../../helpers'\nimport 'whatwg-fetch'\nimport regex from '../regex'\n\n\nfunction formatData(data, truncate) {\n\treturn {\n\t\ttitle : data.title,\n\t\tthumbnail : data.thumbnail_medium,\n\t\trawDescription: data.description.replace(/\\n/g, '
').replace(/ /g, '
'),\n\t\tviews : data.stats_number_of_plays,\n\t\tlikes : data.stats_number_of_likes,\n\t\tdescription : truncate(data.description.replace(/((<|<)br\\s*\\/*(>|>)\\r\\n)/g, ' '), 150),\n\t\turl : data.url,\n\t\tid : data.id,\n\t\thost : 'vimeo'\n\t}\n}\n\nfunction data(id) {\n\tlet url = `https://vimeo.com/api/v2/video/${id}.json`;\n\treturn new Promise((resolve) => {\n\t\tfetch(url)\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json[0]))\n\t})\n}\n\nfunction urlToText(args, match, url, normalEmbed) {\n\tlet id;\n\tif (!normalEmbed) {\n\t\tid = args.options.link ? match[0].slice(0, -4).split('/').slice(-1).pop() : match[0].split('/').slice(-1).pop();\n\t} else {\n\t\tid = match[3]\n\t}\n\tif (!id) return;\n\tlet embedUrl = `https://player.vimeo.com/video/${id}`;\n\tif (args.options.videoDetails) {\n\t\treturn new Promise((resolve) => {\n\t\t\tdata(id).then((data) => resolve(getDetailsTemplate(formatData(data, truncate), data, embedUrl, args.options)))\n\t\t})\n\t} else {\n\t\treturn new Promise((resolve) => resolve(template(embedUrl, args.options)))\n\t}\n\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tregex : regex.vimeo,\n\t\tservice: 'vimeo'\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../../helpers'\nimport fetchJsonp from 'fetch-jsonp'\nimport regex from '../regex'\n\nfunction fetchData(args, url) {\n\tlet api = `http://www.slideshare.net/api/oembed/2?url=${url}&format=jsonp&maxwidth=${args.options.videoWidth}&maxheight=${args.options.videoHeight}`;\n\treturn new Promise((resolve) => {\n\t\tfetchJsonp(api, {credentials: 'include'})\n\t\t\t.then((data) => data.json())\n\t\t\t.then((json) => resolve(json.html))\n\t})\n}\n\nfunction urlToText(args, match, url) {\n\treturn new Promise((resolve) => {\n\t\tfetchData(args, url).then((html) => resolve(args.template(html)))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tregex: regex.slideShare,\n\t\tservice: 'slideshare',\n\t\ttemplate(html) {\n\t\t\treturn this.options.template.slideShare(html, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import { urlRegex } from './utils'\nimport { asyncEmbed } from '../helpers'\nimport 'whatwg-fetch'\n\nfunction fetchData(url, _) {\n\turl = encodeURIComponent(url);\n\tlet api = new Function('url', 'return `' + _.options.openGraphEndpoint + '`')(url);\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then((res)=>res.json())\n\t\t\t.then((json)=>resolve(_.options.onOpenGraphFetch(json) || json))\n\t})\n}\n\nfunction urlToText(_, match, url) {\n\tif (url.match(_.excludeRegex)) return Promise.resolve();\n\n\treturn new Promise((resolve) => {\n\t\tfetchData(url, _).then((data) => resolve(data && data.success ? _.template(data) : ''))\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput,\n\t\toutput,\n\t\toptions,\n\t\tembeds,\n\t\tservice : 'opengraph',\n\t\tregex : urlRegex(),\n\t\texcludeRegex: new RegExp(['.mp4|.mp3|.gif|.pdf|.doc|.ppt|.docx|.jpg|.jpeg|.ogg'].concat(options.openGraphExclude).join('|'), 'gi'),\n\t\ttemplate(data) {\n\t\t\treturn this.options.template.openGraph(data, this.options)\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import {asyncEmbed} from '../helpers'\nimport regex from './regex'\nimport 'whatwg-fetch'\n\nfunction template(data, options) {\n\treturn options.template.github(data, options);\n}\n\nfunction fetchRepo(data) {\n\tlet api = `https://api.github.com/repos/${data.user}/${data.repo}`;\n\treturn new Promise((resolve) => {\n\t\tfetch(api)\n\t\t\t.then(function (data) {\n\t\t\t\treturn data.json()\n\t\t\t})\n\t\t\t.then(function (json) {\n\t\t\t\treturn resolve(json)\n\t\t\t})\n\t})\n}\n\nfunction urlToText(_this, match, url, normalEmbed) {\n\tlet data = !normalEmbed ? ({\n\t\tuser: match[2],\n\t\trepo: match[3]\n\t}) : ({\n\t\tuser: match[1],\n\t\trepo: match[2]\n\t});\n\n\tif (!data.repo) return;\n\treturn new Promise(function (resolve) {\n\t\tfetchRepo(data)\n\t\t\t.then(function (response) {\n\t\t\t\treturn resolve(template(response, _this.options))\n\t\t\t})\n\t})\n}\n\nexport default function (input, output, options, embeds) {\n\tconst args = {\n\t\tinput, output, options, embeds,\n\t\tservice: 'github',\n\t\tregex : regex.github\n\t};\n\n\treturn new Promise((resolve) => asyncEmbed(args, urlToText).then((data) => resolve(data)))\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst mRegex = regex.mentions;\n\treturn input.replace(mRegex,(match, $1, $2) => {\n\t\tconst username = $2.split('@')[1];\n\t\treturn $1 + options.mentionsUrl(username);\n\t})\n}\n","import regex from './regex';\n\nexport default function (input, options) {\n\tconst hRegex = regex.hashtag;\n\treturn input.replace(hRegex,(match, $1, $2)=>{\n\t\tconst username = $2.split('#')[1];\n\t\treturn $1 + options.hashtagUrl(username);\n\t})\n}\n","import { ifEmbed, createText, deepExtend, cloneObject, processOptions } from './modules/utils'\n\nimport renderer from './modules/template'\n\nimport emoji from './modules/emoticons/emoji'\nimport smiley from './modules/emoticons/smiley'\nimport url from './modules/url'\n\nimport Twitter from './modules/twitter/twitter'\nimport gmap from './modules/map/map'\nimport markdown from './modules/markdown'\n\nimport highlight from './modules/code/highlight'\nimport Gist from './modules/code/gist'\n\nimport youtube from './modules/video/youtube'\nimport vimeo from './modules/video/vimeo'\n\nimport slideShare from './modules/image/slideshare'\n\nimport openGraph from './modules/openGraph'\nimport github from './modules/github'\n\nimport mentions from './modules/mentions';\nimport hashtag from './modules/hashtag';\n\nimport regex from './modules/regex'\n\nimport { applyPlyr, applyVideoJS, playVideo, destroyVideos, baseEmbed } from './helpers'\n\nlet globalOptions = {};\n\nconst defaultOptions = {\n\tmarked: false,\n\tmarkedOptions: {},\n\tlink: true,\n\tlinkOptions: {\n\t\ttarget: 'self',\n\t\texclude: ['pdf'],\n\t\trel: ''\n\t},\n\temoji: true,\n\tcustomEmoji: [],\n\tfontIcons: true,\n\tcustomFontIcons: [],\n\thighlightCode: false,\n\tmentions: false,\n\thashtag: false,\n\tvideoJS: false,\n\tvideojsOptions: {\n\t\tfluid: true,\n\t\tpreload: 'metadata'\n\t},\n\tplyr: false,\n\tplyrOptions: {},\n\tlocationEmbed: true,\n\tmapOptions: {\n\t\tmode: 'place'\n\t},\n\ttweetsEmbed: false,\n\ttweetOptions: {\n\t\tmaxWidth: 550,\n\t\thideMedia: false,\n\t\thideThread: false,\n\t\talign: 'none',\n\t\tlang: 'en'\n\t},\n\tsingleEmbed: false,\n\topenGraphEndpoint: null,\n\topenGraphExclude: [],\n\tvideoEmbed: true,\n\tvideoHeight: null,\n\tvideoWidth: null,\n\tvideoDetails: true,\n\taudioEmbed: true,\n\timageEmbed: true,\n\texcludeEmbed: [],\n\tinlineEmbed: [],\n\tinlineText: true,\n\tcodeEmbedHeight: 500,\n\tvineOptions: {\n\t\tmaxWidth: null,\n\t\ttype: 'postcard', //'postcard' or 'simple' embedding\n\t\tresponsive: true,\n\t\twidth: 350,\n\t\theight: 460\n\t},\n\tplugins: {\n\t\tmarked: window.marked,\n\t\tvideojs: window.videojs,\n\t\tplyr: window.plyr,\n\t\thighlightjs: window.hljs,\n\t\tprismjs: window.Prism,\n\t\ttwitter: window.twttr\n\t},\n\tgoogleAuthKey: '',\n\tsoundCloudOptions: {\n\t\theight: 160,\n\t\tthemeColor: 'f50000', //Hex Code of the player theme color\n\t\tautoPlay: false,\n\t\thideRelated: false,\n\t\tshowComments: true,\n\t\tshowUser: true,\n\t\tshowReposts: false,\n\t\tvisual: false, //Show/hide the big preview image\n\t\tdownload: false //Show/Hide download buttons\n\t},\n\tvideoClickClass: 'ejs-video-thumb',\n\tcustomVideoClickHandler: false,\n\tmentionsUrl: function () {\n\t},\n\thashtagUrl: function () {\n\t},\n\tbeforeEmbedJSApply: function () {\n\t},\n\tafterEmbedJSApply: function () {\n\t},\n\tonVideoShow: function () {\n\t},\n\tonTweetsLoad: function () {\n\t},\n\tvideojsCallback: function () {\n\t},\n\tonOpenGraphFetch: function () {\n\t},\n\tonOpenGraphFail: function () {\n\t},\n\tvideoClickHandler: function () {\n\t},\n\tserved: [] //Private variable used to store processed urls so that they are not processed multiple times.\n};\n\nlet instances = [];\nlet allInstances = [];\nlet promises = [];\n\nexport default class EmbedJS {\n\t/**\n\t * The constructor takes two arguments. The first one is the options object and the second one is the\n\t * optional string . If the user wants to provide a string directly instead of the element, he can do that.\n\t * In case the user provides both the input element and the string, the input string will be taken from the element\n\t * and the provided string won't be processed.\n\t *\n\t * @param {object} options The options object\n\t * @param template\n\t * @return {null}\n\t */\n\tconstructor(options, template) {\n\t\t/**\n\t\t * We have created a clone of the original options to make sure that the original object\n\t\t * isn't altered.\n\t\t */\n\t\tlet defOpts = cloneObject(defaultOptions);\n\t\tlet globOpts = cloneObject(globalOptions);\n\n\t\t//merge global options with the default options\n\t\tlet globOptions = deepExtend(defOpts, globOpts);\n\n\t\t//deepExtend global options with the overriding options provided by the user as an options\n\t\t//object while creating a new instance of embed.js\n\t\tthis.options = deepExtend(globOptions, options);\n\n\t\tthis.options.template = template || renderer;\n\n\t\tif (!(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\n\t}\n\n\t/**\n\t * Processes the string and performs all the insertions and manipulations based on\n\t * the options and the input provided by the user. This returns a promise which is resolved once the result data is ready\n\t * @return {Promise} The processes resulting string\n\t */\n\tprocess() {\n\t\tconst input = this.input;\n\n\t\tif (input === '') return Promise.resolve('');\n\n\t\tconst options = processOptions(this.options);\n\t\tlet embeds = [];\n\t\tlet output = input;\n\n\t\tthis.options.beforeEmbedJSApply();\n\n\t\treturn new Promise((resolve) => {\n\t\t\tif (options.link)\n\t\t\t\toutput = url(input, options);\n\n\t\t\tconst openGraphPromise = options.openGraphEndpoint ? openGraph(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\n\t\t\topenGraphPromise.then(function ([output, embeds]) {\n\t\t\t\tif (options.highlightCode) {\n\t\t\t\t\toutput = highlight(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.marked) {\n\t\t\t\t\toutput = markdown(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.emoji) {\n\t\t\t\t\toutput = emoji(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.fontIcons) {\n\t\t\t\t\toutput = smiley(output, options)\n\t\t\t\t}\n\t\t\t\tif (options.mentions) {\n\t\t\t\t\toutput = mentions(output, options);\n\t\t\t\t}\n\t\t\t\tif (options.hashtag) {\n\t\t\t\t\toutput = hashtag(output, options);\n\t\t\t\t}\n\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ideone, 'ideone');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.plunker, 'plunker');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsbin, 'jsbin');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.codepen, 'codepen');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.jsfiddle, 'jsfiddle');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ted, 'ted');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.dailymotion, 'dailymotion');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.ustream, 'ustream');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.liveleak, 'liveleak');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicVideo, 'video', options.videoEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.vine, 'vine');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.soundCloud, 'soundcloud');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.spotify, 'spotify');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicAudio, 'audio', options.audioEmbed);\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.flickr, 'flickr');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.instagram, 'instagram');\n\t\t\t\t[output, embeds] = baseEmbed(input, output, embeds, options, regex.basicImage, 'image', options.imageEmbed);\n\n\t\t\t\tif (ifEmbed(options, 'gist')) {\n\t\t\t\t\t[output, embeds] = new Gist(input, output, options, embeds).process()\n\t\t\t\t}\n\n\t\t\t\treturn ifEmbed(options, 'youtube') ? youtube(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'vimeo') ? vimeo(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'github') ? github(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn options.locationEmbed && ifEmbed(options, 'gmap') ? gmap(input, output, options, embeds) : Promise.resolve([output, embeds])\n\t\t\t}).then(function ([output, embeds]) {\n\t\t\t\treturn ifEmbed(options, 'slideshare') ? slideShare(input, output, options, embeds) : Promise.resolve([output, embeds]);\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tif (options.tweetsEmbed && ifEmbed(options, 'twitter')) {\n\t\t\t\t\tthis.twitter = new Twitter(input, output, options, embeds);\n\t\t\t\t\treturn this.twitter.process()\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.resolve([output, embeds])\n\t\t\t\t}\n\t\t\t}).then(([output, embeds]) => {\n\t\t\t\tthis.data = {\n\t\t\t\t\tinput: options.input,\n\t\t\t\t\toutput,\n\t\t\t\t\toptions,\n\t\t\t\t\tinputString: this.input,\n\t\t\t\t\tservices: options.served,\n\t\t\t\t\ttemplate: options.template\n\t\t\t\t};\n\n\t\t\t\tresolve(createText(output, embeds))\n\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * First processes the data by calling the .process() and then renders the data in the div\n\t * => Loads the twitter widgets\n\t * => Executes the onTweetsLoad() once all the tweets have been rendered\n\t * => Applies video.js on the media (both audio and video)\n\t * => Triggers video loading on click of the video preview\n\t * => Executes afterEmbedJSApply() once everything is done.\n\t *\n\t * @return Promise\n\t */\n\trender() {\n\t\tif (typeof this.options.input === 'string') throw new Error(`You cannot call render method for a string`);\n\t\tif (!this.options.input) throw new Error(`You didn't pass an element while creating this instance. render() method can't work without an input element`);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.process().then((data) => {\n\t\t\t\tthis.options.input.innerHTML = data;\n\t\t\t\tthis.applyListeners();\n\t\t\t\tresolve(this.data);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * This method listens to all the events like click, handle\n\t * events to be done after an element has been rendered. These\n\t * include twitter widget rendering, gist embedding, click event listeners .\n\t */\n\tapplyListeners() {\n\t\tapplyVideoJS(this.options);\n\t\tapplyPlyr(this.options);\n\n\t\tplayVideo(this.options);\n\n\t\tlet event = new Event('rendered');\n\t\tthis.options.input.dispatchEvent(event);\n\n\t\tthis.options.afterEmbedJSApply();\n\t}\n\n\n\t/**\n\t * This function updates the parametrs of the current instance\n\t * @param options New updated options object. will be extended with the older options\n\t * @param template [optional] the new template instance\n\t */\n\tupdate(options, template) {\n\n\t\tif (options)\n\t\t\tthis.options = deepExtend(this.options, options);\n\n\t\tif (template)\n\t\t\tthis.options.template = template;\n\n\t\tif (!this.options.input || !(typeof this.options.input === 'string' || typeof this.options.input === 'object')) throw ReferenceError(\"You need to pass an element or the string that needs to be processed\");\n\n\t\tthis.input = (typeof this.options.input === 'object') ? this.options.input.innerHTML : this.options.input\n\t}\n\n\t/**\n\t * returns the resulting string based on the input and the options passed by the user.\n\t * @return Promise\n\t */\n\ttext(callback) {\n\t\tthis.process().then((data) => callback(data, this.input))\n\t}\n\n\t/**\n\t * The destroy method destroys all the listeners and replaces the rih text with the original text in the\n\t * element.\n\t * @return {null}\n\t */\n\tdestroy() {\n\t\tif (typeof this.options.input !== 'object') throw new Error(`destroy() method only works if an element had been passed in the options object`);\n\t\tdestroyVideos('ejs-video-thumb');\n\t\tif (this.options.tweetsEmbed)\n\t\t\tthis.options.input.removeEventListener('rendered', this.twitter.load(), false);\n\t\tthis.options.input.innerHTML = this.input\n\t}\n\n\t/**\n\t * Sets options globally\n\t * @param {object} options\n\t */\n\tstatic setOptions(options) {\n\t\tglobalOptions = deepExtend(defaultOptions, options)\n\t}\n\n\t/**\n\t * Applies embed.js to all the elements with the class name provided as option\n\t * @return {Promise}\n\t * @param selectorName\n\t * @param options\n\t * @param template\n\t */\n\tstatic applyEmbedJS(selectorName, options = {}, template = renderer) {\n\t\tlet elements = document.querySelectorAll(selectorName);\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\toptions.input = elements[i];\n\t\t\tinstances[i] = new EmbedJS(options, template);\n\t\t\tpromises[i] = instances[i].render()\n\t\t}\n\t\treturn new Promise(function (resolve) {\n\t\t\tPromise.all(promises).then(function (val) {\n\t\t\t\tresolve(val);\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Destroys all the instances of EmbedJS created by using applyEmbedJS() method.\n\t * @return {null}\n\t */\n\tstatic destroyEmbedJS() {\n\t\tfor (let i = 0; i < instances.length; i++) {\n\t\t\tinstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all instances of EmbedJS on the page\n\t * @return {null}\n\t */\n\tstatic destroyAll() {\n\t\tfor (let i = 0; i < allInstances.length; i++) {\n\t\t\tallInstances[i].destroy()\n\t\t}\n\t}\n\n\t/**\n\t * Creates a new instance of the Template constructor. This has been done so that multiple\n\t * templates of a single service can be used by creating different instances of the Template.\n\t *\n\t * The usage of the plugin is described below.\n\t *\n\t * => Create a new Instance of the template by using .Template() method of EmbedJS.\n\t *\n\t * var template = EmbedJS.Template()\n\t *\n\t * => Now create different templates for different service names.\n\t *\n\t * template.url = function(match, options){\n * \t\t\treturn ' + match + '\n * \t\t}\n\t *\n\t * template.instagram = function(match, dimensions, options){\n * \t\t\tvar config = options.soundCloudOptions;\n * \t\t\treturn `
`;\n * \t\t}\n\t *\n\t */\n\tstatic Template() {\n\t\treturn renderer;\n\t}\n}\n"],"names":["truncate","string","n","substr","length","toUrl","indexOf","deepExtend","destination","source","property","hasOwnProperty","constructor","Object","escapeRegExp","str","replace","sortObject","arr","sort","a","b","index","createText","embeds","sortedEmbeds","i","text","matches","regex","input","exec","ifEmbed","options","service","singleEmbed","served","excludeEmbed","ifInline","inlineEmbed","setDimensions","videoWidth","videoHeight","cloneObject","obj","temp","key","urlRegex","arrayLowercase","map","elem","toLowerCase","processOptions","lastElement","match","config","linkOptions","rel","target","pre","code","soundCloudOptions","autoPlay","hideRelated","showComments","showUser","showReposts","visual","download","themeColor","id","split","codeEmbedHeight","slice","html","splice","join","data","fullData","embedUrl","thumbnail","url","title","description","views","likes","vineOptions","type","height","width","plyr","image","owner","avatar_url","html_url","full_name","stargazers_count","network_count","latitude","longitude","location","mapOptions","mode","googleAuthKey","getEmoji","substring","output","smileys","emoji","template","defaultIcons","icons","customFontIcons","escapedSymbols","val","smileyRegex","RegExp","smiley","extension","exclude","global","factory","define","amd","exports","module","mod","fetchJsonp","this","defaultOptions","generateCallbackFunction","Date","now","Math","ceil","random","clearFunction","functionName","window","e","undefined","removeScript","scriptId","script","document","getElementById","getElementsByTagName","removeChild","_url","arguments","timeout","jsonpCallback","timeoutId","Promise","resolve","reject","callbackFunction","jsonpCallbackFunction","response","json","clearTimeout","jsonpScript","createElement","setAttribute","appendChild","setTimeout","Error","vimeo","youtube","playVideo","customVideoClickHandler","videoClickHandler","classes","getElementsByClassName","videoClickClass","onclick","onVideoShow","getAttribute","parentNode","innerHTML","host","detailsVimeo","detailsYoutube","plugins","ReferenceError","setup","plyrOptions","applyVideoJS","videojsOptions","videoJS","videojs","VideoJS","elements","videojsCallback","className","_","regexInline","link","push","inlineText","normalEmbed","embed","args","baseEmbed","flag","base","getInlineData","urlToText","then","inlineAsyncEmbed","promises","all","getNormalData","normalAsyncEmbed","asyncEmbed","Twitter","twitter","load","bind","addEventListener","tweetOptions","apiUrl","maxWidth","hideMedia","hideThread","align","lang","credentials","widgets","element","events","onTweetsLoad","_this","tweetData","self","fetch","support","Symbol","Blob","normalizeName","name","String","test","TypeError","normalizeValue","value","iteratorFor","items","iterator","shift","done","iterable","Headers","headers","forEach","append","getOwnPropertyNames","prototype","list","get","values","getAll","has","set","callback","thisArg","call","keys","entries","consumed","body","bodyUsed","fileReaderReady","reader","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","readAsArrayBuffer","readBlobAsText","readAsText","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","formData","FormData","_bodyFormData","searchParams","URLSearchParams","toString","arrayBuffer","ArrayBuffer","rejected","decode","JSON","parse","methods","normalizeMethod","method","upcased","toUpperCase","Request","referrer","clone","form","trim","bytes","decodeURIComponent","xhr","head","pairs","getAllResponseHeaders","header","Response","bodyInit","status","ok","statusText","redirectStatuses","redirect","RangeError","init","request","XMLHttpRequest","responseURL","getResponseHeader","responseText","ontimeout","open","withCredentials","responseType","setRequestHeader","send","polyfill","getCoordinate","results","geometry","lat","lng","locationText","gmap","allMatches","promise","coordinatesArr","regexMatch","marked","Marked","renderer","Renderer","href","$1","paragraph","Lexer","rules","gfm","heading","normal","tables","markedOptions","highlight","encode","trimSpace","addTemplate","processedCode","language","inlineCode","group1","group2","highlightCode","group3","highlightedCode","HighlightJS","highlightjs","highlightAuto","Gist","gist","gists","gistFrame","zone","gistFrameHTML","gistFrameDoc","contentDocument","contentWindow","writeln","close","formatData","snippet","thumbnails","medium","statistics","viewCount","likeCount","videoDetails","getDetailsTemplate","thumbnail_medium","stats_number_of_plays","stats_number_of_likes","pop","fetchData","api","slideShare","encodeURIComponent","Function","openGraphEndpoint","res","onOpenGraphFetch","excludeRegex","success","concat","openGraphExclude","openGraph","github","fetchRepo","user","repo","mRegex","mentions","$2","username","mentionsUrl","hRegex","hashtag","hashtagUrl","globalOptions","hljs","Prism","twttr","instances","allInstances","EmbedJS","defOpts","globOpts","globOptions","beforeEmbedJSApply","openGraphPromise","markdown","fontIcons","ideone","plunker","jsbin","codepen","jsfiddle","ted","dailymotion","ustream","liveleak","basicVideo","videoEmbed","vine","soundCloud","spotify","basicAudio","audioEmbed","flickr","instagram","basicImage","imageEmbed","process","locationEmbed","tweetsEmbed","applyListeners","event","Event","dispatchEvent","afterEmbedJSApply","removeEventListener","selectorName","querySelectorAll","render","destroy"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMA,AAAO,SAASA,QAAT,CAAkBC,MAAlB,EAA0BC,CAA1B,EAA6B;WACzBD,OAAOE,MAAP,CAAc,CAAd,EAAiBD,IAAI,CAArB,KAA2BD,OAAOG,MAAP,GAAgBF,CAAhB,GAAoB,KAApB,GAA4B,EAAvD,CAAP;;;;;;;;AAQJ,AAAO;;;;;;AAiBP,AAAO,SAASG,KAAT,CAAeJ,MAAf,EAAuB;WAClBA,OAAOK,OAAP,CAAe,IAAf,MAAyB,CAAC,CAA3B,GAAiC,OAAOL,MAAxC,GAAkDA,MAAzD;;;;;;;;;AASJ,AAAO,SAASM,UAAT,CAAoBC,WAApB,EAAiCC,MAAjC,EAAyC;SACvC,IAAIC,QAAT,IAAqBD,MAArB,EAA6B;YACrBA,OAAOE,cAAP,CAAsBD,QAAtB,KAAmCD,OAAOC,QAAP,CAAnC,IAAuDD,OAAOC,QAAP,EAAiBE,WAAjB,KAAiCC,MAA5F,EAAoG;wBACpFH,QAAZ,IAAwBF,YAAYE,QAAZ,KAAyB,EAAjD;uBACWF,YAAYE,QAAZ,CAAX,EAAkCD,OAAOC,QAAP,CAAlC;SAFJ,MAGO;wBACSA,QAAZ,IAAwBD,OAAOC,QAAP,CAAxB;;;WAGDF,WAAP;;;AAGJ,AAAO,SAASM,YAAT,CAAsBC,GAAtB,EAA2B;WACvBA,IAAIC,OAAJ,CAAY,oCAAZ,EAAkD,MAAlD,CAAP;;;;;;;;AAQJ,SAASC,UAAT,CAAoBC,GAApB,EAAyB;WACdA,IAAIC,IAAJ,CAAS,UAACC,CAAD,EAAIC,CAAJ;eAAWD,EAAEE,KAAF,GAAUD,EAAEC,KAAvB;KAAT,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B4E,WAArB,CAAf;aACSnF,CAAT,IAAcuZ,UAAUvZ,CAAV,EAAagc,MAAb,EAAd;;UAEM,IAAIjU,OAAJ,CAAY,UAAUC,OAAV,EAAmB;YAC7ByD,GAAR,CAAYD,QAAZ,EAAsBF,IAAtB,CAA2B,UAAU9F,GAAV,EAAe;aACjCA,GAAR;KADD;IADM,CAAP;;;;;;;;;;mCAWuB;QAClB,IAAIxF,IAAI,CAAb,EAAgBA,IAAIuZ,UAAU7a,MAA9B,EAAsCsB,GAAtC,EAA2C;cAChCA,CAAV,EAAaic,OAAb;;;;;;;;;;;+BAQkB;QACd,IAAIjc,IAAI,CAAb,EAAgBA,IAAIwZ,aAAa9a,MAAjC,EAAyCsB,GAAzC,EAA8C;iBAChCA,CAAb,EAAgBic,OAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BgB;UACV1H,QAAP;;;;;;;;"} \ No newline at end of file From 7dbc1c49f2ed847f07eece06edc6454000be5ba5 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Wed, 25 Jan 2017 20:31:47 +0530 Subject: [PATCH 14/62] fix(asyncEmbed): fixes 194 --- Gruntfile.js | 2 +- demo/index.html | 15 +++++++++++---- src/js/helpers/asyncEmbed.js | 8 ++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 156868e..f125516 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -44,7 +44,7 @@ module.exports = function (grunt) { ] }, dist : { - src : '.tmp/embed.css', + src : 'dist/embed.css', dest: 'dist/embed.min.css' } }, diff --git a/demo/index.html b/demo/index.html index 48a2e74..3fa29f4 100644 --- a/demo/index.html +++ b/demo/index.html @@ -9,7 +9,7 @@ - +