!function(){"use strict";function t(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))}function e(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]=e?t:""+Array(e+1-r.length).join(n)+t},g={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var u=e.name;b[u]=e,i=u}return!r&&i&&($=i),i||!r&&$},S=function(t,e){if(M(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},D=g;D.l=w,D.i=M,D.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function y(t){this.$L=w(t.locale,null,!0),this.parse(t)}var v=y.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return D},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return S(t)0,y<=m.r||!m.r){y<=1&&p>0&&(m=d[p-1]);var v=l[m.l];u&&(y=u(""+y)),c="string"==typeof v?v.replace("%d",y):v(y,r,m.l,f);break}}if(r)return c;var g=f?l.future:l.past;return"function"==typeof g?g(c):g.replace("%s",c)},r.to=function(t,e){return o(t,e,this,!0)},r.from=function(t,e){return o(t,e,this)};var a=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(a(this),t)},r.fromNow=function(t){return this.from(a(this),t)}}}(o);var a=o.exports;i.extend(a);var u,s={Widget:function(){function r(t){this.config=t}return r.prototype.initialize=function(){return t(this,void 0,void 0,(function(){var t,n,r=this;return e(this,(function(e){switch(e.label){case 0:this.dispatchEvent("init",{name:this.config.name}),t={},document.querySelectorAll("[".concat(this.config.containerAttribute,'*="').concat(this.config.keyPrefix,'_"]')).forEach((function(e){var n=e.getAttribute(r.config.containerAttribute);n&&(n in t?t[n].push(e):t[n]=[e])})),e.label=1;case 1:if(e.trys.push([1,3,,4]),!Object.keys(t).length)throw new Error("No feed containers found");return[4,Promise.all(Object.entries(t).map((function(t){var e=t[0],n=t[1];return r.loadFeed(e,n)})))];case 2:return e.sent(),this.dispatchEvent("init-complete",{name:this.config.name}),[3,4];case 3:return"string"==typeof(n=e.sent())&&this.log(n),[3,4];case 4:return[2]}}))}))},r.prototype.log=function(t){console.log("%c[feedspring.co] ".concat(t),";background: #145ff5; color: #fff; padding: 2px; border-radius: 3px;")},r.prototype.loadFeed=function(r,i){return t(this,void 0,void 0,(function(){var t,o=this;return e(this,(function(e){switch(e.label){case 0:return[4,n(r)];case 1:if("error"in(t=e.sent()))throw new Error("".concat(t.error.message," (").concat(t.error.code,")"));return this.dispatchEvent("load-complete",{data:t.data}),i.forEach((function(e){return o.renderFeed(t.data,e)})),this.dispatchEvent("render-complete",{data:t.data}),[2]}}))}))},r.prototype.dispatchEvent=function(t,e){var n=new CustomEvent("feedspring:".concat(t),{detail:e});document.dispatchEvent(n)},r.prototype.renderFeed=function(n,r){return t(this,void 0,void 0,(function(){var t,i,o,a,u,s,c=this;return e(this,(function(e){if(t=r.getAttribute("feed-type"),i=Array.from(r.querySelectorAll('[feedspring="post"], [feed-field="item"]')),"dynamic"==t&&1===i.length&&(o=i.at(0))&&(a=o.parentElement))for(u=0;u=0;t=Math.abs(t);var n=Math.log10(t)/3|0;if(0==n)return(e?"":"-")+t.toString();var r=["","k","M","G","T","P","E"][n];if(!r)throw new RangeError;return(e?"":"-")+(t/Math.pow(10,3*n)).toFixed(0)+r}(r))}}}}},c=new s.Widget({containerAttribute:"feedspring",keyPrefix:"inst",name:"instagram",extraFields:[{name:"avatar",apply:function(t,e){if("IMG"!==t.nodeName)throw'Field "avatar-url" support only HTML tag';e.avatar&&t.setAttribute("src",e.avatar)}},{name:"name",apply:function(t,e){e.fullName&&(t.innerText=e.fullName)}},{name:"username",apply:function(t,e){e.username&&(t.innerText=e.username)}},{name:"bio",apply:function(t,e){e.bio&&(t.innerText=e.bio)}},s.fields.numberAbbr("following-count","followingCount"),s.fields.numberAbbr("follower-count","followersCount")],fields:[{name:"bg",apply:function(t,e){(null==e?void 0:e.mediaUrl)&&(t.style.backgroundImage="url(".concat(e.mediaUrl,")"))}},{name:"img",apply:function(t,e){(null==e?void 0:e.mediaUrl)&&(t.setAttribute("src",e.mediaUrl),t.hasAttribute("srcset")&&t.removeAttribute("srcset"))}},{name:"link",apply:function(t,e){(null==e?void 0:e.permalink)&&t.setAttribute("href",e.permalink)}},{name:"caption",apply:function(t,e){(null==e?void 0:e.caption)&&(t.innerHTML=e.caption)}},{name:"avatar",apply:function(t,e){if("IMG"!==t.nodeName)throw'Field "avatar-url" support only HTML tag';e.avatar&&t.setAttribute("src",e.avatar)}},{name:"name",apply:function(t,e){e.fullName&&(t.innerText=e.fullName)}},{name:"username",apply:function(t,e){e.username&&(t.innerText=e.username)}},s.fields.numberAbbr("like-count","likeCount"),s.fields.numberAbbr("comment-count","commentCount"),s.fields.timestamp("timestamp","timestamp")]});u=function(){c.initialize()},"complete"==document.readyState?u():window.addEventListener("load",u)}();