(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>b});var n=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}c((r=r.apply(e,t||[])).next())})},r=function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(c){a=[6,c],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o="instagram-embed-js",i=".instagram-media",u=".retype-instagram-container",a="instagram-media-rendered",c="data-instgrmQueued",l=null,s=!1,d=!1;function f(e,t){e.forEach(function(e){if(t)return e.dataset.instgrmQueued="true",void e.setAttribute(c,"true");delete e.dataset.instgrmQueued,e.removeAttribute(c)})}function m(){return new Promise(function(e,t){var n,r,i,u;if(null===(r=null===(n=window.instgrm)||void 0===n?void 0:n.Embeds)||void 0===r?void 0:r.process)e();else{var a=function(){var e=document.getElementById(o);if(e instanceof HTMLScriptElement)return e;var t=document.createElement("script");return t.id=o,t.async=!0,t.src="https://www.instagram.com/embed.js",document.head.appendChild(t),t}();if(null===(u=null===(i=window.instgrm)||void 0===i?void 0:i.Embeds)||void 0===u?void 0:u.process)e();else if("true"!==a.dataset.loaded){var c=function(){a.dataset.loaded="true",s(),e()},l=function(){s(),t(new Error("Failed to load Instagram embed script."))},s=function(){a.removeEventListener("load",c),a.removeEventListener("error",l)};a.addEventListener("load",c,{once:!0}),a.addEventListener("error",l,{once:!0})}else e()}})}function v(e){return n(this,void 0,void 0,function(){var t,n,o;return r(this,function(r){switch(r.label){case 0:if(t=function(e){return Array.from(e.querySelectorAll("".concat(i,":not(.").concat(a,")"))).filter(function(e){if("true"===e.dataset.instgrmQueued)return!1;var t=e.closest(u);return null==(null==t?void 0:t.querySelector("iframe"))})}(e),!t.length||!function(e){return null!==e.querySelector(i)}(e))return[2];if(e===document&&"restore"===l&&function(e){return null!==e.querySelector("".concat(u," iframe"))}(document))return[2];if(s)return d=!0,[2];s=!0,f(t,!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,m()];case 2:return r.sent(),null===(o=null===(n=window.instgrm)||void 0===n?void 0:n.Embeds)||void 0===o||o.process(),[3,5];case 3:return r.sent(),f(t,!1),[3,5];case 4:return s=!1,f(t.filter(function(e){if(e.classList.contains(a))return!1;var t=e.closest(u);return null==(null==t?void 0:t.querySelector("iframe"))}),!1),d&&(d=!1,p(document)),[7];case 5:return[2]}})})}function p(e){v(e).catch(function(){})}document.addEventListener("turbo:visit",function(e){l=e.detail.action});const b={initInstagram:function(){p(document),document.querySelectorAll(".pluggable").forEach(function(e){var t=e;"true"!==t.dataset.instgrmListenerBound&&(t.dataset.instgrmListenerBound="true",t.setAttribute("data-instgrm-listener-bound","true"),t.addEventListener("onPluginReady",function(){p(t)}))})}};window.__DOCS_INSTAGRAM__=t})();