/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={35:(e,t,a)=>{"use strict";var n=a(959),l={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(e){return n.isMemo(e)?s:i[e.$$typeof]||l}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=s;var c=Object.defineProperty,m=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,a,n){if("string"!=typeof a){if(g){var l=p(a);l&&l!==g&&e(t,l,n)}var s=m(a);u&&(s=s.concat(u(a)));for(var i=o(t),_=o(a),f=0;f<s.length;++f){var h=s[f];if(!(r[h]||n&&n[h]||_&&_[h]||i&&i[h])){var y=d(a,h);try{c(t,h,y)}catch(e){}}}}return t}},62:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var l=Object.getOwnPropertyDescriptor(t,a);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,l)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return l(t,e),t},s=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(l,r){function s(e){try{o(n.next(e))}catch(e){r(e)}}function i(e){try{o(n.throw(e))}catch(e){r(e)}}function o(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,i)}o((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getSitePlugins=t.getWordPressPlugins=void 0;const i=r(a(702));t.getWordPressPlugins=e=>s(void 0,void 0,void 0,function*(){const t=yield i.fetchWordPressPlugins(e);return(null==t?void 0:t.plugins)?i.setWordPressPlugins(null==t?void 0:t.plugins):{type:"SET_WORDPRESS_PLUGINS",payload:[]}}),t.getSitePlugins=()=>s(void 0,void 0,void 0,function*(){const e=yield i.fetchSitePlugins();return i.setSitePlugins(e)})},87:e=>{"use strict";e.exports=window.wp.element},119:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIAL_STATE=t.STORE_NAME=void 0,t.STORE_NAME="quadlayers/plugins",t.INITIAL_STATE={wordpressPlugins:[],sitePlugins:[]}},143:e=>{"use strict";e.exports=window.wp.data},186:(e,t,a)=>{"use strict";var n=a(985);function l(){}function r(){}r.resetWarningCache=l,e.exports=function(){function e(e,t,a,l,r,s){if(s!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:l};return a.PropTypes=a,a}},218:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var l=Object.getOwnPropertyDescriptor(t,a);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,l)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),l=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||n(t,e,a)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(a(665)),i=r(a(609)),o=r(a(956)),c=a(362),m=a(640);a(245);const u=a(670);l(a(245),t);const d=s.default.div`
	position: relative;
	max-width: 1200px;
	display: flex;
	flex-wrap: wrap;
	margin: 25px 40px 0px 20px;
`,p=s.default.div`
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 1.25em;
	& svg {
		width: 50px;
		height: 50px;
	}
	h3 {
		margin: 1em 0 !important;
	}
`;t.default=e=>{const t=e.authorName||"",{wordpressPlugins:a,isResolvingWordPressPlugins:n,installWordPressPlugin:l}=(0,m.useWordPressPlugins)(t),{isResolvingSitePlugins:r,sitePlugins:s,activateSitePlugin:g}=(0,m.useSitePlugins)();return n||r?i.default.createElement(c.Spinner,null):0!==a.length?i.default.createElement(d,{className:"wrap"},a.map(t=>{var a;const n=(null===(a=s.find(e=>e.name===t.slug))||void 0===a?void 0:a.status)||"install";return i.default.createElement(o.default,Object.assign({key:t.slug},t,e,{installWordPressPlugin:l,pluginStatus:n,activateSitePlugin:g}))})):i.default.createElement("div",{style:{maxWidth:"1200px"}},i.default.createElement(p,null,u.WordpressIcon,i.default.createElement("h3",null,"Plugins not found")))}},245:function(e,t,a){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var l=Object.getOwnPropertyDescriptor(t,a);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,l)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return l(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.storeConfig=void 0;const i=a(143),o=a(119),c=s(a(885)),m=r(a(702)),u=r(a(807)),d=r(a(62));t.storeConfig={reducer:c.default,actions:m,selectors:u,resolvers:d};const p=(0,i.createReduxStore)(o.STORE_NAME,t.storeConfig);(0,i.register)(p)},362:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;const l=a(723),r=n(a(609));t.Spinner=()=>r.default.createElement("p",null,r.default.createElement("span",{style:{visibility:"visible"},className:"spinner"}),(0,l.__)("Loading…","wp-plugin-suggestions"))},455:e=>{"use strict";e.exports=window.wp.apiFetch},500:(e,t)=>{var a;!function(){"use strict";var n={}.hasOwnProperty;function l(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=s(e,r(a)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return l.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)n.call(e,a)&&e[a]&&(t=s(t,a));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(l.default=l,e.exports=l):void 0===(a=function(){return l}.apply(t,[]))||(e.exports=a)}()},609:e=>{"use strict";e.exports=window.React},640:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(l,r){function s(e){try{o(n.next(e))}catch(e){r(e)}}function i(e){try{o(n.throw(e))}catch(e){r(e)}}function o(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,i)}o((n=n.apply(e,t||[])).next())})},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSitePlugins=t.useWordPressPlugins=t.apiFetch=void 0;const r=a(119),s=a(143),i=l(a(455));t.apiFetch=function(e){return n(this,void 0,void 0,function*(){return yield(0,i.default)(e).then(e=>{if(e.code)throw new Error(`${e.code}: ${(null==e?void 0:e.message)||"Unknown"}`);return e}).catch(e=>{throw new Error(JSON.stringify(e))})})},t.useWordPressPlugins=function(e){const{installWordPressPlugin:t}=(0,s.useDispatch)(r.STORE_NAME),{wordpressPlugins:a,isResolvingWordPressPlugins:n,hasResolvedWordPressPlugins:l}=(0,s.useSelect)(t=>{const{isResolving:a,hasFinishedResolution:n,getWordPressPlugins:l}=t(r.STORE_NAME);return{wordpressPlugins:l(e),isResolvingWordPressPlugins:a("getWordPressPlugins"),hasResolvedWordPressPlugins:n("getWordPressPlugins",e)}},[e]);return{wordpressPlugins:a,isResolvingWordPressPlugins:n,hasResolvedWordPressPlugins:l,hasWordPressPlugins:!(!l||!(null==a?void 0:a.length)),installWordPressPlugin:t}},t.useSitePlugins=function(){const{activateSitePlugin:e}=(0,s.useDispatch)(r.STORE_NAME),{sitePlugins:t,isResolvingSitePlugins:a,hasResolvedSitePlugins:n}=(0,s.useSelect)(e=>{const{isResolving:t,hasFinishedResolution:a,getSitePlugins:n}=e(r.STORE_NAME);return{isResolvingSitePlugins:t("getSitePlugins"),hasResolvedSitePlugins:a("getSitePlugins"),sitePlugins:n()}},[]);return{sitePlugins:t,isResolvingSitePlugins:a,hasResolvedSitePlugins:n,hasSitePlugins:!(!n||!(null==t?void 0:t.length)),activateSitePlugin:e}}},665:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ServerStyleSheet:()=>Ue,StyleSheetConsumer:()=>se,StyleSheetContext:()=>re,StyleSheetManager:()=>de,ThemeConsumer:()=>Re,ThemeContext:()=>Oe,ThemeProvider:()=>De,__PRIVATE__:()=>We,createGlobalStyle:()=>Be,css:()=>Ae,default:()=>Ve,isStyledComponent:()=>A,keyframes:()=>Ge,useTheme:()=>ze,version:()=>w,withTheme:()=>He});var n=a(959),l=a(609),r=a.n(l),s=a(945),i=a.n(s);const o=function(e){function t(e,n,o,c,d){for(var p,g,_,f,b,A=0,k=0,w=0,N=0,S=0,F=0,R=_=p=0,q=0,M=0,L=0,j=0,B=o.length,G=B-1,U="",H="",z="",W="";q<B;){if(g=o.charCodeAt(q),q===G&&0!==k+N+w+A&&(0!==k&&(g=47===k?10:47),N=w=A=0,B++,G++),0===k+N+w+A){if(q===G&&(0<M&&(U=U.replace(u,"")),0<U.trim().length)){switch(g){case 32:case 9:case 59:case 13:case 10:break;default:U+=o.charAt(q)}g=59}switch(g){case 123:for(p=(U=U.trim()).charCodeAt(0),_=1,j=++q;q<B;){switch(g=o.charCodeAt(q)){case 123:_++;break;case 125:_--;break;case 47:switch(g=o.charCodeAt(q+1)){case 42:case 47:e:{for(R=q+1;R<G;++R)switch(o.charCodeAt(R)){case 47:if(42===g&&42===o.charCodeAt(R-1)&&q+2!==R){q=R+1;break e}break;case 10:if(47===g){q=R+1;break e}}q=R}}break;case 91:g++;case 40:g++;case 34:case 39:for(;q++<G&&o.charCodeAt(q)!==g;);}if(0===_)break;q++}if(_=o.substring(j,q),0===p&&(p=(U=U.replace(m,"").trim()).charCodeAt(0)),64===p){switch(0<M&&(U=U.replace(u,"")),g=U.charCodeAt(1)){case 100:case 109:case 115:case 45:M=n;break;default:M=T}if(j=(_=t(n,M,_,g,d+1)).length,0<O&&(b=i(3,_,M=a(T,U,L),n,C,x,j,g,d,c),U=M.join(""),void 0!==b&&0===(j=(_=b.trim()).length)&&(g=0,_="")),0<j)switch(g){case 115:U=U.replace(v,s);case 100:case 109:case 45:_=U+"{"+_+"}";break;case 107:_=(U=U.replace(h,"$1 $2"))+"{"+_+"}",_=1===I||2===I&&r("@"+_,3)?"@-webkit-"+_+"@"+_:"@"+_;break;default:_=U+_,112===c&&(H+=_,_="")}else _=""}else _=t(n,a(n,U,L),_,c,d+1);z+=_,_=L=M=R=p=0,U="",g=o.charCodeAt(++q);break;case 125:case 59:if(1<(j=(U=(0<M?U.replace(u,""):U).trim()).length))switch(0===R&&(p=U.charCodeAt(0),45===p||96<p&&123>p)&&(j=(U=U.replace(" ",":")).length),0<O&&void 0!==(b=i(1,U,n,e,C,x,H.length,c,d,c))&&0===(j=(U=b.trim()).length)&&(U="\0\0"),p=U.charCodeAt(0),g=U.charCodeAt(1),p){case 0:break;case 64:if(105===g||99===g){W+=U+o.charAt(q);break}default:58!==U.charCodeAt(j-1)&&(H+=l(U,p,g,U.charCodeAt(2)))}L=M=R=p=0,U="",g=o.charCodeAt(++q)}}switch(g){case 13:case 10:47===k?k=0:0===1+p&&107!==c&&0<U.length&&(M=1,U+="\0"),0<O*D&&i(0,U,n,e,C,x,H.length,c,d,c),x=1,C++;break;case 59:case 125:if(0===k+N+w+A){x++;break}default:switch(x++,f=o.charAt(q),g){case 9:case 32:if(0===N+A+k)switch(S){case 44:case 58:case 9:case 32:f="";break;default:32!==g&&(f=" ")}break;case 0:f="\\0";break;case 12:f="\\f";break;case 11:f="\\v";break;case 38:0===N+k+A&&(M=L=1,f="\f"+f);break;case 108:if(0===N+k+A+P&&0<R)switch(q-R){case 2:112===S&&58===o.charCodeAt(q-3)&&(P=S);case 8:111===F&&(P=F)}break;case 58:0===N+k+A&&(R=q);break;case 44:0===k+w+N+A&&(M=1,f+="\r");break;case 34:case 39:0===k&&(N=N===g?0:0===N?g:N);break;case 91:0===N+k+w&&A++;break;case 93:0===N+k+w&&A--;break;case 41:0===N+k+A&&w--;break;case 40:0===N+k+A&&(0===p&&(2*S+3*F==533||(p=1)),w++);break;case 64:0===k+w+N+A+R+_&&(_=1);break;case 42:case 47:if(!(0<N+A+w))switch(k){case 0:switch(2*g+3*o.charCodeAt(q+1)){case 235:k=47;break;case 220:j=q,k=42}break;case 42:47===g&&42===S&&j+2!==q&&(33===o.charCodeAt(j+2)&&(H+=o.substring(j,q+1)),f="",k=0)}}0===k&&(U+=f)}F=S,S=g,q++}if(0<(j=H.length)){if(M=n,0<O&&void 0!==(b=i(2,H,M,e,C,x,j,c,d,c))&&0===(H=b).length)return W+H+z;if(H=M.join(",")+"{"+H+"}",0!==I*P){switch(2!==I||r(H,2)||(P=0),P){case 111:H=H.replace(E,":-moz-$1")+H;break;case 112:H=H.replace(y,"::-webkit-input-$1")+H.replace(y,"::-moz-$1")+H.replace(y,":-ms-input-$1")+H}P=0}}return W+H+z}function a(e,t,a){var l=t.trim().split(_);t=l;var r=l.length,s=e.length;switch(s){case 0:case 1:var i=0;for(e=0===s?"":e[0]+" ";i<r;++i)t[i]=n(e,t[i],a).trim();break;default:var o=i=0;for(t=[];i<r;++i)for(var c=0;c<s;++c)t[o++]=n(e[c]+" ",l[i],a).trim()}return t}function n(e,t,a){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(f,"$1"+e.trim());case 58:return e.trim()+t.replace(f,"$1"+e.trim());default:if(0<1*a&&0<t.indexOf("\f"))return t.replace(f,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function l(e,t,a,n){var s=e+";",i=2*t+3*a+4*n;if(944===i){e=s.indexOf(":",9)+1;var o=s.substring(e,s.length-1).trim();return o=s.substring(0,e).trim()+o+";",1===I||2===I&&r(o,1)?"-webkit-"+o+o:o}if(0===I||2===I&&!r(s,1))return s;switch(i){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(S,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(o=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+o+s;case 1005:return p.test(s)?s.replace(d,":-webkit-")+s.replace(d,":-moz-")+s:s;case 1e3:switch(t=(o=s.substring(13).trim()).indexOf("-")+1,o.charCodeAt(0)+o.charCodeAt(t)){case 226:o=s.replace(b,"tb");break;case 232:o=s.replace(b,"tb-rl");break;case 220:o=s.replace(b,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+o+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(t=(s=e).length-10,i=(o=(33===s.charCodeAt(t)?s.substring(0,t):s).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|o.charCodeAt(7))){case 203:if(111>o.charCodeAt(8))break;case 115:s=s.replace(o,"-webkit-"+o)+";"+s;break;case 207:case 102:s=s.replace(o,"-webkit-"+(102<i?"inline-":"")+"box")+";"+s.replace(o,"-webkit-"+o)+";"+s.replace(o,"-ms-"+o+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return o=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+o+"-ms-flex-"+o+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(k,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(k,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===N.test(e))return 115===(o=e.substring(e.indexOf(":")+1)).charCodeAt(0)?l(e.replace("stretch","fill-available"),t,a,n).replace(":fill-available",":stretch"):s.replace(o,"-webkit-"+o)+s.replace(o,"-moz-"+o.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===a+n&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(g,"$1-webkit-$2")+s}return s}function r(e,t){var a=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?a:10);return a=e.substring(a+1,e.length-1),R(2!==t?n:n.replace(w,"$1"),a,t)}function s(e,t){var a=l(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return a!==t+";"?a.replace(A," or ($1)").substring(4):"("+t+")"}function i(e,t,a,n,l,r,s,i,o,m){for(var u,d=0,p=t;d<O;++d)switch(u=F[d].call(c,e,p,a,n,l,r,s,i,o,m)){case void 0:case!1:case!0:case null:break;default:p=u}if(p!==t)return p}function o(e){return void 0!==(e=e.prefix)&&(R=null,e?"function"!=typeof e?I=1:(I=2,R=e):I=0),o}function c(e,a){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<O){var l=i(-1,a,n,n,C,x,0,0,0,0);void 0!==l&&"string"==typeof l&&(a=l)}var r=t(T,n,a,0,0);return 0<O&&void 0!==(l=i(-2,r,n,n,C,x,r.length,0,0,0))&&(r=l),P=0,x=C=1,r}var m=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,p=/zoo|gra/,g=/([,: ])(transform)/g,_=/,\r+?/g,f=/([\t\r\n ])*\f?&/g,h=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,E=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,v=/\(\s*(.*)\s*\)/g,A=/([\s\S]*?);/g,k=/-self|flex-/g,w=/[^]*?(:[rp][el]a[\w-]+)[^]*/,N=/stretch|:\s*\w+\-(?:conte|avail)/,S=/([^-])(image-set\()/,x=1,C=1,P=0,I=1,T=[],F=[],O=0,R=null,D=0;return c.use=function e(t){switch(t){case void 0:case null:O=F.length=0;break;default:if("function"==typeof t)F[O++]=t;else if("object"==typeof t)for(var a=0,n=t.length;a<n;++a)e(t[a]);else D=0|!!t}return e},c.set=o,void 0!==e&&o(e),c},c={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function m(e){var t=Object.create(null);return function(a){return void 0===t[a]&&(t[a]=e(a)),t[a]}}var u=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,d=m(function(e){return u.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),p=a(35),g=a.n(p);function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}var f=function(e,t){for(var a=[e[0]],n=0,l=t.length;n<l;n+=1)a.push(t[n],e[n+1]);return a},h=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,n.typeOf)(e)},y=Object.freeze([]),E=Object.freeze({});function b(e){return"function"==typeof e}function v(e){return e.displayName||e.name||"Component"}function A(e){return e&&"string"==typeof e.styledComponentId}var k="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",w="5.3.11",N="undefined"!=typeof window&&"HTMLElement"in window,S=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&(void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),x={};function C(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(a.length>0?" Args: "+a.join(", "):""))}var P=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,a=0;a<e;a++)t+=this.groupSizes[a];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var a=this.groupSizes,n=a.length,l=n;e>=l;)(l<<=1)<0&&C(16,""+e);this.groupSizes=new Uint32Array(l),this.groupSizes.set(a),this.length=l;for(var r=n;r<l;r++)this.groupSizes[r]=0}for(var s=this.indexOfGroup(e+1),i=0,o=t.length;i<o;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],a=this.indexOfGroup(e),n=a+t;this.groupSizes[e]=0;for(var l=a;l<n;l++)this.tag.deleteRule(a)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var a=this.groupSizes[e],n=this.indexOfGroup(e),l=n+a,r=n;r<l;r++)t+=this.tag.getRule(r)+"/*!sc*/\n";return t},e}(),I=new Map,T=new Map,F=1,O=function(e){if(I.has(e))return I.get(e);for(;T.has(F);)F++;var t=F++;return I.set(e,t),T.set(t,e),t},R=function(e){return T.get(e)},D=function(e,t){t>=F&&(F=t+1),I.set(e,t),T.set(t,e)},q="style["+k+'][data-styled-version="5.3.11"]',M=new RegExp("^"+k+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(e,t,a){for(var n,l=a.split(","),r=0,s=l.length;r<s;r++)(n=l[r])&&e.registerName(t,n)},j=function(e,t){for(var a=(t.textContent||"").split("/*!sc*/\n"),n=[],l=0,r=a.length;l<r;l++){var s=a[l].trim();if(s){var i=s.match(M);if(i){var o=0|parseInt(i[1],10),c=i[2];0!==o&&(D(c,o),L(e,c,i[3]),e.getTag().insertRules(o,n)),n.length=0}else n.push(s)}}},B=function(){return a.nc},G=function(e){var t=document.head,a=e||t,n=document.createElement("style"),l=function(e){for(var t=e.childNodes,a=t.length;a>=0;a--){var n=t[a];if(n&&1===n.nodeType&&n.hasAttribute(k))return n}}(a),r=void 0!==l?l.nextSibling:null;n.setAttribute(k,"active"),n.setAttribute("data-styled-version","5.3.11");var s=B();return s&&n.setAttribute("nonce",s),a.insertBefore(n,r),n},U=function(){function e(e){var t=this.element=G(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,a=0,n=t.length;a<n;a++){var l=t[a];if(l.ownerNode===e)return l}C(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),H=function(){function e(e){var t=this.element=G(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var a=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(a,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),z=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),W=N,V={isServer:!N,useCSSOMInjection:!S},$=function(){function e(e,t,a){void 0===e&&(e=E),void 0===t&&(t={}),this.options=_({},V,{},e),this.gs=t,this.names=new Map(a),this.server=!!e.isServer,!this.server&&N&&W&&(W=!1,function(e){for(var t=document.querySelectorAll(q),a=0,n=t.length;a<n;a++){var l=t[a];l&&"active"!==l.getAttribute(k)&&(j(e,l),l.parentNode&&l.parentNode.removeChild(l))}}(this))}e.registerId=function(e){return O(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,a){return void 0===a&&(a=!0),new e(_({},this.options,{},t),this.gs,a&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(a=(t=this.options).isServer,n=t.useCSSOMInjection,l=t.target,e=a?new z(l):n?new U(l):new H(l),new P(e)));var e,t,a,n,l},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(O(e),this.names.has(e))this.names.get(e).add(t);else{var a=new Set;a.add(t),this.names.set(e,a)}},t.insertRules=function(e,t,a){this.registerName(e,t),this.getTag().insertRules(O(e),a)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(O(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),a=t.length,n="",l=0;l<a;l++){var r=R(l);if(void 0!==r){var s=e.names.get(r),i=t.getGroup(l);if(s&&i&&s.size){var o=k+".g"+l+'[id="'+r+'"]',c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+=e+",")}),n+=""+i+o+'{content:"'+c+'"}/*!sc*/\n'}}}return n}(this)},e}(),J=/(a)(d)/gi,Y=function(e){return String.fromCharCode(e+(e>25?39:97))};function Q(e){var t,a="";for(t=Math.abs(e);t>52;t=t/52|0)a=Y(t%52)+a;return(Y(t%52)+a).replace(J,"$1-$2")}var Z=function(e,t){for(var a=t.length;a;)e=33*e^t.charCodeAt(--a);return e},X=function(e){return Z(5381,e)};function K(e){for(var t=0;t<e.length;t+=1){var a=e[t];if(b(a)&&!A(a))return!1}return!0}var ee=X("5.3.11"),te=function(){function e(e,t,a){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===a||a.isStatic)&&K(e),this.componentId=t,this.baseHash=Z(ee,t),this.baseStyle=a,$.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,a){var n=this.componentId,l=[];if(this.baseStyle&&l.push(this.baseStyle.generateAndInjectStyles(e,t,a)),this.isStatic&&!a.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))l.push(this.staticRulesId);else{var r=be(this.rules,e,t,a).join(""),s=Q(Z(this.baseHash,r)>>>0);if(!t.hasNameForId(n,s)){var i=a(r,"."+s,void 0,n);t.insertRules(n,s,i)}l.push(s),this.staticRulesId=s}else{for(var o=this.rules.length,c=Z(this.baseHash,a.hash),m="",u=0;u<o;u++){var d=this.rules[u];if("string"==typeof d)m+=d;else if(d){var p=be(d,e,t,a),g=Array.isArray(p)?p.join(""):p;c=Z(c,g+u),m+=g}}if(m){var _=Q(c>>>0);if(!t.hasNameForId(n,_)){var f=a(m,"."+_,void 0,n);t.insertRules(n,_,f)}l.push(_)}}return l.join(" ")},e}(),ae=/^\s*\/\/.*$/gm,ne=[":","[",".","#"];function le(e){var t,a,n,l,r=void 0===e?E:e,s=r.options,i=void 0===s?E:s,c=r.plugins,m=void 0===c?y:c,u=new o(i),d=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(a,n,l,r,s,i,o,c,m,u){switch(a){case 1:if(0===m&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===c)return n+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(l[0]+n),"";default:return n+(0===u?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}(function(e){d.push(e)}),g=function(e,n,r){return 0===n&&-1!==ne.indexOf(r[a.length])||r.match(l)?e:"."+t};function _(e,r,s,i){void 0===i&&(i="&");var o=e.replace(ae,""),c=r&&s?s+" "+r+" { "+o+" }":o;return t=i,a=r,n=new RegExp("\\"+a+"\\b","g"),l=new RegExp("(\\"+a+"\\b){2,}"),u(s||!r?"":r,c)}return u.use([].concat(m,[function(e,t,l){2===e&&l.length&&l[0].lastIndexOf(a)>0&&(l[0]=l[0].replace(n,g))},p,function(e){if(-2===e){var t=d;return d=[],t}}])),_.hash=m.length?m.reduce(function(e,t){return t.name||C(15),Z(e,t.name)},5381).toString():"",_}var re=r().createContext(),se=re.Consumer,ie=r().createContext(),oe=(ie.Consumer,new $),ce=le();function me(){return(0,l.useContext)(re)||oe}function ue(){return(0,l.useContext)(ie)||ce}function de(e){var t=(0,l.useState)(e.stylisPlugins),a=t[0],n=t[1],s=me(),o=(0,l.useMemo)(function(){var t=s;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,l.useMemo)(function(){return le({options:{prefix:!e.disableVendorPrefixes},plugins:a})},[e.disableVendorPrefixes,a]);return(0,l.useEffect)(function(){i()(a,e.stylisPlugins)||n(e.stylisPlugins)},[e.stylisPlugins]),r().createElement(re.Provider,{value:o},r().createElement(ie.Provider,{value:c},e.children))}var pe=function(){function e(e,t){var a=this;this.inject=function(e,t){void 0===t&&(t=ce);var n=a.name+t.hash;e.hasNameForId(a.id,n)||e.insertRules(a.id,n,t(a.rules,n,"@keyframes"))},this.toString=function(){return C(12,String(a.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ce),this.name+e.hash},e}(),ge=/([A-Z])/,_e=/([A-Z])/g,fe=/^ms-/,he=function(e){return"-"+e.toLowerCase()};function ye(e){return ge.test(e)?e.replace(_e,he).replace(fe,"-ms-"):e}var Ee=function(e){return null==e||!1===e||""===e};function be(e,t,a,n){if(Array.isArray(e)){for(var l,r=[],s=0,i=e.length;s<i;s+=1)""!==(l=be(e[s],t,a,n))&&(Array.isArray(l)?r.push.apply(r,l):r.push(l));return r}return Ee(e)?"":A(e)?"."+e.styledComponentId:b(e)?"function"!=typeof(o=e)||o.prototype&&o.prototype.isReactComponent||!t?e:be(e(t),t,a,n):e instanceof pe?a?(e.inject(a,n),e.getName(n)):e:h(e)?function e(t,a){var n,l,r=[];for(var s in t)t.hasOwnProperty(s)&&!Ee(t[s])&&(Array.isArray(t[s])&&t[s].isCss||b(t[s])?r.push(ye(s)+":",t[s],";"):h(t[s])?r.push.apply(r,e(t[s],s)):r.push(ye(s)+": "+(n=s,(null==(l=t[s])||"boolean"==typeof l||""===l?"":"number"!=typeof l||0===l||n in c||n.startsWith("--")?String(l).trim():l+"px")+";")));return a?[a+" {"].concat(r,["}"]):r}(e):e.toString();var o}var ve=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ae(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return b(e)||h(e)?ve(be(f(y,[e].concat(a)))):0===a.length&&1===e.length&&"string"==typeof e[0]?e:ve(be(f(e,a)))}new Set;var ke=function(e,t,a){return void 0===a&&(a=E),e.theme!==a.theme&&e.theme||t||a.theme},we=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ne=/(^-|-$)/g;function Se(e){return e.replace(we,"-").replace(Ne,"")}var xe=function(e){return Q(X(e)>>>0)};function Ce(e){return"string"==typeof e&&!0}var Pe=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ie=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Te(e,t,a){var n=e[a];Pe(t)&&Pe(n)?Fe(n,t):e[a]=t}function Fe(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];for(var l=0,r=a;l<r.length;l++){var s=r[l];if(Pe(s))for(var i in s)Ie(i)&&Te(e,s[i],i)}return e}var Oe=r().createContext(),Re=Oe.Consumer;function De(e){var t=(0,l.useContext)(Oe),a=(0,l.useMemo)(function(){return function(e,t){return e?b(e)?e(t):Array.isArray(e)||"object"!=typeof e?C(8):t?_({},t,{},e):e:C(14)}(e.theme,t)},[e.theme,t]);return e.children?r().createElement(Oe.Provider,{value:a},e.children):null}var qe={};function Me(e,t,a){var n=A(e),s=!Ce(e),i=t.attrs,o=void 0===i?y:i,c=t.componentId,m=void 0===c?function(e,t){var a="string"!=typeof e?"sc":Se(e);qe[a]=(qe[a]||0)+1;var n=a+"-"+xe("5.3.11"+a+qe[a]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):c,u=t.displayName,p=void 0===u?function(e){return Ce(e)?"styled."+e:"Styled("+v(e)+")"}(e):u,f=t.displayName&&t.componentId?Se(t.displayName)+"-"+t.componentId:t.componentId||m,h=n&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,k=t.shouldForwardProp;n&&e.shouldForwardProp&&(k=t.shouldForwardProp?function(a,n,l){return e.shouldForwardProp(a,n,l)&&t.shouldForwardProp(a,n,l)}:e.shouldForwardProp);var w,N=new te(a,f,n?e.componentStyle:void 0),S=N.isStatic&&0===o.length,x=function(e,t){return function(e,t,a,n){var r=e.attrs,s=e.componentStyle,i=e.defaultProps,o=e.foldedComponentIds,c=e.shouldForwardProp,m=e.styledComponentId,u=e.target,p=function(e,t,a){void 0===e&&(e=E);var n=_({},t,{theme:e}),l={};return a.forEach(function(e){var t,a,r,s=e;for(t in b(s)&&(s=s(n)),s)n[t]=l[t]="className"===t?(a=l[t],r=s[t],a&&r?a+" "+r:a||r):s[t]}),[n,l]}(ke(t,(0,l.useContext)(Oe),i)||E,t,r),g=p[0],f=p[1],h=function(e,t,a){var n=me(),l=ue();return t?e.generateAndInjectStyles(E,n,l):e.generateAndInjectStyles(a,n,l)}(s,n,g),y=a,v=f.$as||t.$as||f.as||t.as||u,A=Ce(v),k=f!==t?_({},t,{},f):t,w={};for(var N in k)"$"!==N[0]&&"as"!==N&&("forwardedAs"===N?w.as=k[N]:(c?c(N,d,v):!A||d(N))&&(w[N]=k[N]));return t.style&&f.style!==t.style&&(w.style=_({},t.style,{},f.style)),w.className=Array.prototype.concat(o,m,h!==m?h:null,t.className,f.className).filter(Boolean).join(" "),w.ref=y,(0,l.createElement)(v,w)}(w,e,t,S)};return x.displayName=p,(w=r().forwardRef(x)).attrs=h,w.componentStyle=N,w.displayName=p,w.shouldForwardProp=k,w.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):y,w.styledComponentId=f,w.target=n?e.target:e,w.withComponent=function(e){var n=t.componentId,l=function(e,t){if(null==e)return{};var a,n,l={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(l[a]=e[a]);return l}(t,["componentId"]),r=n&&n+"-"+(Ce(e)?e:Se(v(e)));return Me(e,_({},l,{attrs:h,componentId:r}),a)},Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=n?Fe({},e.defaultProps,t):t}}),Object.defineProperty(w,"toString",{value:function(){return"."+w.styledComponentId}}),s&&g()(w,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),w}var Le=function(e){return function e(t,a,l){if(void 0===l&&(l=E),!(0,n.isValidElementType)(a))return C(1,String(a));var r=function(){return t(a,l,Ae.apply(void 0,arguments))};return r.withConfig=function(n){return e(t,a,_({},l,{},n))},r.attrs=function(n){return e(t,a,_({},l,{attrs:Array.prototype.concat(l.attrs,n).filter(Boolean)}))},r}(Me,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Le[e]=Le(e)});var je=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=K(e),$.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,a,n){var l=n(be(this.rules,t,a,n).join(""),""),r=this.componentId+e;a.insertRules(r,r,l)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,a,n){e>2&&$.registerId(this.componentId+e),this.removeStyles(e,a),this.createStyles(e,t,a,n)},e}();function Be(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];var s=Ae.apply(void 0,[e].concat(a)),i="sc-global-"+xe(JSON.stringify(s)),o=new je(s,i);function c(e){var t=me(),a=ue(),n=(0,l.useContext)(Oe),r=(0,l.useRef)(t.allocateGSInstance(i)).current;return t.server&&m(r,e,t,n,a),(0,l.useLayoutEffect)(function(){if(!t.server)return m(r,e,t,n,a),function(){return o.removeStyles(r,t)}},[r,e,t,n,a]),null}function m(e,t,a,n,l){if(o.isStatic)o.renderStyles(e,x,a,l);else{var r=_({},t,{theme:ke(t,n,c.defaultProps)});o.renderStyles(e,r,a,l)}}return r().memo(c)}function Ge(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];var l=Ae.apply(void 0,[e].concat(a)).join(""),r=xe(l);return new pe(r,l)}var Ue=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var a=B();return"<style "+[a&&'nonce="'+a+'"',k+'="true"','data-styled-version="5.3.11"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?C(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return C(2);var a=((t={})[k]="",t["data-styled-version"]="5.3.11",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=B();return n&&(a.nonce=n),[r().createElement("style",_({},a,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new $({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?C(2):r().createElement(de,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return C(3)},e}(),He=function(e){var t=r().forwardRef(function(t,a){var n=(0,l.useContext)(Oe),s=e.defaultProps,i=ke(t,n,s);return r().createElement(e,_({},t,{theme:i,ref:a}))});return g()(t,e),t.displayName="WithTheme("+v(e)+")",t},ze=function(){return(0,l.useContext)(Oe)},We={StyleSheet:$,masterSheet:oe};const Ve=Le},670:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(l,r){function s(e){try{o(n.next(e))}catch(e){r(e)}}function i(e){try{o(n.throw(e))}catch(e){r(e)}}function o(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,i)}o((n=n.apply(e,t||[])).next())})},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getStars=t.WordpressIcon=t.ImagePlaceholder=t.getWordPressDirectoryURL=t.getLastUpdate=t.LABELS=t.apiFetch=void 0;const r=l(a(609)),s=a(723),i=l(a(455));t.apiFetch=function(e){return n(this,void 0,void 0,function*(){return yield(0,i.default)(e).then(e=>{if(e.code)throw new Error(`${e.code}: ${(null==e?void 0:e.message)||"Unknown"}`);return e}).catch(e=>{throw new Error(JSON.stringify(e))})})},t.LABELS={install:(0,s.__)("Install","wp-plugin-suggestions"),inactive:(0,s.__)("Active","wp-plugin-suggestions"),active:(0,s.__)("Active","wp-plugin-suggestions")},t.getLastUpdate=function(e){const t=new Date(e.split(" ")[0]),a=(new Date).getTime()-t.getTime(),n=Math.floor(a/864e5),l=parseInt(n.toString());return 0===l?(0,s.__)("Today","wp-plugin-suggestions"):l>30?(0,s.sprintf)((0,s.__)("%s Months Ago","wp-plugin-suggestions"),parseInt(Math.floor(l/30).toString())):(0,s.sprintf)((0,s.__)("%s Days Ago","wp-plugin-suggestions"),l)},t.getWordPressDirectoryURL=e=>`https://wordpress.org/plugin/${e}`,t.ImagePlaceholder="data:image/jpeg;base64, ",t.WordpressIcon=r.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},r.default.createElement("path",{fill:"currentColor",d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10s10-4.49 10-10S17.51 2 12 2zM3.01 12c0-1.3.28-2.54.78-3.66l4.29 11.75c-3-1.46-5.07-4.53-5.07-8.09zM12 20.99c-.88 0-1.73-.13-2.54-.37l2.7-7.84l2.76 7.57c.02.04.04.09.06.12c-.93.34-1.93.52-2.98.52zm1.24-13.21c.54-.03 1.03-.09 1.03-.09c.48-.06.43-.77-.06-.74c0 0-1.46.11-2.4.11c-.88 0-2.37-.11-2.37-.11c-.48-.02-.54.72-.05.75c0 0 .46.06.94.09l1.4 3.84l-1.97 5.9l-3.27-9.75c.54-.02 1.03-.08 1.03-.08c.48-.06.43-.77-.06-.74c0 0-1.46.11-2.4.11c-.17 0-.37 0-.58-.01C6.1 4.62 8.86 3.01 12 3.01c2.34 0 4.47.89 6.07 2.36c-.04 0-.08-.01-.12-.01c-.88 0-1.51.77-1.51 1.6c0 .74.43 1.37.88 2.11c.34.6.74 1.37.74 2.48c0 .77-.3 1.66-.68 2.91l-.9 3l-3.24-9.68zm6.65-.09a8.988 8.988 0 0 1-3.37 12.08l2.75-7.94c.51-1.28.68-2.31.68-3.22c0-.33-.02-.64-.06-.92z"})),t.getStars=e=>{const t=Math.floor(e/20),a=e%20>=10?1:0;return{fullStars:t,halfStars:a,emptyStars:5-t-a}}},692:e=>{"use strict";e.exports=window.wp.notices},702:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(l,r){function s(e){try{o(n.next(e))}catch(e){r(e)}}function i(e){try{o(n.throw(e))}catch(e){r(e)}}function o(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,i)}o((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWordPressPlugins=t.fetchSitePlugins=t.activateSitePlugin=t.installWordPressPlugin=t.setSitePlugins=t.setWordPressPlugins=void 0;const l=a(723),r=a(692),s=a(640);t.setWordPressPlugins=e=>({type:"SET_WORDPRESS_PLUGINS",payload:e}),t.setSitePlugins=e=>({type:"SET_SITE_PLUGINS",payload:e}),t.installWordPressPlugin=e=>({registry:t,dispatch:a,select:i})=>n(void 0,void 0,void 0,function*(){const n=i.getSitePlugins(),o=yield(0,s.apiFetch)({method:"POST",path:"wp/v2/plugins",data:{slug:e,status:"inactive"}});if(!(null==o?void 0:o.author))return t.dispatch(r.store).createErrorNotice((0,l.sprintf)((0,l.__)("%s: %s"),"Something","wrong"),{type:"snackbar"}),{name:e,status:"install"};const c={name:o.plugin.split("/")[1],status:o.status,url:o._links.self[0].href};return n.push(c),a.setSitePlugins(n),c}),t.activateSitePlugin=e=>({registry:t,dispatch:a,select:l})=>n(void 0,void 0,void 0,function*(){const t=l.getSitePlugins(),n=t.find(t=>t.name===e);if(!(null==n?void 0:n.url))return{name:e,status:"install"};const{url:r}=n,i=yield(0,s.apiFetch)({method:"PUT",url:r,data:{status:"active"}}),o={name:i.plugin.split("/")[1],status:i.status,url:i._links.self[0].href};return a.setSitePlugins(t.map(e=>e.name==o.name?o:e)),o}),t.fetchSitePlugins=()=>n(void 0,void 0,void 0,function*(){return(yield(0,s.apiFetch)({method:"GET",path:"wp/v2/plugins"})).map(e=>({name:e.plugin.split("/")[0],status:e.status,url:e._links.self[0].href}))}),t.fetchWordPressPlugins=e=>n(void 0,void 0,void 0,function*(){const t=`https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[author]=${e}`,a=yield fetch(t);return yield a.json()})},723:e=>{"use strict";e.exports=window.wp.i18n},736:(e,t,a)=>{e.exports=a(186)()},807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSitePlugins=t.getWordPressPlugins=void 0,t.getWordPressPlugins=e=>e.wordpressPlugins,t.getSitePlugins=(e,t)=>t?e.sitePlugins.find(({name:e})=>e===t):e.sitePlugins},843:(e,t)=>{"use strict";var a="function"==typeof Symbol&&Symbol.for,n=a?Symbol.for("react.element"):60103,l=a?Symbol.for("react.portal"):60106,r=a?Symbol.for("react.fragment"):60107,s=a?Symbol.for("react.strict_mode"):60108,i=a?Symbol.for("react.profiler"):60114,o=a?Symbol.for("react.provider"):60109,c=a?Symbol.for("react.context"):60110,m=a?Symbol.for("react.async_mode"):60111,u=a?Symbol.for("react.concurrent_mode"):60111,d=a?Symbol.for("react.forward_ref"):60112,p=a?Symbol.for("react.suspense"):60113,g=a?Symbol.for("react.suspense_list"):60120,_=a?Symbol.for("react.memo"):60115,f=a?Symbol.for("react.lazy"):60116,h=a?Symbol.for("react.block"):60121,y=a?Symbol.for("react.fundamental"):60117,E=a?Symbol.for("react.responder"):60118,b=a?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case m:case u:case r:case i:case s:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case f:case _:case o:return e;default:return t}}case l:return t}}}function A(e){return v(e)===u}t.AsyncMode=m,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=o,t.Element=n,t.ForwardRef=d,t.Fragment=r,t.Lazy=f,t.Memo=_,t.Portal=l,t.Profiler=i,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return A(e)||v(e)===m},t.isConcurrentMode=A,t.isContextConsumer=function(e){return v(e)===c},t.isContextProvider=function(e){return v(e)===o},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===d},t.isFragment=function(e){return v(e)===r},t.isLazy=function(e){return v(e)===f},t.isMemo=function(e){return v(e)===_},t.isPortal=function(e){return v(e)===l},t.isProfiler=function(e){return v(e)===i},t.isStrictMode=function(e){return v(e)===s},t.isSuspense=function(e){return v(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===i||e===s||e===p||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===_||e.$$typeof===o||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.$$typeof===E||e.$$typeof===b||e.$$typeof===h)},t.typeOf=v},855:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0;var l=a(218);Object.defineProperty(t,"List",{enumerable:!0,get:function(){return n(l).default}})},885:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sitePlugins=t.wordpressPlugins=void 0;const n=a(143),l=a(119);function r(e=l.INITIAL_STATE.wordpressPlugins,t){return"SET_WORDPRESS_PLUGINS"===t.type?t.payload:e}function s(e=l.INITIAL_STATE.sitePlugins,t){return"SET_SITE_PLUGINS"===t.type?t.payload:e}t.wordpressPlugins=r,t.sitePlugins=s,t.default=(0,n.combineReducers)({wordpressPlugins:r,sitePlugins:s})},945:e=>{e.exports=function(e,t,a,n){var l=a?a.call(n,e,t):void 0;if(void 0!==l)return!!l;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),o=0;o<r.length;o++){var c=r[o];if(!i(c))return!1;var m=e[c],u=t[c];if(!1===(l=a?a.call(n,m,u,c):void 0)||void 0===l&&m!==u)return!1}return!0}},956:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))(function(l,r){function s(e){try{o(n.next(e))}catch(e){r(e)}}function i(e){try{o(n.throw(e))}catch(e){r(e)}}function o(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,i)}o((n=n.apply(e,t||[])).next())})},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=a(723),s=l(a(665)),i=l(a(609)),o=a(87),c=a(362),m=a(670),u=s.default.div`
	width: calc( ( 100% / ${e=>e.columns} ) - 20px );
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	@media ( min-width: 100rem ) {
		img {
			position: ${e=>3===e.columns?"initial":"absolute"} !important;
		}

		div.column-name {
			margin: ${e=>3===e.columns?"0px":"148px"} !important;
		}
	}
	@media ( max-width: 100rem ) {
		width: calc( ( 100% / 2 ) - 20px );
	}
	@media ( max-width: 48.9375rem ) {
		width: calc( ( 100% / 1 ) - 20px );
	}
	h3 {
		margin: 0 12px 12px 0;
	}
	img {
		width: 128px;
	}
`;t.default=({author:e,author_profile:t,name:a=(0,r.__)("No name availabe","wp-plugin-suggestions"),slug:l="",placeholder:s=m.ImagePlaceholder,icons:d,homepage:p,short_description:g=(0,r.__)("No description availabe","wp-plugin-suggestions"),rating:_=0,num_ratings:f=0,active_installs:h=0,pluginStatus:y="install",installWordPressPlugin:E,activateSitePlugin:b,tested:v,last_updated:A,ShowName:k=!0,ShowLinks:w=!0,ShowDescription:N=!0,ShowCardFooter:S=!0,ShowRating:x=!0,ShowUpdated:C=!0,ShowDownloaded:P=!0,ShowCompatibility:I=!0,columns:T=3})=>{var F;const[O,R]=(0,o.useState)(y),[D,q]=(0,o.useState)(!1),{fullStars:M,halfStars:L,emptyStars:j}=(0,m.getStars)(_),B=e.replace(/<\/?a[^>]*>/g,"");return(0,o.useEffect)(()=>{R(y)},[y]),i.default.createElement(u,{className:"plugin-card",columns:3},i.default.createElement("div",{className:"plugin-card-top"},i.default.createElement("div",{className:"name column-name"},i.default.createElement("img",{src:null!==(F=(null==d?void 0:d.default)||(null==d?void 0:d["1x"])||(null==d?void 0:d["2x"]))&&void 0!==F?F:s,className:"plugin-icon",alt:a}),k&&i.default.createElement("h3",null,a),N&&i.default.createElement("div",null,i.default.createElement("p",null,g),i.default.createElement("p",{className:"authors"},i.default.createElement("cite",null,(0,r.__)("By","wp-plugin-suggestions")," ",i.default.createElement("a",{target:"_blank",href:p||t,rel:"noreferrer"},B))))),w&&i.default.createElement("div",{className:"action-links"},i.default.createElement("ul",{className:"plugin-action-buttons"},i.default.createElement("li",null,D?i.default.createElement(c.Spinner,null):i.default.createElement("button",{disabled:"active"===O,className:"button button-primary",onClick:e=>{e.preventDefault(),n(void 0,void 0,void 0,function*(){if("active"!==O){if(q(!0),"install"===O){const e=yield E(l);R(e.status)}else{const e=yield b(l);R(e.status)}q(!1)}})},"aria-label":(0,r.sprintf)((0,r.__)("Install %s","wp-plugin-suggestions"),a)},m.LABELS[O])),i.default.createElement("li",null,i.default.createElement("a",{href:`https://wordpress.org/plugins/${l}`,"aria-label":(0,r.sprintf)((0,r.__)("More info %s","wp-plugin-suggestions"),a),target:"_blank",rel:"noreferrer"},(0,r.__)("More Details","wp-plugin-suggestions")))))),S&&i.default.createElement("div",{className:"plugin-card-bottom"},x&&i.default.createElement("div",{className:"vers column-rating"},i.default.createElement("div",{className:"star-rating"},i.default.createElement("span",{className:"screen-reader-text"},(0,r.sprintf)((0,r.__)("5.0 rating based on %s ratings","wp-plugin-suggestions"),f)),Array.from({length:M},(e,t)=>i.default.createElement("div",{key:`full_star_${t}`,className:"star star-full","aria-hidden":"true"})),Array.from({length:L},(e,t)=>i.default.createElement("div",{key:`half_star_${t}`,className:"star star-half","aria-hidden":"true"})),Array.from({length:j},(e,t)=>i.default.createElement("div",{key:`empty_star_${t}`,className:"star star-empty","aria-hidden":"true"}))),i.default.createElement("span",{className:"num-ratings","aria-hidden":"true"},"(",f,")")),C&&i.default.createElement("div",{className:"column-updated"},i.default.createElement("strong",null,(0,r.sprintf)((0,r.__)("Last Updated: %s","wp-plugin-suggestions"),(0,m.getLastUpdate)(A)))),P&&i.default.createElement("div",{className:"column-downloaded"},h.toLocaleString("ARG"),"+"," ",(0,r.__)("Active Installations","wp-plugin-suggestions")),I&&i.default.createElement("div",{className:"column-compatibility"},i.default.createElement("span",{className:"compatibility-compatible"},i.default.createElement("strong",null,(0,r.__)("Compatible","wp-plugin-suggestions")),(0,r.sprintf)((0,r.__)(" with the version %s","wp-plugin-suggestions"),v)))))}},959:(e,t,a)=>{"use strict";e.exports=a(843)},985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function a(n){var l=t[n];if(void 0!==l)return l.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var n={};(()=>{"use strict";a.r(n),a.d(n,{App:()=>pa,AppProvider:()=>ma,AppStructure:()=>da,AppTabSwitcher:()=>ua,Header:()=>x,Nav:()=>I,QLIGG_BUSSINESS_LINK:()=>y,QLIGG_DEVELOPER:()=>h,QLIGG_DOMAIN:()=>d,QLIGG_GROUP_URL:()=>f,QLIGG_MODELS_FEED:()=>b,QLIGG_MODELS_SETTING:()=>v,QLIGG_PERSONAL_LINK:()=>E,QLIGG_PLUGIN_DIR:()=>u,QLIGG_PLUGIN_FILE:()=>m,QLIGG_PLUGIN_NAME:()=>o,QLIGG_PLUGIN_VERSION:()=>c,QLIGG_PREFIX:()=>p,QLIGG_REVIEW_URL:()=>_,QLIGG_WORDPRESS_URL:()=>g,Spinner:()=>mt,Table:()=>ut,copyInClipboard:()=>k,deepMerge:()=>S,getPluginURL:()=>A,onDocumentLoaded:()=>N,useAppSlotContext:()=>R});var e=a(609),t=a(87);const l=window.wp.editor;var r=a(723);const s=window.wp.hooks,i=window.lodash,o=qligg_backend.QLIGG_PLUGIN_NAME,c=qligg_backend.QLIGG_PLUGIN_VERSION,m=qligg_backend.QLIGG_PLUGIN_FILE,u=qligg_backend.QLIGG_PLUGIN_DIR,d=qligg_backend.QLIGG_DOMAIN,p=qligg_backend.QLIGG_PREFIX,g=qligg_backend.QLIGG_WORDPRESS_URL,_=qligg_backend.QLIGG_REVIEW_URL,f=qligg_backend.QLIGG_GROUP_URL,h=qligg_backend.QLIGG_DEVELOPER,y=qligg_backend.QLIGG_BUSSINESS_LINK,E=qligg_backend.QLIGG_PERSONAL_LINK,b=qligg_backend.QLIGG_MODELS_FEED,v=qligg_backend.QLIGG_MODELS_SETTING;function A(e){return qligg_backend.plugin_url+e}function k(e){return navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(function(){return!0},function(){return w(e)}):w(e)}function w(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch(e){return console.error("Fallback: Oops, unable to copy",e),!1}finally{document.body.remove}}const N=e=>{/comp|inter|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e,!1)};function S(e,t){const a={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach(n=>{e.hasOwnProperty(n)&&t.hasOwnProperty(n)?(0,i.isObject)(e[n])&&!Array.isArray(e[n])?a[n]=S(e[n],t[n]):a[n]=t[n]:e.hasOwnProperty(n)?a[n]=e[n]:t.hasOwnProperty(n)&&(a[n]=t[n])}),a}const x=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)("h1",null,o),(0,e.createElement)("p",{className:"about-text"},(0,r.sprintf)((0,r.__)("Thanks for using %s! We will do our best to offer you the best and improved communication experience with your users."),o)),(0,e.createElement)("p",{className:"about-text"},(0,e.createElement)("a",{href:"https://quadlayers.com/products/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_header&utm_campaign=premium_upgrade&utm_content=premium_link",target:"__blank"},(0,r.__)("Premium","insta-gallery")),"|",(0,e.createElement)("a",{href:"https://quadlayers.com/demo/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_header&utm_campaign=demo&utm_content=demo_link",target:"__blank"},(0,r.__)("Demo","insta-gallery")),"|",(0,e.createElement)("a",{href:"https://quadlayers.com/documentation/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_header&utm_campaign=documentation&utm_content=documentation_link",target:"__blank"},(0,r.__)("Documentation","insta-gallery")),"|",(0,e.createElement)("a",{href:"https://quadlayers.com/documentation/instagram-feed-gallery/api/business/?utm_source=qligg_plugin&utm_medium=admin_header&utm_campaign=documentation&utm_content=professional_link",target:"__blank"},(0,r.__)("Professional","insta-gallery"))),(0,e.createElement)("a",{href:"https://quadlayers.com/?utm_source=qligg_plugin&utm_medium=admin_header&utm_campaign=branding&utm_content=header_logo",target:"_blank",rel:"noreferrer"},(0,e.createElement)("div",{style:{backgroundImage:`url(${A("/assets/backend/img/quadlayers.jpg")})`},className:"wp-badge quadlayers__logo"},"QuadLayers"))));var C=a(500),P=a.n(C);const I=function(){const{currentTab:a,setCurrentTab:n,tabs:l}=oa();return(0,t.useEffect)(()=>{(e=>{const t=Array.from(document.querySelector("#toplevel_page_qligg_backend .wp-submenu").children),a=e[0].toUpperCase()+e.slice(1).toLowerCase();t.forEach(e=>{e.innerText.trim()===a?e.classList.add("current"):e.classList.remove("current")})})(a)},[a]),(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)("ul",{className:"nav-tab-wrapper"},l.map(({label:t,name:l},r)=>(0,e.createElement)("li",{key:r,className:"nav-tab-li",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(l)}},(0,e.createElement)("a",{href:"#",className:P()("nav-tab",a===l&&"nav-tab-active"),onClick:e=>{e.preventDefault()}},t)))))},T=window.wp.components,F=window.wp.compose,O=(0,t.createContext)({Slot:{Header:({children:e})=>e||null,Footer:({children:e})=>e||null,Content:({children:e})=>e||null,Aside:({children:e})=>e||null,Navigation:({children:e})=>e||null},Fill:{Header:({children:e})=>e||null,Footer:({children:e})=>e||null,Content:({children:e})=>e||null,Aside:({children:e})=>e||null,Navigation:({children:e})=>e||null}}),R=()=>(0,t.useContext)(O),D=a=>{const n=(0,t.useRef)(),{children:l}=a,r=`insta-gallery.admin.Control.Slot.${(0,F.useInstanceId)(D)}`,s={},i={},{Fill:o,Slot:c}=(0,t.useCallback)((0,T.createSlotFill)(`${r}.header`),[r]),{Fill:m,Slot:u}=(0,t.useCallback)((0,T.createSlotFill)(`${r}.navigation`),[r]),{Fill:d,Slot:p}=(0,t.useCallback)((0,T.createSlotFill)(`${r}content`),[r]),{Fill:g,Slot:_}=(0,t.useCallback)((0,T.createSlotFill)(`${r}.aside`),[r]),{Fill:f,Slot:h}=(0,t.useCallback)((0,T.createSlotFill)(`${r}.footer`),[r]);return s.Header=c,i.Header=o,s.Navigation=u,i.Navigation=m,s.Content=p,i.Content=d,s.Aside=_,i.Aside=g,s.Footer=h,i.Footer=f,(0,e.createElement)(T.SlotFillProvider,null,(0,e.createElement)(O.Provider,{value:{Slot:s,Fill:i,containerRef:n}},l))},q=O.Consumer,M=({isSecondary:t,href:a,title:n,target:l="_self",tagName:r="a",className:s,children:i})=>{const o=r;return(0,e.createElement)(o,{className:P()("insta-gallery__button",t&&"insta-gallery__button--secondary",s),href:a,target:l,title:n},i)},L=()=>(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)("div",{className:"has-2-columns is-wider-left"},(0,e.createElement)("div",{className:"column"},(0,e.createElement)("div",{className:"welcome-header"},(0,e.createElement)("h1",null,o,(0,e.createElement)("span",{style:{fontSize:"24px",color:"#555"}},"v",c)),(0,e.createElement)("div",{className:"about-text"},(0,e.createElement)("p",null,sprintf((0,r.__)("Hi! We are Quadlayers, we are expanding our products portfolio, according to social trends!  So… enjoy our first version of %s. We are developing new features","insta-gallery"),o)))),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Premium","insta-gallery")),(0,e.createElement)("p",null,sprintf((0,r.__)("Thank you for choosing our %s plugin for WordPress! Here you can see our demo and test the features we offer in the premium version.","insta-gallery"),o)),(0,e.createElement)(M,{href:"https://quadlayers.com/products/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=premium_upgrade&utm_content=purchase_button",target:"_blank"},(0,r.__)("Purchase Now","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Demo","insta-gallery")),(0,e.createElement)("p",null,sprintf((0,r.__)("Thank you for choosing our %s plugin for WordPress! Here you can see our demo and test the features we offer in the premium version.","insta-gallery"),o)),(0,e.createElement)(M,{isSecondary:!0,href:"https://quadlayers.com/demo/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=demo&utm_content=demo_button",target:"_blank"},(0,r.__)("View demo","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Support","insta-gallery")),(0,e.createElement)("p",null,sprintf((0,r.__)("If you have any doubt or you find any issue don't hesitate to contact us through our ticket system or join our community to meet other %s users.","insta-gallery"),o)),(0,e.createElement)(M,{isSecondary:!0,href:"https://quadlayers.com/account/support/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=support&utm_content=support_button",target:"_blank"},(0,r.__)("Submit ticket","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Community","insta-gallery")),(0,e.createElement)("p",null,sprintf((0,r.__)("If you want to get in touch with other %s users or be aware of our promotional discounts join our community now.","insta-gallery"),o)),(0,e.createElement)(M,{isSecondary:!0,href:f,target:"_blank"},(0,r.__)("Join our community","insta-gallery")))),(0,e.createElement)("div",{className:"column"},(0,e.createElement)("img",{src:A("/assets/backend/img/mobile.png")})))),j=()=>{const{Fill:t}=R();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(t.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(t.Content,null,(0,e.createElement)(L,null)))},B=window.qligg.store,G=({title:a,show:n,onClose:l,children:r,className:s,__experimentalHideHeader:i=!1})=>{const o=(0,t.useRef)();return(0,t.useEffect)(()=>{const e=e=>{n&&o?.current&&o.current===e.target&&l(e)};return o?.current?.addEventListener("click",e),()=>{o?.current?.removeEventListener("click",e)}},[o,n]),n?(0,e.createElement)(T.Modal,{ref:o,title:a,onRequestClose:l,shouldCloseOnClickOutside:!1,className:P()("insta-gallery__modal media-modal wp-core-ui upload-php",s),__experimentalHideHeader:i},r):null},U=(0,t.createContext)({}),H=()=>(0,t.useContext)(U),z=(e,t)=>{switch(t.type){case"SET_CURRENT_FEED_INDEX":case"SET_IS_OPEN":case"SET_COUNTER":return{...e,...t.payload}}},W=a=>{const{children:n}=a,[l,r]=(0,t.useReducer)(z,{currentFeedIndex:0,isOpen:!1,isImageLoad:!1,counter:0});return(0,e.createElement)(U.Provider,{value:{...l,setCurrentFeedIndex:e=>{l.currentFeedIndex!=e&&r({type:"SET_CURRENT_FEED_INDEX",payload:{currentFeedIndex:e}})},setIsOpen:e=>{l.isOpen!=e&&r({type:"SET_IS_OPEN",payload:{isOpen:e}})},setCounter:e=>{l.counter!=e&&r({type:"SET_COUNTER",payload:{counter:e}})}}},n)};async function V({url:e,data:t,method:a}){if(!e)throw new Error(`Empty url: ${e}`);return await fetch(e,{body:JSON.stringify(t),method:a}).then(e=>e.json()).then(e=>{if(e.code)throw new Error(`${e.code}: ${e?.message||"Unknown"}`);return e}).catch(e=>{throw new Error(e)})}function $(e,t){const a=[];for(const n in e)if(e.hasOwnProperty(n)){const l=t?t+"["+n+"]":n,r=e[n];a.push(null!==r&&"object"==typeof r?$(r,l):encodeURIComponent(l)+"="+encodeURIComponent(r))}return a.join("&")}U.Consumer;const J=({href:t,className:a,children:n,onClick:l,disabled:r})=>(0,e.createElement)("a",{href:t,target:"blank",onClick:l,className:P()("instagram-gallery__button",a,r&&"instagram-gallery__button--disabled")},n);function Y(e,t){const{tag:a,source:n}=e,l=t?.username;switch(n){case"username":return`https://www.instagram.com/${l}`;case"tag":return`https://www.instagram.com/explore/tags/${a}`;default:return"https://www.instagram.com"}}const Q=({userProfile:t,feedSettings:a,onClick:n,after:l})=>{const r=!!a?.button?.display,s=!!a?.button_load?.display;return(0,e.createElement)("div",{className:"instagram-gallery__actions"},r&&(0,e.createElement)(J,{feedSettings:a,href:Y(a,t),target:"blank",className:"instagram-gallery__button--follow"},(0,e.createElement)("i",{className:"qligg-icon-instagram "}),a.button.text),s&&(0,e.createElement)(J,{feedSettings:a,className:"instagram-gallery__button--load",disabled:""===l,onClick:n},a.button_load.text))},Z=()=>{const t=window?.qligg_frontend?.settings?.spinner_image_url;return(0,e.createElement)("div",{className:"instagram-gallery__spinner",style:t?{backgroundImage:`url(${t})`}:{}})},X=({errorUserProfile:t,errorUserMediaList:a})=>(0,e.createElement)("div",{className:"instagram-gallery__alert"},(0,e.createElement)("ul",null,t&&(0,e.createElement)("li",null,(0,e.createElement)("b",null,t.error),(0,e.createElement)("p",null,t.message)),a&&(0,e.createElement)("li",null,(0,e.createElement)("b",null,a.error),(0,e.createElement)("p",null,a.message)))),K=(0,t.memo)(({feedSettings:a,userProfile:n})=>{const l={...n,...function(e){const t={};for(const a in e)e.hasOwnProperty(a)&&""!==e[a]&&(t[a]=e[a]);return t}(a.profile)};return!!a?.profile?.display&&(0,e.createElement)("div",{className:"instagram-gallery__profile"},(0,e.createElement)("div",{className:"avatar"},(0,e.createElement)("img",{src:l.avatar||"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g",alt:l.nickname})),(0,e.createElement)("div",{className:"info"},(0,e.createElement)("div",null,(0,e.createElement)("span",{className:"user"},"@",l.username),l.nickname&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("span",{className:"user"},l.nickname)),(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("a",{className:"follow",href:l.link,target:"_blank",rel:"noopener noreferrer"},l.link_text),!!l.website&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("span",{className:"separator"},"•"),(0,e.createElement)("a",{className:"follow",href:l.website,target:"_blank",rel:"noopener noreferrer"},l.website_text)),(0,e.createElement)("div",{className:"description"},l.biography))))});var ee,te,ae,ne,le,re,se,ie,oe,ce,me,ue={},de=[],pe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ge=Array.isArray;function _e(e,t){for(var a in t)e[a]=t[a];return e}function fe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function he(e,t,a,n,l){var r={type:e,props:t,key:a,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==l?++ae:l,__i:-1,__u:0};return null==l&&null!=te.vnode&&te.vnode(r),r}function ye(e){return e.children}function Ee(e,t){this.props=e,this.context=t}function be(e,t){if(null==t)return e.__?be(e.__,e.__i+1):null;for(var a;t<e.__k.length;t++)if(null!=(a=e.__k[t])&&null!=a.__e)return a.__e;return"function"==typeof e.type?be(e):null}function ve(e){var t,a;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(a=e.__k[t])&&null!=a.__e){e.__e=e.__c.base=a.__e;break}return ve(e)}}function Ae(e){(!e.__d&&(e.__d=!0)&&ne.push(e)&&!ke.__r++||le!=te.debounceRendering)&&((le=te.debounceRendering)||re)(ke)}function ke(){for(var e,t,a,n,l,r,s,i=1;ne.length;)ne.length>i&&ne.sort(se),e=ne.shift(),i=ne.length,e.__d&&(a=void 0,l=(n=(t=e).__v).__e,r=[],s=[],t.__P&&((a=_e({},n)).__v=n.__v+1,te.vnode&&te.vnode(a),Te(t.__P,a,n,t.__n,t.__P.namespaceURI,32&n.__u?[l]:null,r,null==l?be(n):l,!!(32&n.__u),s),a.__v=n.__v,a.__.__k[a.__i]=a,Oe(r,a,s),a.__e!=l&&ve(a)));ke.__r=0}function we(e,t,a,n,l,r,s,i,o,c,m){var u,d,p,g,_,f,h=n&&n.__k||de,y=t.length;for(o=Ne(a,t,h,o,y),u=0;u<y;u++)null!=(p=a.__k[u])&&(d=-1==p.__i?ue:h[p.__i]||ue,p.__i=u,f=Te(e,p,d,l,r,s,i,o,c,m),g=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&qe(d.ref,null,p),m.push(p.ref,p.__c||g,p)),null==_&&null!=g&&(_=g),4&p.__u||d.__k===p.__k?o=Se(p,o,e):"function"==typeof p.type&&void 0!==f?o=f:g&&(o=g.nextSibling),p.__u&=-7);return a.__e=_,o}function Ne(e,t,a,n,l){var r,s,i,o,c,m=a.length,u=m,d=0;for(e.__k=new Array(l),r=0;r<l;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(o=r+d,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?he(null,s,null,null,null):ge(s)?he(ye,{children:s},null,null,null):null==s.constructor&&s.__b>0?he(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,i=null,-1!=(c=s.__i=xe(s,a,o,u))&&(u--,(i=a[c])&&(i.__u|=2)),null==i||null==i.__v?(-1==c&&(l>m?d--:l<m&&d++),"function"!=typeof s.type&&(s.__u|=4)):c!=o&&(c==o-1?d--:c==o+1?d++:(c>o?d--:d++,s.__u|=4))):e.__k[r]=null;if(u)for(r=0;r<m;r++)null!=(i=a[r])&&!(2&i.__u)&&(i.__e==n&&(n=be(i)),Me(i,i));return n}function Se(e,t,a){var n,l;if("function"==typeof e.type){for(n=e.__k,l=0;n&&l<n.length;l++)n[l]&&(n[l].__=e,t=Se(n[l],t,a));return t}e.__e!=t&&(t&&e.type&&!a.contains(t)&&(t=be(e)),a.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function xe(e,t,a,n){var l,r,s,i=e.key,o=e.type,c=t[a],m=null!=c&&!(2&c.__u);if(null===c&&null==e.key||m&&i==c.key&&o==c.type)return a;if(n>(m?1:0))for(l=a-1,r=a+1;l>=0||r<t.length;)if(null!=(c=t[s=l>=0?l--:r++])&&!(2&c.__u)&&i==c.key&&o==c.type)return s;return-1}function Ce(e,t,a){"-"==t[0]?e.setProperty(t,null==a?"":a):e[t]=null==a?"":"number"!=typeof a||pe.test(t)?a:a+"px"}function Pe(e,t,a,n,l){var r,s;e:if("style"==t)if("string"==typeof a)e.style.cssText=a;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)a&&t in a||Ce(e.style,t,"");if(a)for(t in a)n&&a[t]==n[t]||Ce(e.style,t,a[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(ie,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=a,a?n?a.u=n.u:(a.u=oe,e.addEventListener(t,r?me:ce,r)):e.removeEventListener(t,r?me:ce,r);else{if("http://www.w3.org/2000/svg"==l)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==a?"":a;break e}catch(e){}"function"==typeof a||(null==a||!1===a&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==a?"":a))}}function Ie(e){return function(t){if(this.l){var a=this.l[t.type+e];if(null==t.t)t.t=oe++;else if(t.t<a.u)return;return a(te.event?te.event(t):t)}}}function Te(e,t,a,n,l,r,s,i,o,c){var m,u,d,p,g,_,f,h,y,E,b,v,A,k,w,N,S,x=t.type;if(null!=t.constructor)return null;128&a.__u&&(o=!!(32&a.__u),r=[i=t.__e=a.__e]),(m=te.__b)&&m(t);e:if("function"==typeof x)try{if(h=t.props,y="prototype"in x&&x.prototype.render,E=(m=x.contextType)&&n[m.__c],b=m?E?E.props.value:m.__:n,a.__c?f=(u=t.__c=a.__c).__=u.__E:(y?t.__c=u=new x(h,b):(t.__c=u=new Ee(h,b),u.constructor=x,u.render=Le),E&&E.sub(u),u.props=h,u.state||(u.state={}),u.context=b,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),y&&null==u.__s&&(u.__s=u.state),y&&null!=x.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=_e({},u.__s)),_e(u.__s,x.getDerivedStateFromProps(h,u.__s))),p=u.props,g=u.state,u.__v=t,d)y&&null==x.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),y&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(y&&null==x.getDerivedStateFromProps&&h!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(h,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(h,u.__s,b)||t.__v==a.__v){for(t.__v!=a.__v&&(u.props=h,u.state=u.__s,u.__d=!1),t.__e=a.__e,t.__k=a.__k,t.__k.some(function(e){e&&(e.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(h,u.__s,b),y&&null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(p,g,_)})}if(u.context=b,u.props=h,u.__P=e,u.__e=!1,A=te.__r,k=0,y){for(u.state=u.__s,u.__d=!1,A&&A(t),m=u.render(u.props,u.state,u.context),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[]}else do{u.__d=!1,A&&A(t),m=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++k<25);u.state=u.__s,null!=u.getChildContext&&(n=_e(_e({},n),u.getChildContext())),y&&!d&&null!=u.getSnapshotBeforeUpdate&&(_=u.getSnapshotBeforeUpdate(p,g)),N=m,null!=m&&m.type===ye&&null==m.key&&(N=Re(m.props.children)),i=we(e,ge(N)?N:[N],t,a,n,l,r,s,i,o,c),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),f&&(u.__E=u.__=null)}catch(e){if(t.__v=null,o||null!=r)if(e.then){for(t.__u|=o?160:128;i&&8==i.nodeType&&i.nextSibling;)i=i.nextSibling;r[r.indexOf(i)]=null,t.__e=i}else{for(S=r.length;S--;)fe(r[S]);Fe(t)}else t.__e=a.__e,t.__k=a.__k,e.then||Fe(t);te.__e(e,t,a)}else null==r&&t.__v==a.__v?(t.__k=a.__k,t.__e=a.__e):i=t.__e=De(a.__e,t,a,n,l,r,s,o,c);return(m=te.diffed)&&m(t),128&t.__u?void 0:i}function Fe(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Fe)}function Oe(e,t,a){for(var n=0;n<a.length;n++)qe(a[n],a[++n],a[++n]);te.__c&&te.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){te.__e(e,t.__v)}})}function Re(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:ge(e)?e.map(Re):_e({},e)}function De(e,t,a,n,l,r,s,i,o){var c,m,u,d,p,g,_,f=a.props,h=t.props,y=t.type;if("svg"==y?l="http://www.w3.org/2000/svg":"math"==y?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((p=r[c])&&"setAttribute"in p==!!y&&(y?p.localName==y:3==p.nodeType)){e=p,r[c]=null;break}if(null==e){if(null==y)return document.createTextNode(h);e=document.createElementNS(l,y,h.is&&h),i&&(te.__m&&te.__m(t,r),i=!1),r=null}if(null==y)f===h||i&&e.data==h||(e.data=h);else{if(r=r&&ee.call(e.childNodes),f=a.props||ue,!i&&null!=r)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)if(p=f[c],"children"==c);else if("dangerouslySetInnerHTML"==c)u=p;else if(!(c in h)){if("value"==c&&"defaultValue"in h||"checked"==c&&"defaultChecked"in h)continue;Pe(e,c,null,p,l)}for(c in h)p=h[c],"children"==c?d=p:"dangerouslySetInnerHTML"==c?m=p:"value"==c?g=p:"checked"==c?_=p:i&&"function"!=typeof p||f[c]===p||Pe(e,c,p,f[c],l);if(m)i||u&&(m.__html==u.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(u&&(e.innerHTML=""),we("template"==t.type?e.content:e,ge(d)?d:[d],t,a,n,"foreignObject"==y?"http://www.w3.org/1999/xhtml":l,r,s,r?r[0]:a.__k&&be(a,0),i,o),null!=r)for(c=r.length;c--;)fe(r[c]);i||(c="value","progress"==y&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[c]||"progress"==y&&!g||"option"==y&&g!=f[c])&&Pe(e,c,g,f[c],l),c="checked",null!=_&&_!=e[c]&&Pe(e,c,_,f[c],l))}return e}function qe(e,t,a){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){te.__e(e,a)}}function Me(e,t,a){var n,l;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qe(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){te.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(l=0;l<n.length;l++)n[l]&&Me(n[l],t,a||"function"!=typeof e.type);a||fe(e.__e),e.__c=e.__=e.__e=void 0}function Le(e,t,a){return this.constructor(e,a)}ee=de.slice,te={__e:function(e,t,a,n){for(var l,r,s;t=t.__;)if((l=t.__c)&&!l.__)try{if((r=l.constructor)&&null!=r.getDerivedStateFromError&&(l.setState(r.getDerivedStateFromError(e)),s=l.__d),null!=l.componentDidCatch&&(l.componentDidCatch(e,n||{}),s=l.__d),s)return l.__E=l}catch(t){e=t}throw e}},ae=0,Ee.prototype.setState=function(e,t){var a;a=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=_e({},this.state),"function"==typeof e&&(e=e(_e({},a),this.props)),e&&_e(a,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ae(this))},Ee.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ae(this))},Ee.prototype.render=ye,ne=[],re="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,se=function(e,t){return e.__v.__b-t.__v.__b},ke.__r=0,ie=/(PointerCapture)$|Capture$/i,oe=0,ce=Ie(!1),me=Ie(!0);const je=({feedSettings:a,feedItem:n})=>(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"instagram-gallery-item__media-mask"}),"BUSINESS"==n?.user_type&&(0,e.createElement)("div",{className:"instagram-gallery-item__media-mask--content"},!!a.mask.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__likes_count--mask"},(0,e.createElement)("i",{className:"qligg-icon-heart instagram-gallery-item__icon-heart"}),n.likes_count||0),!!a.mask.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__comments_count--mask"},(0,e.createElement)("i",{className:"qligg-icon-comment instagram-gallery-item__icon-bubble_chat"}),n.comments_count||0))),Be=({feedItem:t,feedSettings:a})=>{const n="CAROUSEL_ALBUM"===t.media_type&&"VIDEO"===t.media.type,l=null===t.media.url;return(0,e.createElement)("div",{className:"instagram-gallery-item__media-wrap"},l?(0,e.createElement)("img",{alt:"instagram",className:P()("instagram-gallery-item__media"),src:a.copyright.placeholder?a.copyright.placeholder:t.media.thumbnail}):"VIDEO"===t.media_type||n?(0,e.createElement)("video",{alt:"instagram",poster:t.media.thumbnail,className:"instagram-gallery-item__media",src:t.media.url}):(0,e.createElement)("img",{alt:"instagram",className:"instagram-gallery-item__media",src:t.media.url}),a.mask.display&&(0,e.createElement)(je,{feedItem:t,feedSettings:a}),"VIDEO"===t.media_type&&!l&&(0,e.createElement)("i",{className:"instagram-gallery-item__icon qligg-icon-video instagram-gallery-item__icon--views"}),"CAROUSEL_ALBUM"===t.media_type&&(0,e.createElement)("i",{className:"instagram-gallery-item__icon qligg-icon-gallery instagram-gallery-item__icon--views"}),!!t.share_url&&(0,e.createElement)("a",{className:"instagram-gallery-item__icon qligg-icon-instagram instagram-gallery-item__icon--link",href:t.share_url,target:"_blank",rel:"noreferrer"}))},Ge=e=>{const t=e.highlight.tag?.split(" ");return t.map(e=>e.includes("#")?e:e.split(" ").map(e=>"#"+e).join(" "))},Ue=(e,t)=>{if(!e)return;const a=e.replace(/<[^>]+>/g,"");let n=a;return n=e.match("[぀-ヿ㐀-䶿一-鿿豈-﫿ｦ-ﾟ]")?a.split("",t).join(""):a.split(" ",t).join(" "),n.length<e.length?`${n}...`:n},He=(0,t.memo)(({feedSettings:t,feedItem:a})=>(0,e.createElement)("div",{className:"instagram-gallery-item__media-card"},(0,e.createElement)("div",{className:"instagram-gallery-item__info"},!!a.date&&(0,e.createElement)("span",{className:"instagram-gallery-item__date"},(0,e.createElement)("i",{className:"qligg-icon-date"}),a.date),"BUSINESS"==a?.user_type&&(0,e.createElement)("div",{className:"instagram-gallery-item__icons"},!!t.card.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__likes_count"},(0,e.createElement)("i",{className:"qligg-icon-heart"}),a.likes_count||0),!!t.card.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-item__comments_count"},(0,e.createElement)("i",{className:"qligg-icon-comment"}),a.comments_count||0))),!!t.card.text_length&&!!a.media_description&&(0,e.createElement)("p",{className:"instagram-gallery-item__media_description"},Ue(a.media_description,t.card.text_length)))),ze=({index:t,length:a,feedSettings:n,feedItem:l,onClick:r})=>{const s=function(e,t,a){if(!["highlight","highlight-square"].includes(e.layout))return!1;if(!e?.highlight)return!1;for(const n in e.highlight){const l=e.highlight[n].split(",").map(e=>e.toString().trim());switch(n){case"position":if(l.includes(a.toString()))return!0;break;case"id":if(l.includes(t.id))return!0;break;case"tag":const n=t.tags?.filter(t=>Ge(e).includes(t)).length;if(n)return!0}}return!1}(n,l,t),i=function(e){return["carousel","carousel-vertical"].includes(e.layout)}(n),o=!n?.modal?.display&&!!l?.share_url,c=o?"a":"div";return(0,e.createElement)(c,{href:o?l.share_url:void 0,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,className:P()("instagram-gallery-item",i&&"swiper-slide",s&&"instagram-gallery-item--highlight",`instagram-gallery-item--cols-${n.columns}`),"data-elementor-open-lightbox":"no","data-feed-item-index":t,onClick:r,onKeyDown:o?void 0:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(e))},tabIndex:o?void 0:0,role:o?void 0:"button","aria-label":(()=>{const e="VIDEO"===l.media_type?"Video":"Image";let t=l.media_description?`: ${l.media_description.replace(/<[^>]*>?/gm,"")}`:"";return t.length>100&&(t=t.substring(0,100)+"..."),`Instagram ${e}${t}`})()},(0,e.createElement)("div",{className:"instagram-gallery-item__wrap"},(0,e.createElement)(Be,{index:t,feedItem:l,length:a,feedSettings:n}),n.card.display&&(0,e.createElement)(He,{feedItem:l,feedSettings:n})))},We="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE2IDE3SDJsMy41LTQuNWwyLjUgM2wzLTMuODFBMiAyIDAgMCAxIDEwIDEwVjZIMmEyIDIgMCAwIDAtMiAydjEwYTIgMiAwIDAgMCAyIDJoMTRhMiAyIDAgMCAwIDItMnYtNmgtNS43NXoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTkgNGgtLjVWMi41YTIuNSAyLjUgMCAwIDAtNSAwVjRIMTNhMSAxIDAgMCAwLTEgMXY0YTEgMSAwIDAgMCAxIDFoNmExIDEgMCAwIDAgMS0xVjVhMSAxIDAgMCAwLTEtMXptLTMgNGExIDEgMCAxIDEgMS0xYTEgMSAwIDAgMS0xIDF6bTEuNS00aC0zVjIuNzVDMTQuNSAyIDE0LjUgMSAxNiAxczEuNSAxIDEuNSAxLjc1eiIvPjwvc3ZnPgo=",Ve=({currentFeedItem:a,feedSettings:n})=>{const l=(0,t.useRef)(null);return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container insta-gallery-slider-container"},(0,e.createElement)("div",{ref:l,className:"insta-gallery-slider"},a.children.map(t=>(0,e.createElement)("div",{key:t.id,className:"insta-gallery__media"},null===t.media.url?(0,e.createElement)("img",{className:P()("instagram-gallery-modal__media",!n.copyright.placeholder&&"instagram-gallery-modal__media--placeholder"),src:n.copyright.placeholder?n.copyright.placeholder:We,alt:t.media.alt}):"VIDEO"===t.media.type?(0,e.createElement)("video",{controls:!0,poster:t.media.thumbnail,className:"instagram-gallery-modal__media",src:t.media.url}):(0,e.createElement)("img",{className:"instagram-gallery-modal__media",src:t.media.url,alt:t.media.alt})))),(0,e.createElement)("div",{className:"insta-gallery-slider__button-container"},(0,e.createElement)("span",{onClick:()=>{if(l.current.children.length>0){const e=l.current.children.length-1,t=l.current.children[e];l.current.insertBefore(t,l.current.firstChild),l.current.style.transition="none";const a=l.current.children[0].offsetWidth;l.current.style.transform=`translateX(-${a}px)`,setTimeout(()=>{l.current.style.transition="200ms ease-out all",l.current.style.transform="translateX(0)"},30)}},className:"insta-gallery-slider__button insta-gallery-slider__button--left qligg-icon-prev"}),(0,e.createElement)("span",{onClick:()=>{if(l.current.children.length>0){const e=l.current.children[0];l.current.style.transition="300ms ease-out all";const t=l.current.children[0].offsetWidth;l.current.style.transform=`translateX(-${t}px)`;const a=()=>{l.current.style.transition="none",l.current.style.transform="translateX(0)",l.current.appendChild(e),l.current.removeEventListener("transitionend",a)};l.current.addEventListener("transitionend",a)}},className:"insta-gallery-slider__button insta-gallery-slider__button--right qligg-icon-next"})))},$e=(0,t.memo)(({currentFeedItem:t,feedSettings:a})=>{var n;const l=!t?.media?.url;switch(t.media_type){case"CAROUSEL_ALBUM":return(0,e.createElement)(Ve,{feedSettings:a,currentFeedItem:t});case"VIDEO":return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container"},l?(0,e.createElement)("img",{src:We,alt:"thumbnail",className:"instagram-gallery-item__icon qligg-icon-video instagram-gallery-item__icon--views"}):(0,e.createElement)("video",{poster:t.media.thumbnail,src:t.media.url,controls:!0,className:"instagram-gallery-modal__media"}));default:return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-container"},l?(0,e.createElement)("img",{src:null!==(n=t?.media?.thumbnail)&&void 0!==n?n:a?.copyright?.placeholder,className:"instagram-gallery-modal__media"}):(0,e.createElement)("img",{src:t.media.url,className:"instagram-gallery-modal__media"}))}}),Je=({currentFeedItem:a,userProfile:n,feedItemsNumber:l,feedSettings:r})=>{var s,i,o,c;const{currentFeedIndex:m}=H(),[u,d]=(0,t.useState)(5),{comments:p,loading:g,error:_}=(({feedSettings:e,currentFeedItem:a,maxRetries:n=2,retryDelay:l=1500})=>{const[r,s]=(0,t.useState)([]),[i,o]=(0,t.useState)(!1),[c,m]=(0,t.useState)(null);return window?.qligg_frontend?.restRoutePaths.comments,(0,t.useEffect)(()=>{if(!(e?.modal?.comments_list&&"BUSINESS"===a?.user_type&&a?.id&&e?.account_id))return;let t=!0;return(async()=>{o(!0),s([]),m(null);const r=async i=>{try{const n=await async function({account_id:e,media_id:t,limit:a=25}){const n=window?.qligg_frontend?.restRoutePaths.comments,l=$({account_id:e,media_id:t,limit:a}).toString(),r=`${n}${n.includes("?")?"&":"?"}${l}`,s=await V({url:r,method:"GET"}),{data:i}=s;return Array.isArray(i)?i:i&&"object"==typeof i?[i]:[]}({account_id:e.account_id,media_id:a.id});t&&(s(n),o(!1))}catch(e){if(!t)return;i<n?setTimeout(()=>{t&&r(i+1)},l):(m(e),o(!1))}};await r(0)})(),()=>{t=!1}},[a?.id,e?.account_id,n,l]),{comments:r,loading:i,error:c}})({feedSettings:r,currentFeedItem:a}),f=(0,t.useCallback)(e=>new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),[]),h=(0,t.useCallback)(()=>{d(e=>e+5)},[]),y=p.slice(0,u),E=p.length>u,b="BUSINESS"===a.user_type;return(0,e.createElement)("section",{className:"instagram-gallery-modal__media-sidebar"},r.modal.profile&&n.username&&n.link&&(0,e.createElement)("div",{className:"instagram-gallery-modal__profile"},n.avatar&&(0,e.createElement)("img",{alt:null!==(s=n.nickname)&&void 0!==s?s:n.username,src:n.avatar}),(0,e.createElement)("div",null,(0,e.createElement)("span",null,null!==(i=n.nickname)&&void 0!==i?i:n.username),(0,e.createElement)("a",{href:n.link,title:null!==(o=n.nickname)&&void 0!==o?o:n.username,target:"_blank",rel:"noopener noreferrer","aria-label":`Visit ${null!==(c=n.nickname)&&void 0!==c?c:n.username}'s Instagram profile`},`@${n.username}`))),(0,e.createElement)("div",{className:"instagram-gallery-modal__icons"},(0,e.createElement)("span",{className:"instagram-gallery-modal__counter","aria-live":"polite"},`${m+1} / ${l}`),(0,e.createElement)("a",{className:"instagram-gallery-modal__link",href:a.share_url,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Instagram"},(0,e.createElement)("i",{className:"qligg-icon-instagram","aria-hidden":"true"})," ","Instagram")),r.modal.media_description&&!!a.media_description&&(0,e.createElement)("div",{className:"instagram-gallery-modal__media_description"},(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:Ue(a.media_description,r.modal.text_length)}})),(r.modal.likes_count||r.modal.comments_count)&&b&&(0,e.createElement)("div",{className:"instagram-gallery-modal__info"},r.modal.likes_count&&(0,e.createElement)("span",{className:"instagram-gallery-modal__likes_count"},(0,e.createElement)("i",{className:"qligg-icon-heart","aria-hidden":"true"}),a.likes_count||0),r.modal.comments_count&&(0,e.createElement)("span",{className:"instagram-gallery-modal__comments_count"},(0,e.createElement)("i",{className:"qligg-icon-comment","aria-hidden":"true"}),a.comments_count||0)),r.modal.comments_list&&b&&(0,e.createElement)("div",{className:"instagram-gallery-modal__comments-list"},(0,e.createElement)("p",null,(0,e.createElement)("b",null,"Comments")),g?(0,e.createElement)("p",{"aria-live":"polite"},"Loading comments..."):_?(0,e.createElement)("p",{className:"instagram-gallery-modal__error","aria-live":"assertive"},"Unable to load comments. Please try again later."):y.length>0?(0,e.createElement)(t.Fragment,null,(0,e.createElement)("ul",null,y.map(t=>(0,e.createElement)("li",{key:t.id,className:"instagram-gallery-modal__comment"},(0,e.createElement)("div",{className:"instagram-gallery-modal__comment-header"},(0,e.createElement)("strong",null,t.username),(0,e.createElement)("span",{className:"instagram-gallery-modal__comment-time"},f(t.timestamp))),(0,e.createElement)("p",null,t.text),t.replies&&t.replies.length>0&&(0,e.createElement)("ul",{className:"instagram-gallery-modal__comment-replies"},t.replies.map(t=>(0,e.createElement)("li",{key:t.id,className:"instagram-gallery-modal__comment-reply"},(0,e.createElement)("div",{className:"instagram-gallery-modal__comment-header"},(0,e.createElement)("strong",null,t.username),(0,e.createElement)("span",{className:"instagram-gallery-modal__comment-time"},f(t.timestamp))),(0,e.createElement)("p",null,t.text))))))),E&&(0,e.createElement)("button",{className:"instagram-gallery-modal__load-more",onClick:h,"aria-label":"Load more comments"},"Load more comments")):(0,e.createElement)("div",null,(0,e.createElement)("p",null,"No comments available for this post."),window.qligg_frontend&&window.qligg_frontend.QLIGG_DEVELOPER&&(0,e.createElement)("p",null,"Comment count in feed item:"," ",a.comments_count))))},Ye=({isPrevious:t,classname:a,onClick:n,...l})=>(0,e.createElement)("span",{className:P()("instagram-gallery-modal__button-arrow",a,t&&"qligg-icon-prev",!t&&"qligg-icon-next"),onClick:n,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n(e))},role:"button",tabIndex:"0",...l}),Qe=({onClick:t,...a})=>(0,e.createElement)("span",{className:"instagram-gallery-modal__button-close",onClick:t,onKeyPress:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e))},role:"button",...a}),Ze=({children:t,id:a})=>{const{isOpen:n,setIsOpen:l}=H();return n?(0,e.createElement)("div",{className:"instagram-gallery-modal__overlay",id:a,onClick:()=>l(!1),onKeyDown:e=>{"Escape"===e.key&&l(!1)},role:"dialog","aria-modal":"true",tabIndex:"-1"},t):null},Xe=({feedItems:a,feedSettings:n,userProfile:l})=>{const{currentFeedIndex:r,setCurrentFeedIndex:s}=H(),{setIsOpen:i,isOpen:o}=H(),c=(0,t.useRef)(null),[m,u]=(0,t.useState)(a[r]),d=!!a[r-1]||a.length>1,p=!!a[r+1]||a.length>1,g=(0,t.useCallback)(()=>{d&&(a[r-1]?s(r-1):s(a.length-1))},[r,a,d,s]),_=(0,t.useCallback)(()=>{p&&(a[r+1]?s(r+1):s(0))},[r,a,p,s]),f=(0,t.useCallback)(e=>{"ArrowLeft"===e.key?g():"ArrowRight"===e.key?_():"Escape"===e.key&&i(!1)},[g,_,i]);return(0,t.useEffect)(()=>{u(a[r])},[r,a]),(0,t.useEffect)(()=>(document.addEventListener("keydown",f),c.current&&c.current.focus(),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}),[f,o]),(0,e.createElement)(Ze,{id:`instagram-gallery-modal-${n.id}`},(0,e.createElement)("div",{className:"instagram-gallery-modal",onClick:e=>e.stopPropagation(),ref:c,tabIndex:"-1","aria-modal":"true",role:"dialog","aria-label":"Instagram media viewer"},(0,e.createElement)("div",{className:"instagram-gallery-modal__options"},(0,e.createElement)("div",{className:"instagram-gallery-modal__options--arrows"},(0,e.createElement)(Ye,{isPrevious:!0,onClick:e=>{e.stopPropagation(),g()},"aria-label":"Previous image",tabIndex:"0"}),(0,e.createElement)(Ye,{next:!0,onClick:e=>{e.stopPropagation(),_()},"aria-label":"Next image",tabIndex:"0"})),(0,e.createElement)(Qe,{onClick:()=>i(!1),"aria-label":"Close modal",tabIndex:"0"})),(0,e.createElement)("section",{className:P()("instagram-gallery-modal__body","right"!==n.modal.modal_align&&`instagram-gallery-modal__body--sidebar-${n.modal.modal_align}`)},(0,e.createElement)($e,{feedSettings:n,currentFeedItem:m}),(0,e.createElement)(Je,{feedSettings:n,currentFeedItem:m,userProfile:l,feedItemsNumber:a.length}))))},Ke=(e,t,a="")=>null==t||""===t?"":`${e}: ${t}${a};`,et=(0,t.forwardRef)((tt=a=>{const n=a.target.parentNode,{masonryRef:l,userMediaList:r,feedSettings:s,className:i,userProfile:o}=a,{currentFeedIndex:c,setCurrentFeedIndex:m}=H(),{setIsOpen:u}=H(),d=!!s?.modal?.display;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{ref:l,className:P()("instagram-gallery-list",i),"data-feed_layout":s.layout},r.data.map((t,a)=>{const n=r.data.length;return(0,e.createElement)(ze,{key:t.id,index:a,length:n,feedItem:t,feedSettings:s,onClick:()=>{d&&(m(a),u(!0))}})})),d&&(0,t.createPortal)((0,e.createElement)(Xe,{userProfile:o,feedSettings:s,currentFeedIndex:c,feedItems:r.data}),n))},(a,n)=>{const{feedSettings:l}=a,r=l.responsive||{desktop:{columns:l.columns||3,spacing:l.spacing||10},tablet:{columns:2,spacing:8},mobile:{columns:1,spacing:6},breakpoints:{tablet:768,mobile:480}},s=r.breakpoints?.tablet||768,i=r.breakpoints?.mobile||480,o=!!l.box?.display,c=!!l.card?.display,m="carousel"===l.layout,u=!!l.mask?.display,d=!!l.button?.display,p=!!l.button_load?.display,g=`instagram-gallery-feed-${l.id}`,_=`instagram-gallery-modal-${l.id}`;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("style",null,`\n\t\t\t\t\t#${_} {\n\t\t\t\t\t\t${Ke("--qligg-modal-text-align",l.modal?.text_align||"left")}\n\t\t\t\t\t\t${Ke("--qligg-modal-font-size",l.modal?.font_size||14,"px")}\n\t\t\t\t\t\t--qligg-modal-body-height: 75vh;\n\t\t\t\t\t\t--qligg-modal-body-width: 75vw;\n\t\t\t\t\t\t--qligg-modal-sidebar-width: 360px;\n\t\t\t\t\t\t--qligg-modal-button-size: 40px;\n\t\t\t\t\t\t--qligg-modal-comments-height: 400px;\n\t\t\t\t\t\t--qligg-modal-border-color: #eeeeee;\n\t\t\t\t\t\t--qligg-modal-border-color-dark: #dddddd;\n\t\t\t\t\t\t--qligg-modal-button-border: #efefef;\n\t\t\t\t\t\t--qligg-modal-button-hover: #fafafa;\n\t\t\t\t\t\t--qligg-modal-error-color: #e74c3c;\n\t\t\t\t\t}\n\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t#${g} {\n\t\t\t\t\t\t\t--qligg-columns: ${r.desktop?.columns||3};\n\t\t\t\t\t\t\t--qligg-spacing: ${r.desktop?.spacing||10}px;\n\t\t\t\t\t\t\t--qligg-item-width: calc(100% / var(--qligg-columns));\n\t\t\t\t\t\t\t--qligg-aspect-ratio: ${l.aspect_ratio?.width||1} / ${l.aspect_ratio?.height||1};\n\t\t\t\t\t\t\t${o?Ke("--qligg-box-bg",l.box.background):""}\n\t\t\t\t\t\t\t${o?Ke("--qligg-box-color",l.box.text_color):""}\n\t\t\t\t\t\t\t${o?Ke("--qligg-box-radius",l.box.radius,"px"):""}\n\t\t\t\t\t\t\t${o?Ke("--qligg-box-padding",l.box.padding,"px"):""}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Feed card settings */\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-bg",l.card.background):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-bg-hover",l.card.background_hover):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-color",l.card.text_color):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-font-size",l.card.font_size,"px"):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-padding",l.card.padding,"px"):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-radius",l.card.radius,"px"):""}\n\t\t\t\t\t\t\t${c&&l.card.boxed?Ke("--qligg-card-boxed","1px solid #f5f5f5"):""}\n\t\t\t\t\t\t\t${c&&l.card.boxed?Ke("--qligg-card-shadow","0 1px 3px rgba(0,0,0,0.05)"):""}\n\t\t\t\t\t\t\t${c&&l.card.boxed?Ke("--qligg-card-shadow-hover","0 3px 10px rgba(0,0,0,0.06)"):""}\n\t\t\t\t\t\t\t${c?Ke("--qligg-card-text-align",l.card.text_align||"left"):""}\n\t\t\t\t\t\t\t${u?Ke("--qligg-mask-bg",l.mask.background):""}\n\t\t\t\t\t\t\t${u?Ke("--qligg-mask-icon-color",l.mask.icon_color||"#ffffff"):""}\n\t\t\t\t\t\t\t${m?Ke("--qligg-carousel-arrow-color",l.carousel.navarrows_color):""}\n\t\t\t\t\t\t\t${m?Ke("--qligg-carousel-pagination-color",l.carousel.pagination_color):""}\n\t\t\t\t\t\t\t${d?Ke("--qligg-button-color",l.button.text_color):""}\n\t\t\t\t\t\t\t${d?Ke("--qligg-button-bg",l.button.background):""}\n\t\t\t\t\t\t\t${d?Ke("--qligg-button-bg-hover",l.button.background_hover):""}\n\t\t\t\t\t\t\t${p?Ke("--qligg-load-button-color",l.button_load.text_color):""}\n\t\t\t\t\t\t\t${p?Ke("--qligg-load-button-bg",l.button_load.background):""}\n\t\t\t\t\t\t\t${p?Ke("--qligg-load-button-bg-hover",l.button_load.background_hover):""}\n\t\t\t\t\t\t}\n\t\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t@media (max-width: ${s}px) {\n\t\t\t\t\t\t\t#${g} {\n\t\t\t\t\t\t\t\t--qligg-columns: ${r.tablet?.columns||2};\n\t\t\t\t\t\t\t\t--qligg-spacing: ${r.tablet?.spacing||8}px;\n\t\t\t\t\t\t\t\t--qligg-mask-icon-size: 26px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${_} {\n\t\t\t\t\t\t\t\t--qligg-modal-body-height: 80vh;\n\t\t\t\t\t\t\t\t--qligg-modal-body-width: 80vw;\n\t\t\t\t\t\t\t\t--qligg-modal-sidebar-width: 100%;\n\t\t\t\t\t\t\t\t--qligg-modal-button-size: 36px;\n\t\t\t\t\t\t\t\t--qligg-modal-comments-height: 250px;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__body {\n\t\t\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\t\t\toverflow-x: hidden;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__media-sidebar {\n\t\t\t\t\t\t\t\tmax-height: 40vh;\n\t\t\t\t\t\t\t\tborder-left: none;\n\t\t\t\t\t\t\t\tborder-top: 1px solid #f5f5f5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__media-container {\n\t\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t\t\toverflow: visible;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__button-close:before, \n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__button-close:after {\n\t\t\t\t\t\t\t\twidth: 18px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t`),(0,e.createElement)("style",null,`\n\t\t\t\t\t\t@media (max-width: ${i}px) {\n\t\t\t\t\t\t\t#${g} {\n\t\t\t\t\t\t\t\t--qligg-columns: ${r.mobile?.columns||1};\n\t\t\t\t\t\t\t\t--qligg-spacing: ${r.mobile?.spacing||6}px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#${_} {\n\t\t\t\t\t\t\t\t--qligg-modal-body-height: 85vh;\n\t\t\t\t\t\t\t\t--qligg-modal-body-width: 90vw;\n\t\t\t\t\t\t\t\t--qligg-modal-sidebar-width: 100%;\n\t\t\t\t\t\t\t\t--qligg-modal-button-size: 32px;\n\t\t\t\t\t\t\t\t--qligg-modal-comments-height: 200px;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t#${_} .instagram-gallery-modal__button-arrow {\n\t\t\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\t\t\tfont-size: 1rem;\n\t\t\t\t\t\t\t\ttop: auto;\n\t\t\t\t\t\t\t\tleft: auto;\n\t\t\t\t\t\t\t\tright: auto;\n\t\t\t\t\t\t\t\tbottom: auto;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t`),(0,e.createElement)(tt,{...a,forwardRef:n}))}));var tt;const at=a=>{const{target:n,userMediaList:l,feedSettings:r,calculateWidth:s}=a,[i,o]=(0,t.useState)(!0),{isImageLoad:c}=H(),m=(0,t.useRef)(null),u=(0,t.useRef)(null),d=(0,t.useRef)(new Set),p=(0,t.useRef)(0),g=(0,t.useCallback)(()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{m.current&&m.current.layout()},100)},[]),_=(0,t.useCallback)(e=>{d.current.add(e),g(),d.current.size>=p.current&&p.current>0&&(o(!1),n.classList.add("loaded"))},[g,n]),f=function(e,a){const n=(0,t.useRef)();return(0,t.useCallback)(t=>{t?n.current=e(t):n.current&&n.current()},a)}(e=>{const{ownerDocument:t}=e,{defaultView:a}=t;if(!a.Masonry)return;const l={itemSelector:".instagram-gallery-item",isResizable:!0,isAnimated:!1,transitionDuration:0,percentPosition:!0,gutter:0};l.columnWidth=s&&"function"==typeof s?s(e,r):".instagram-gallery-item";const i=new a.Masonry(e,l);m.current=i;const c=e.querySelectorAll(".instagram-gallery-item__media");p.current=c.length,d.current.clear(),c.forEach((e,t)=>{const a=`media-${t}`,n=()=>{_(a),e.removeEventListener("load",n),e.removeEventListener("loadeddata",n),e.removeEventListener("canplay",n),e.removeEventListener("error",n)};"IMG"===e.tagName?e.complete&&0!==e.naturalWidth?_(a):(e.addEventListener("load",n),e.addEventListener("error",n)):"VIDEO"===e.tagName&&(e.readyState>=3?_(a):(e.addEventListener("loadeddata",n),e.addEventListener("canplay",n),e.addEventListener("error",n)))}),0===p.current&&(o(!1),n.classList.add("loaded"));const f=new a.MutationObserver(e=>{let t=!1;e.forEach(e=>{"childList"===e.type&&e.addedNodes.length>0&&(t=!0)}),t&&g()}),h=e.querySelector(".instagram-gallery-item__wrap")||e;return f.observe(h,{childList:!0,subtree:!0}),setTimeout(()=>{i.layout()},50),()=>{u.current&&clearTimeout(u.current),f.disconnect(),i.destroy(),m.current=null}},[l,_,g,n,s,r]);return(0,e.createElement)(t.Fragment,null,i&&(0,e.createElement)(Z,null),(0,e.createElement)(et,{...a,masonryRef:f}))},nt=a=>{const{userMediaList:n,feedSettings:l}=a,{setCurrentFeedIndex:r}=H(),{setIsOpen:s}=H(),i=(0,t.useCallback)(e=>{if(e){const{defaultView:t}=document;if(!t.Swiper)return;new t.Swiper(e,{slideClass:"instagram-gallery-item",loop:!0,loopedSlidesLimit:!1,centeredSlides:l.carousel.centered_slides,allowTouchMove:!1,slidesPerView:l.responsive?.desktop?.columns||l.carousel.slidespv||l.columns||3,spaceBetween:l.responsive?.desktop?.spacing||l.spacing||10,autoplay:l.carousel.autoplay&&{delay:l.carousel.autoplay_interval},pagination:{el:e.querySelector(".swiper-pagination"),dynamicBullets:!0,clickable:!0,type:"bullets"},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:l.responsive?.mobile?.columns||1,spaceBetween:l.responsive?.mobile?.spacing||6},[l.responsive?.breakpoints?.mobile||480]:{slidesPerView:l.responsive?.tablet?.columns||2,spaceBetween:l.responsive?.tablet?.spacing||8},[l.responsive?.breakpoints?.tablet||768]:{slidesPerView:l.responsive?.desktop?.columns||3,spaceBetween:l.responsive?.desktop?.spacing||10}}});const a=()=>{e.addEventListener("click",e=>{(e.target.classList.contains(".swiper-slide-duplicate")||e.target.closest(".swiper-slide-duplicate"))&&(s(!0),r(Number(e.target.closest(".swiper-slide-duplicate").dataset.feedItemIndex)))})};a()}},[n,l]);return(0,e.createElement)("div",{ref:i,className:"swiper-container"},(0,e.createElement)(et,{className:"swiper-wrapper instagram-gallery-square",...a}),l.carousel.pagination&&(0,e.createElement)("div",{className:"swiper-pagination"}),l.carousel.navarrows&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{tabIndex:"1",className:"swiper-button-prev"}),(0,e.createElement)("div",{tabIndex:"1",className:"swiper-button-next"})))},lt=a=>{const n=(0,t.useRef)();return(0,e.createElement)(et,{ref:n,className:"instagram-gallery-square",...a})},rt=t=>{const{feedSettings:a}=t,{layout:n}=a;switch(n){case"masonry":case"highlight":return(0,e.createElement)(at,{...t});case"carousel":return(0,e.createElement)(nt,{...t});default:return(0,e.createElement)(lt,{...t})}},st=a=>{const{target:n,feedSettings:l}=a,{isLoading:r,userProfile:s,error:i}=(e=>{const{account_id:a}=e,[n,l]=(0,t.useState)(!0),[r,s]=(0,t.useState)(null),[i,o]=(0,t.useState)(null);return(0,t.useEffect)(()=>{(async()=>{l(!0);try{const t=await async function(e){const t=window?.qligg_frontend?.restRoutePaths.userprofile,a=$({account_id:e.account_id}).toString(),n=`${t}${t.includes("?")?"&":"?"}${a}`;return await V({url:n,method:"GET"})}(e);s(t),l(!1)}catch(e){l(!1),o(e)}})()},[a]),{isLoading:n,userProfile:r,error:i}})(l),{isLoading:o,isLoadingMore:c,userMediaList:m,error:u,setAfter:d}=(e=>{const{source:a,limit:n,account_id:l,tag:r,order_by:s,copyright:i,reel:o}=e,{counter:c}=H(),[m,u]=(0,t.useState)(!0),[d,p]=(0,t.useState)(!1),[g,_]=(0,t.useState)({paging:{next:null,prev:null},data:[]}),[f,h]=(0,t.useState)(""),[y,E]=(0,t.useState)(null);return(0,t.useEffect)(()=>{E(null),(async()=>{0===c?u(!0):p(!0);try{const t=await async function(e,t="",a=0){const n=e?.account_id,l=e?.limit,r=e?.copyright?.hide,s=e?.reel?.hide,i=e?.order_by,o=e?.tag,c=e?.source,m=window?.qligg_frontend?.restRoutePaths?.[c];if(!m)throw new Error(`Unknown source: ${c}`);const u=$({account_id:n,limit:l,hide_items_with_copyright:r,hide_reels:s,after:t,pagination:a,order_by:i,tag:o}).toString(),d=`${m}${m.includes("?")?"&":"?"}${u}`;return await V({url:d,method:"GET"})}(e,f,c);_(0===c?{paging:t?.paging,data:t?.data}:{paging:t?.paging,data:[...g?.data,...t?.data]}),u(!1),p(!1)}catch(e){u(!1),p(!1),E(e)}})()},[n,s,l,a,r,i?.hide,o?.hide,c]),{isLoading:m,isLoadingMore:d,userMediaList:g,error:y,setAfter:h}})(l),p=r||o,g=i||u,{counter:_,setCounter:f}=H();return(0,t.useEffect)(()=>{p||["masonry","highlight"].includes(l.layout)||n.classList.add("loaded")},[p]),p?(0,e.createElement)(Z,null):g?(0,e.createElement)(X,{errorUserProfile:i,errorUserMediaList:u}):(0,e.createElement)(t.Fragment,null,!!l?.profile?.display&&(0,e.createElement)(K,{feedSettings:l,userProfile:s}),(0,e.createElement)(rt,{target:n,feedSettings:l,userMediaList:m,userProfile:s}),c&&(0,e.createElement)(Z,null),(0,e.createElement)(Q,{userProfile:s,feedSettings:l,onClick:e=>{e.preventDefault(),d(m.paging.next),f(_+1)},after:m?.paging?.next}))};function it({feedSettings:a}){const n=(0,t.useRef)(null),[l,r]=(0,t.useState)(null);return(0,t.useEffect)(()=>{n?.current&&!l&&r(n.current)},[n]),(0,e.createElement)("div",{className:"instagram-gallery-feed",ref:n,id:`instagram-gallery-feed-${a.id}`},!!l&&(0,e.createElement)(W,null,(0,e.createElement)(st,{target:l,feedSettings:a})))}var ot=a(143),ct=a(692);function mt(){return(0,e.createElement)("p",null,(0,e.createElement)("span",{style:{visibility:"visible"},className:"spinner"}),(0,r.__)("Loading…","insta-gallery"))}function ut({children:t,style:a}){return(0,e.createElement)("table",{className:"form-table widefat striped insta-gallery__table",style:a},t)}const dt=window.wp.date,pt=({index:t,account:a,deleteAccount:n,createSuccessNotice:l,createErrorNotice:s})=>{const i=t>0;return(0,e.createElement)("tr",{className:i&&"qligg-premium-field"},(0,e.createElement)("td",{width:"1%"},(0,e.createElement)("img",{className:"avatar",src:a?.avatar||"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g",alt:a?.username||(0,r.__)("Loading…","insta-gallery")})),(0,e.createElement)("td",null,a?.username?a?.username:(0,r.__)("Loading…","insta-gallery")),(0,e.createElement)("td",null,a.id),(0,e.createElement)("td",{style:{width:"300px"}},(0,e.createElement)("input",{type:"text",defaultValue:a.access_token,readOnly:!0}),(0,e.createElement)("button",{className:"button button-primary",onClick:async()=>{await k(a.access_token)?l((0,r.__)("Access token copied to clipboard.","insta-gallery"),{id:1,type:"snackbar"}):s((0,r.__)("Can't copy the access token.","insta-gallery"),{id:2,type:"snackbar"})}},(0,e.createElement)("i",{className:"dashicons dashicons-admin-page"}))),(0,e.createElement)("td",null,a.access_token_type),(0,e.createElement)("td",null,(0,dt.gmdateI18n)("d-m-Y - h:m",1e3*a.access_token_expiration_date)),(0,e.createElement)("td",null,(0,e.createElement)("button",{className:"button button-secondary",onClick:()=>{confirm((0,r.sprintf)((0,r.__)("You are about to delete the %s account.","insta-gallery"),a.username))&&n(a.id)}},(0,e.createElement)("i",{className:"dashicons dashicons-trash"}))))},gt=t=>{const{href:a,target:n="_self",title:l,children:r,className:s,alert:i}=t;return(0,e.createElement)("a",{href:a,className:P()("insta-gallery__account-button",s),target:n,title:l,onClick:e=>!confirm(i)&&e.preventDefault()},r)},_t=({setIsOpen:a})=>{const{createAccount:n}=(0,B.useAccountsEntities)(),[l,s]=(0,t.useState)(!1),[i,o]=(0,t.useState)({id:"",access_token:""}),c=l||!i?.access_token||!i?.id;return(0,e.createElement)("form",{className:"media-modal-form",onSubmit:async e=>{e.preventDefault(),s(!0);const t=await n(i);s(!1),t&&a(!1)}},(0,e.createElement)("div",{className:"media-modal-content",role:"document"},(0,e.createElement)("div",{className:"edit-attachment-frame mode-select"},(0,e.createElement)("div",{className:"edit-media-header"},(0,e.createElement)("button",{type:"button",className:"media-modal-close",onClick:()=>a(!1)},(0,e.createElement)("span",{className:"media-modal-icon"},(0,e.createElement)("span",{className:"screen-reader-text"},(0,r.__)("Close dialog"))))),(0,e.createElement)("div",{className:"media-frame-title"},(0,e.createElement)("h1",null,(0,r.__)("Manually connect an account","insta-gallery"))),(0,e.createElement)("div",{className:"insta-gallery__modal__panel",style:{top:"50px",position:"absolute",width:"100%",borderTop:"1px solid #ddd"}},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Account ID:","insta-gallery")),(0,e.createElement)("input",{style:{minWidth:260},placeholder:(0,r.__)("Enter a account ID","insta-gallery"),required:!0,value:i.id,onChange:e=>o(t=>({...t,id:e.target.value.trim()}))}))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Access Token:","insta-gallery")),(0,e.createElement)("input",{style:{minWidth:260},type:"text",placeholder:(0,r.__)("Enter access token","insta-gallery"),required:!0,value:i.access_token,onChange:e=>o(t=>({...t,access_token:e.target.value.trim()}))}))),(0,e.createElement)("div",{className:"options_group",style:{borderBottom:"none"}},(0,e.createElement)("p",{className:"form-field"},(0,t.createInterpolateElement)((0,r.__)("If you are experiencing issues linking your account, you can try doing it manually. If the problems persist, please review the <a>documentation</a> or contact us, and we will be happy to assist you.","insta-gallery"),{a:(0,e.createElement)("a",{href:"https://quadlayers.com/documentation/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_modal&utm_campaign=documentation&utm_content=documentation_link",target:"_blank",rel:"noopener noreferrer"})})))),(0,e.createElement)("div",{className:"media-frame-toolbar",style:{left:0}},(0,e.createElement)("div",{className:"media-toolbar"},(0,e.createElement)("div",{className:"media-toolbar-secondary"},(0,e.createElement)("div",{style:{float:"left",marginTop:19}},i?.access_token?(0,t.createInterpolateElement)((0,r.__)("Access token not working? Please check the <a>access token debugger</a>.","insta-gallery"),{a:(0,e.createElement)("a",{href:(0,r.sprintf)("https://developers.facebook.com/tools/debug/accesstoken/?access_token=%s",i.access_token),target:"_blank",rel:"noopener noreferrer"})}):(0,e.createElement)(e.Fragment,null,(0,t.createInterpolateElement)((0,r.__)("Please click here to get the <link1>basic</link1> or <link2>business</link2> access token.","insta-gallery"),{link1:(0,e.createElement)("a",{href:"https://socialfeed.quadlayers.com/",target:"_blank",rel:"noopener noreferrer"}),link2:(0,e.createElement)("a",{href:"https://socialfeed.quadlayers.com/facebook.php",target:"_blank",rel:"noopener noreferrer"})}))),(0,e.createElement)("span",{className:"settings-save-status media-button",style:{float:"left"}},l&&(0,e.createElement)("span",{style:{visibility:"visible"},className:"spinner"}))),(0,e.createElement)("div",{className:"media-toolbar-primary search-form"},(0,e.createElement)("button",{type:"submit",className:"media-modal-submit button button-primary media-button button-large",disabled:c},(0,r.__)("Save","insta-gallery"))))))))},ft=()=>{const{hasAccounts:a,hasResolvedAccounts:n}=(0,B.useAccountsEntities)(),[l,s]=(0,t.useState)(!1);return n?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,e.createElement)(gt,{href:E,className:a&&"qligg-premium-field",title:(0,r.__)("Add Personal Account","insta-gallery"),alert:(0,r.__)("To connect your Instagram feed, you need a Professional Instagram account (Business or Creator). This is required by Instagram in order to generate a valid access token.\n\nProfessional accounts are free and give you access to tools to help grow your audience.\n\nOnce you click the button, you'll be redirected to Instagram to authorize the connection. After that, you'll return to this page with your Access Token and User ID ready to use.\n\nLearn more: https://help.instagram.com/138925576505882/","insta-gallery")},(0,r.__)("Add Personal Account","insta-gallery")),(0,e.createElement)(gt,{href:y,className:a&&"qligg-premium-field",title:(0,r.__)("Add Professional Account","insta-gallery"),alert:(0,r.__)("To connect an advanced Instagram account, you'll need to log in with your Facebook account. This is because Instagram professional accounts are managed through Facebook (Meta).\n\nMake sure your Instagram account is linked to a Facebook Page and set as a Professional Account (Business or Creator).\n\nOnce you authorize access, you'll be redirected back to this page with your Access Token and User ID ready to use.\n\nLearn more: https://www.facebook.com/business/help/502981923235522","insta-gallery")},(0,r.__)("Add Professional Account","insta-gallery")),(0,e.createElement)("a",{className:P()("insta-gallery__account-link",a&&"qligg-premium-field"),href:"#",onClick:()=>s(!0)},(0,r.__)("Button not working?","insta-gallery")),(0,e.createElement)("span",{className:"qligg-premium-field"},(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("Multiple user accounts and professional accounts are premium features.","insta-gallery"))))),(0,e.createElement)(G,{show:l,className:"insta-gallery__modal--account",onClose:()=>s(!1),__experimentalHideHeader:!0},(0,e.createElement)(_t,{isOpen:l,setIsOpen:s}))):(0,e.createElement)(mt,null)},ht=t=>{const{setIsOpenPreview:a,setCurrentAccountIndex:n}=t,{createSuccessNotice:l,createErrorNotice:s}=(0,ot.useDispatch)(ct.store),{accounts:i,hasResolvedAccounts:o,deleteAccount:c}=(0,B.useAccountsEntities)();return o?(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)(ft,{...t}),i&&(0,e.createElement)(ut,null,(0,e.createElement)("thead",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Image","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Username","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Account","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Access Token","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Type","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Date","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Action","insta-gallery")))),(0,e.createElement)("tbody",null,i.map((t,r)=>(0,e.createElement)(pt,{key:t.id,index:r,account:t,deleteAccount:c,createSuccessNotice:l,createErrorNotice:s,setCurrentAccountIndex:n,setIsOpenPreview:a}))))):(0,e.createElement)(mt,null)},yt=()=>{const{Fill:a}=R(),[n,l]=(0,t.useState)(!1),[r,s]=(0,t.useState)(0),{accounts:i}=(0,B.useAccountsEntities)(),o={...b,account_id:i[r]?.id};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(a.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(a.Content,null,(0,e.createElement)(ht,{isOpenPreview:n,setIsOpenPreview:l,setCurrentAccountIndex:s}),(0,e.createElement)(G,{show:n,onClose:()=>l(!1),__experimentalHideHeader:!0},(0,e.createElement)(it,{feedSettings:o}))))},Et=[{label:(0,r.__)("General","insta-gallery"),name:"general"},{label:(0,r.__)("Responsive","insta-gallery"),name:"responsive"},{label:(0,r.__)("Profile","insta-gallery"),name:"profile"},{label:(0,r.__)("Carousel","insta-gallery"),name:"carousel"},{label:(0,r.__)("Box","insta-gallery"),name:"box"},{label:(0,r.__)("Image","insta-gallery"),name:"image"},{label:(0,r.__)("Card","insta-gallery"),name:"image-card"},{label:(0,r.__)("Modal","insta-gallery"),name:"image-modal"},{label:(0,r.__)("Button","insta-gallery"),name:"button"},{label:(0,r.__)("Button Load More","insta-gallery"),name:"button-load-more"}],bt={currentFeedIndex:null,currentTab:Et[0].name,prevPanel:null,currentFeedFormData:b},vt=(0,t.createContext)({}),At=()=>(0,t.useContext)(vt),kt=(e,t)=>{switch(t.type){case"SET_CURRENT_TAB":case"SET_CURRENT_FEED":case"SET_CURRENT_FEED_FORM_DATA":return{...e,...t.payload}}return e},wt=a=>{const{children:n}=a,[l,r]=(0,t.useReducer)(kt,bt),{feeds:s,createFeed:o,editFeed:c}=(0,B.useFeedsEntities)(),m=s[l.currentFeedIndex],u=(0,i.isEqual)(m,l.currentFeedFormData),d=["carousel"].includes(l.currentFeedFormData.layout)?l.currentTab:"carousel"===l.currentTab?"general":l.currentTab;return(0,e.createElement)(vt.Provider,{value:{...l,currentTab:d,setCurrentTab:e=>{l.currentTab!=e&&r({type:"SET_CURRENT_TAB",payload:{currentTab:e}})},setCurrentFeedIndex:(e=null)=>{r({type:"SET_CURRENT_FEED",payload:{currentFeedIndex:e,currentFeedFormData:s?.[e]||bt.currentFeedFormData}})},setCurrentFeedFormData:e=>{const t=S(l.currentFeedFormData,e);r({type:"SET_CURRENT_FEED_FORM_DATA",payload:{currentFeedFormData:void 0===t?"":t}})},feeds:s,createFeed:o,editFeed:c,isCurrentFeedDataModified:u}},n)},Nt=(vt.Consumer,!1!==window?.QLIGG_IS_PREMIUM);function St({isOpen:a,setIsOpen:n,isLoading:l,setIsLoading:s}){const{isCurrentFeedDataModified:i,currentFeedFormData:o}=At(),c=l||i||""==o.account_id;return(0,e.createElement)("div",{className:"media-frame-toolbar",style:{left:0}},(0,e.createElement)("div",{className:"media-toolbar"},(0,e.createElement)("div",{className:"media-toolbar-secondary"},!Nt&&(0,e.createElement)("div",{style:{float:"left",marginTop:19}},(0,t.createInterpolateElement)((0,r.__)("Help us to boost this plugin and <a>enjoy Premium benefits!</a>","insta-gallery"),{a:(0,e.createElement)("a",{href:"https://quadlayers.com/products/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_modal&utm_campaign=premium_upgrade&utm_content=premium_link",target:"_blank",rel:"noopener noreferrer"})})),(0,e.createElement)("span",{className:"settings-save-status media-button",style:{float:"left"}},l&&(0,e.createElement)("span",{style:{visibility:"visible"},className:"spinner"}))),(0,e.createElement)("div",{className:"media-toolbar-primary search-form"},(0,e.createElement)("button",{type:"submit",className:"media-modal-submit button button-primary media-button button-large ",disabled:c},(0,r.__)("Save","insta-gallery")),(0,e.createElement)("button",{type:"button",className:"media-modal-close button button-secondary media-button button-large",style:{height:"auto",float:"none",position:"inherit",padding:"inherit"},onClick:()=>n(!1)},(0,r.__)("Close","insta-gallery")))))}function xt({setIsOpen:t,isNewFeed:a,currentFeedId:n}){const{feeds:l,currentFeedIndex:s,setCurrentFeedIndex:i}=At(),o=s-1,c=s+1;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"edit-media-header"},!a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{type:"button",className:"left",disabled:!l[o],onClick:()=>{i(o)}},(0,e.createElement)("span",{className:"screen-reader-text"},(0,r.__)("Edit previous media item","insta-gallery"))),(0,e.createElement)("button",{type:"button",className:"right",disabled:!l[c],onClick:()=>{i(c)}},(0,e.createElement)("span",{className:"screen-reader-text"},(0,r.__)("Edit next media item","insta-gallery")))),(0,e.createElement)("button",{type:"button",className:"media-modal-close",onClick:()=>t(!1)},(0,e.createElement)("span",{className:"media-modal-icon"},(0,e.createElement)("span",{className:"screen-reader-text"},(0,r.__)("Close dialog","insta-gallery"))))),(0,e.createElement)("div",{className:"media-frame-title"},(0,e.createElement)("h1",null,(0,r.sprintf)((0,r.__)("Edit feed # %s","insta-gallery"),a?(0,r.__)("New","insta-gallery"):n))))}const Ct=[{name:"gallery",title:"Gallery",premium:!1},{name:"carousel",title:"Carousel",premium:!1},{name:"masonry",title:"Masonry",premium:!0},{name:"highlight",title:"Highlight",premium:!0}];function Pt(){const{currentFeedFormData:a,setCurrentFeedFormData:n}=At(),{accounts:l}=(0,B.useAccountsEntities)();return(0,t.useEffect)(()=>{1!==l?.length||a.account_id||a.source===l[0]?.id||n({account_id:l[0].id})},[l,n]),(0,t.useEffect)(()=>{const e=l?.find(e=>e.id===a.account_id);"PERSONAL"===e?.access_token_type&&(a.card?.likes_count||a.card?.comments_count)&&n({card:{...a.card,likes_count:!1,comments_count:!1}})},[a.account_id,l,a.card,n]),(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Account","insta-gallery")),(0,e.createElement)("select",{required:!0,value:a.account_id||"",onChange:e=>n({account_id:e.target.value})},(0,e.createElement)("option",{value:""},(0,r.__)("Please select an account","insta-gallery")),l.map((t,a)=>{const n=!window?.qligg_pro_backend&&a>0;return(0,e.createElement)("option",{key:a,value:t.id,disabled:n},t.username)})),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Please select an Instagram account","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},!!a.account_id&&!l&&(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifyContent:" left",alignItems:" center"}},(0,e.createElement)("small",null,(0,r.__)("No Instagram account connected. Please connect your account ","insta-gallery"),(0,e.createElement)("a",{href:"https://www.instagram.com/oauth/authorize?client_id=504270170253170&redirect_uri=https://socialfeed.quadlayers.com/instagram.php&response_type=code&scope=instagram_business_basic&state=http://localhost/wowmall/wp-admin/admin.php"},(0,r.__)("here.","insta-gallery")))),(0,e.createElement)("p",{className:"form-field form-field--source"},(0,e.createElement)("label",null,(0,r.__)("Source","insta-gallery")),(0,e.createElement)("span",null,(0,e.createElement)("input",{type:"radio",value:"username",checked:"username"===a.source,onChange:e=>n({source:e.target.value})}),(0,e.createElement)("label",null,(0,r.__)("Username","insta-gallery"))),(0,e.createElement)("span",null,(0,e.createElement)("input",{type:"radio",value:"tag",checked:"tag"===a.source,onChange:e=>{n({source:e.target.value})},disabled:"BUSINESS"!==l?.find(e=>e.id===a.account_id)?.access_token_type}),(0,e.createElement)("label",null,(0,r.__)("Hashtag","insta-gallery"))),(0,e.createElement)("span",{className:"qligg-premium-field"},(0,e.createElement)("input",{type:"radio",value:"tagged",checked:"tagged"===a.source,onChange:e=>{n({source:e.target.value})},disabled:"BUSINESS"!==l?.find(e=>e.id===a.account_id)?.access_token_type}),(0,e.createElement)("label",null,(0,r.__)("Tagged (Premium)","insta-gallery"))),(0,e.createElement)("span",{className:"qligg-premium-field"},(0,e.createElement)("input",{type:"radio",value:"stories",checked:"stories"===a.source,onChange:e=>{n({source:e.target.value})},disabled:"BUSINESS"!==l?.find(e=>e.id===a.account_id)?.access_token_type}),(0,e.createElement)("label",null,(0,r.__)("Stories (Premium)","insta-gallery")))),"BUSINESS"!==l?.find(e=>e.id===a.account_id)?.access_token_type&&(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Hashtag, Tagged, and Stories options are only available for professional accounts.","insta-gallery")))),"tag"===a.source&&"BUSINESS"===l?.find(e=>e.id===a.account_id)?.access_token_type&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Tag","insta-gallery")),(0,e.createElement)("input",{type:"text",required:!0,placeholder:"beautiful",value:a.tag,onChange:e=>{n({tag:e.target.value})}}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Please enter Instagram tag","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Order by","insta-gallery")),(0,e.createElement)("select",{required:!0,value:a.order_by,onChange:e=>{n({order_by:e.target.value})}},(0,e.createElement)("option",{value:"recent_media"},(0,r.__)("Recent (Within 24 hours)","insta-gallery")),(0,e.createElement)("option",{value:"top_media"},(0,r.__)("Top (Most popular first)","insta-gallery"))),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Please enter Instagram tag order","insta-gallery")))),"recent_media"===a.order_by?(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Due to the restrictions of the new Instagram API the recent order will only return the most recent images from the past 24 hours.","insta-gallery"))):(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Due to the restrictions of the new Instagram ","insta-gallery"),(0,e.createElement)("a",{target:"_blank",href:"https://quadlayers.com/documentation/instagram-feed-gallery/api/business/?utm_source=qligg_plugin&utm_medium=admin_modal&utm_campaign=documentation&utm_content=api_link",rel:"noreferrer"},(0,r.__)("API","insta-gallery")),(0,r.__)(" it is necessary to connect a professional account ","insta-gallery"),(0,e.createElement)("a",{target:"_blank",href:"https://quadlayers.com/documentation/instagram-feed-gallery/api/business/?utm_source=qligg_plugin&utm_medium=admin_modal&utm_campaign=documentation&utm_content=business_link",rel:"noreferrer"},(0,r.__)("here.","insta-gallery")))),(0,e.createElement)("p",{className:"form-field notice info",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifyContent:" left",alignItems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Instagram API limitation: You are limited to 30 unique hashtags in a 7-day period.","insta-gallery"))))),"tagged"===a.source&&"BUSINESS"===l?.find(e=>e.id===a.account_id)?.access_token_type&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field notice info",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifyContent:" left",alignItems:" center"}},(0,e.createElement)("small",null,(0,r.__)("This feed will display photos where your Instagram account has been tagged by other users.","insta-gallery"))))),"stories"===a.source&&"BUSINESS"===l?.find(e=>e.id===a.account_id)?.access_token_type&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field notice info",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifyContent:" left",alignItems:" center"}},(0,e.createElement)("small",null,(0,r.__)("This feed will display your active Instagram stories. Stories expire after 24 hours.","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("ul",{className:"list-images"},Ct.map(({name:t,title:l,premium:s})=>"stories"===a.source&&"carousel"===t?null:(0,e.createElement)("li",{key:t,className:P()(a.layout===t&&"active",s&&"qligg-premium-field"),onClick:()=>{n({layout:t})}},(0,e.createElement)("span",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},(0,e.createElement)("label",null,l),(0,e.createElement)("img",{src:A(`/assets/backend/img/${t}.png`)}),s&&(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(Premium)","insta-gallery"))))))))),"tag"!==a.source&&"stories"!==a.source&&(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Reels","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!a.reel.hide,onChange:e=>n({reel:{hide:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Hide reels from feed","insta-gallery"))))),"gallery"===a.layout&&(0,e.createElement)("div",{className:"options_group qligg-premium-field"},(0,e.createElement)("p",{class:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Aspect Ratio","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"1",max:"100",value:a.aspect_ratio?.width||1,onChange:e=>{const t=parseInt(e.target.value),l=isNaN(t)?1:Math.min(Math.max(t,1),100);n({aspect_ratio:{...a.aspect_ratio,width:l}})},placeholder:"Width"}),(0,e.createElement)("span",null,":"),(0,e.createElement)("input",{type:"number",min:"1",max:"100",value:a.aspect_ratio?.height||1,onChange:e=>{const t=parseInt(e.target.value),l=isNaN(t)?1:Math.min(Math.max(t,1),100);n({aspect_ratio:{...a.aspect_ratio,height:l}})},placeholder:"Height"}),(0,e.createElement)("label",null,(0,r.__)("(Premium)","insta-gallery")))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Copyrighted","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!a.copyright.hide,onChange:e=>n({copyright:{hide:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Hide the feeds that have copyright","insta-gallery")))),(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Videos containing copyrighted material will not be played. Instead, they will be displayed as images.","insta-gallery")))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Limit","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"1",max:"50",required:!0,value:a.limit,onChange:e=>n({limit:e.target.value})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Number of images to display","insta-gallery"))))),["highlight","highlight-square"].includes(a.layout)&&(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Highlight by tag","insta-gallery")),(0,e.createElement)("textarea",{placeholder:"tag1, tag2, tag3",value:a.highlight.tag,onChange:e=>n({highlight:{tag:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Highlight feeds items with this tags","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Highlight by id","insta-gallery")),(0,e.createElement)("textarea",{placeholder:"101010110101010",onChange:e=>n({highlight:{id:e.target.value}}),value:a.highlight.id}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Highlight feeds items with this ids","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Highlight by position","insta-gallery")),(0,e.createElement)("textarea",{placeholder:"1, 5, 7",onChange:e=>n({highlight:{position:e.target.value}}),value:a.highlight.position}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Highlight feeds items in this positions","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))))}const It=window.wp.blockEditor;function Tt(t){const{label:a}=t;return(0,e.createElement)("div",{className:"ql-color-palette-picker",onClick:e=>{e.preventDefault()}},(0,e.createElement)(It.ColorPaletteControl,{...t,showTitle:!!a}))}function Ft(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group qligg-premium-field"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.box.display,onChange:e=>a({box:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display the Instagram Feed inside a customizable box","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("div",{className:P()("options_group qligg-premium-field",!t.box.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Padding","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"0",max:"300",required:!!t.box.display,value:t.box.padding,onChange:e=>a({box:{padding:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Add padding to the box","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Radius","insta-gallery")),(0,e.createElement)("input",{min:"0",max:"1000",type:"number",required:!!t.box.display,value:t.box.radius,onChange:e=>a({box:{radius:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Add radius to the box","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background","insta-gallery")),(0,e.createElement)(Tt,{value:t.box.background,color:t.box.background,onChange:e=>a({box:{background:e}}),disableCustomColors:!1,label:(0,r.__)("Change background color in box","insta-gallery")}),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text color","insta-gallery")),(0,e.createElement)(Tt,{value:t.box.text_color,color:t.box.text_color,onChange:e=>a({box:{text_color:e}}),disableCustomColors:!1,label:(0,r.__)("Change text color in box","insta-gallery")}),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))))}function Ot(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel qligg-premium-field"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Centered Slides","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:t.carousel.centered_slides,onChange:e=>a({carousel:{centered_slides:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Center slides in carousel.","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Autoplay","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:t.carousel.autoplay,onChange:e=>a({carousel:{autoplay:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Autoplay carousel items","insta-gallery")))),(0,e.createElement)("p",{className:P()("form-field",!t.carousel.autoplay&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Autoplay Interval","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"1000",max:"300000",step:"100",value:t.carousel.autoplay_interval,onChange:e=>a({carousel:{autoplay_interval:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Moves carousel after a certain amount of time ","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Navigation","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:t.carousel.navarrows,onChange:e=>a({carousel:{navarrows:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display navigation arrows","insta-gallery")))),(0,e.createElement)("div",{className:P()("form-field",!t.carousel.navarrows&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Navigation color","insta-gallery")),(0,e.createElement)(Tt,{value:t.carousel.navarrows_color,color:t.carousel.navarrows_color,onChange:e=>a({carousel:{navarrows_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change navigation arrows color","insta-gallery")}))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Pagination","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:t.carousel.pagination,onChange:e=>a({carousel:{pagination:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display pagination dots","insta-gallery")))),(0,e.createElement)("div",{className:P()("form-field",!t.carousel.pagination&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Pagination color","insta-gallery")),(0,e.createElement)(Tt,{value:t.carousel.pagination_color,color:t.carousel.pagination_color,onChange:e=>a({carousel:{pagination_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change pagination dots color","insta-gallery")}))))}function Rt(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At(),{accounts:n}=(0,B.useAccountsEntities)();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Lazy load","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.lazy,onChange:e=>a({lazy:!!e.target.checked})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Defers image load","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Mask","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.mask.display,onChange:e=>a({mask:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display mask on hover","insta-gallery")))),(0,e.createElement)("div",{className:P()("form-field",!t.mask.display&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Background","insta-gallery")),(0,e.createElement)(Tt,{value:t.mask.background,color:t.mask.background,onChange:e=>a({mask:{background:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background color in mask","insta-gallery")}))),(0,e.createElement)("div",{className:"options_group"},"BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type&&(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Likes and comments options are only available for professional account.","insta-gallery"))),(0,e.createElement)("p",{className:P()("form-field",!t.mask.display&&"disabled-field","BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Likes count","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.mask.likes_count,onChange:e=>a({mask:{likes_count:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display likes count in mask","insta-gallery")))),(0,e.createElement)("p",{className:P()("form-field",!t.mask.display&&"disabled-field","BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Comments count","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:t.mask.comments_count,onChange:e=>a({mask:{comments_count:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display comments count in mask","insta-gallery")))),(t.mask.comments_count||t.mask.likes_count)&&(0,e.createElement)("p",{className:P()("form-field",!t.mask.display&&"disabled-field")},(0,e.createElement)("label",null,(0,r.__)("Icons color","insta-gallery")),(0,e.createElement)(Tt,{value:t.mask.icon_color,color:t.mask.icon_color,onChange:e=>a({mask:{icon_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change icons color in mask","insta-gallery")}))))}function Dt(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At(),{accounts:n}=(0,B.useAccountsEntities)();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group qligg-premium-field"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.card.display,onChange:e=>a({card:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display card in image","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("div",{className:P()("options_group qligg-premium-field",!t.card.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Radius","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"0",max:"1000",required:!!t.card.display,value:t.card.radius,onChange:e=>a({card:{radius:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Add radius to the card","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Font size","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"8",max:"36",required:!!t.card.display,value:t.card.font_size,onChange:e=>a({card:{font_size:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Change font size in cards","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background","insta-gallery")),(0,e.createElement)(Tt,{value:t.card.background,color:t.card.background,onChange:e=>a({card:{background:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background color in cards","insta-gallery")}),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background hover","insta-gallery")),(0,e.createElement)(Tt,{value:t.card.background_hover,color:t.card.background_hover,onChange:e=>a({card:{background_hover:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background color hover in cards","insta-gallery")}),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text color","insta-gallery")),(0,e.createElement)(Tt,{value:t.card.text_color,color:t.card.text_color,onChange:e=>a({card:{text_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change text color","insta-gallery")}),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Padding","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"0",max:"20",value:t.card.padding,required:!!t.card.display,onChange:e=>a({card:{padding:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Add padding in cards","insta-gallery")))),"BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type&&(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Likes and comments options are only available for professional account.","insta-gallery"))),(0,e.createElement)("div",{className:P()("BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Likes","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.card.likes_count,onChange:e=>a({card:{likes_count:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display likes count in cards","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Comments","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.card.comments_count,onChange:e=>a({card:{comments_count:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display comments count in cards","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Length","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"1",max:"100",value:t.card.text_length,required:!!t.card.display,onChange:e=>a({card:{text_length:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Limit the length of the description in the card","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text align","insta-gallery")),(0,e.createElement)("select",{value:t.card.text_align||"",onChange:e=>a({card:{text_align:e.target.value}})},[{name:"left",label:(0,r.__)("Left","insta-gallery")},{name:"center",label:(0,r.__)("Center","insta-gallery")},{name:"right",label:(0,r.__)("Right","insta-gallery")}].map(({name:t,label:a})=>(0,e.createElement)("option",{key:t,value:t},a))),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Align description in card","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))))}function qt(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At(),{accounts:n}=(0,B.useAccountsEntities)(),l="BUSINESS"!=n?.find(e=>e.id===t.account_id)?.access_token_type;return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.display,onChange:e=>a({modal:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display modal by clicking on image","insta-gallery"))))),(0,e.createElement)("div",{className:P()("options_group",!t.modal.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Sidebar align","insta-gallery")),(0,e.createElement)("select",{value:t.modal.modal_align||"",onChange:e=>{a({modal:{modal_align:e.target.value}})}},[{value:"top",label:(0,r.__)("Top","insta-gallery")},{value:"right",label:(0,r.__)("Right","insta-gallery")},{value:"bottom",label:(0,r.__)("Bottom","insta-gallery")},{value:"left",label:(0,r.__)("Left","insta-gallery")}].map(({value:t,label:a})=>(0,e.createElement)("option",{key:t,value:t},a))),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Align sidebar in modal on desktop","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Profile","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.profile,onChange:e=>a({modal:{profile:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display user profile or tag info","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),l&&(0,e.createElement)("p",{className:"form-field notice error",style:{marginBottom:"15px",paddingTop:" 10px",paddingBottom:" 10px",display:" flex",justifycontent:" left",alignitems:" center"}},(0,e.createElement)("small",null,(0,r.__)("Likes and comments options are only available for professional account.","insta-gallery"))),(0,e.createElement)("div",{className:P()(!t.modal.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Show likes count","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.likes_count,onChange:e=>a({modal:{likes_count:!!e.target.checked}}),disabled:l}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display likes count in sidebar","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Show comments count","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.comments_count,onChange:e=>a({modal:{comments_count:!!e.target.checked}}),disabled:l}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display comments count in sidebar","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Show description","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.media_description,onChange:e=>a({modal:{media_description:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display description in the sidebar","insta-gallery")))))),(0,e.createElement)("div",{className:"options_group qligg-premium-field"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Show comments list","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.modal.comments_list,onChange:e=>a({modal:{comments_list:!!e.target.checked}}),disabled:l}),(0,e.createElement)("span",{className:"description qligg-premium-field"},"stories"!==t.source?(0,e.createElement)("small",null,(0,r.__)("Display comments list in sidebar","insta-gallery")):(0,e.createElement)("small",null,(0,r.__)("Comments option for Instagram feeds (all sources except Stories)","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field qligg-premium-field"},(0,e.createElement)("label",null,(0,r.__)("Text align","insta-gallery")),(0,e.createElement)("select",{value:t.modal.text_align||"",onChange:e=>a({modal:{text_align:e.target.value}})},[{name:"left",label:(0,r.__)("Left","insta-gallery")},{name:"center",label:(0,r.__)("Center","insta-gallery")},{name:"right",label:(0,r.__)("Right","insta-gallery")}].map(({name:t,label:a})=>(0,e.createElement)("option",{key:t,value:t},a))),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Align description in sidebar","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field qligg-premium-field"},(0,e.createElement)("label",null,(0,r.__)("Font size","insta-gallery")),(0,e.createElement)("input",{type:"number",min:"8",max:"36",value:t.modal.font_size,required:!!t.modal.display,onChange:e=>a({modal:{font_size:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Change font size in sidebar","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))))}function Mt(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.button.display,onChange:e=>a({button:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display the button to open Instagram site link","insta-gallery"))))),(0,e.createElement)("div",{className:P()("options_group",!t.button.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:"Instagram",value:t.button.text,onChange:e=>a({button:{text:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Change button text","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text color","insta-gallery")),(0,e.createElement)(Tt,{value:t.button.text_color,color:t.button.text_color,onChange:e=>a({button:{text_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change Color text in button","insta-gallery")})),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background","insta-gallery")),(0,e.createElement)(Tt,{value:t.button.background,color:t.button.background,onChange:e=>a({button:{background:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background color in button","insta-gallery")})),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background hover","insta-gallery")),(0,e.createElement)(Tt,{value:t.button.background_hover,color:t.button.background_hover,onChange:e=>a({button:{background_hover:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background hover in button","insta-gallery")}))))}function Lt(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group qligg-premium-field"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.button_load.display,onChange:e=>a({button_load:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display the button to load more videos","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("div",{className:P()('"options_group',!t.button_load.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:"Instagram",value:t.button_load.text,onChange:e=>a({button_load:{text:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Change button text","insta-gallery")))),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Text color","insta-gallery")),(0,e.createElement)(Tt,{value:t.button_load.text_color,color:t.button_load.text_color,onChange:e=>a({button_load:{text_color:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change Color text in button","insta-gallery")})),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background","insta-gallery")),(0,e.createElement)(Tt,{value:t.button_load.background,color:t.button_load.background,onChange:e=>a({button_load:{background:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background color in button","insta-gallery")})),(0,e.createElement)("div",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Background hover","insta-gallery")),(0,e.createElement)(Tt,{value:t.button_load.background_hover,color:t.button_load.background_hover,onChange:e=>a({button_load:{background_hover:e}}),disableCustomColors:!1,enableAlpha:!0,label:(0,r.__)("Change background hover in button","insta-gallery")}))))}var jt=a(736),Bt=a.n(jt);class Gt extends t.Component{constructor(){super(...arguments),this.updateAttachmentInfo=this.updateAttachmentInfo.bind(this),this.params={height:250,width:250,flex_width:!0,flex_height:!0}}onChange(e){this.props.onChange({attachment_id:e.id,name:e.name,x:0,y:0,url:e.url,type:e.type})}initFrame(){document.querySelector(".media-modal-close"),this.frame=wp.media({button:{text:(0,r.__)("Select","insta-gallery"),close:!1},states:[new wp.media.controller.Library({title:(0,r.__)("Select logo","insta-gallery"),library:wp.media.query({type:this.props.allowedTypes||["image"]}),multiple:!1,date:!1,priority:20,suggestedWidth:(this.props.logo||{}).width,suggestedHeight:(this.props.logo||{}).height}),...(this.props.skipCrop,[])]}),this.frame.on("select",this.onSelect,this),this.frame.on("close",()=>{this.props.onFrameClose&&this.props.onFrameClose()}),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)}openFrame(){this.initFrame(),this.frame.setState("library").open(),this.props.onFrameOpen&&this.props.onFrameOpen()}onSelect(){const e=this.frame.state().get("selection").first().toJSON();(this.props.logo||{}).width===e.width&&(this.props.logo||{}).height===e.height&&!(this.props.logo||{}).flex_width&&!(this.props.logo||{}).flex_height||this.props.skipCrop,this.setImageFromAttachment(e),this.frame.close()}onCropped(e){this.setImageFromAttachment(e)}calculateImageSelectOptions(e,t){const a=t.get("control"),n=!!parseInt((a.props.logo||{}).flex_width,10),l=!!parseInt((a.props.logo||{}).flex_height,10),r=e.get("width"),s=e.get("height");let i=parseInt((a.props.logo||{}).width,10),o=parseInt((a.props.logo||{}).height,10);const c=i/o,m=i,u=o;let d,p,g;return t.set("canSkipCrop",!a.mustBeCropped(n,l,i,o,r,s)),r/s>c?(o=s,i=o*c):(i=r,o=i/c),d=(r-i)/2,p=(s-o)/2,g={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:r,imageHeight:s,minWidth:m>i?i:m,minHeight:u>o?o:u,x1:d,y1:p,x2:i+d,y2:o+p},!1===l&&!1===n&&(g.aspectRatio=i+":"+o),!0===l&&(delete g.minHeight,g.maxWidth=r),!0===n&&(delete g.minWidth,g.maxHeight=s),g}mustBeCropped(e,t,a,n,l,r){return!(!0===e&&!0===t||!0===e&&n===r||!0===t&&a===l||a===l&&n===r||l<=a)}onSkippedCrop(){const e=this.frame.state().get("selection").first().toJSON();this.setImageFromAttachment(e)}setImageFromAttachment(e){this.onChange(e),this.updateAttachmentInfo()}updateAttachmentInfo(e=!1){const t=this.props.value?.attachment_id;t&&(this.detachListener(),wp.media.attachment(t).on("change",this.updateAttachmentInfo))}detachListener(){this.props.value?.attachment_id&&wp.media.attachment(this.props.value.attachment_id).off("change",this.updateAttachmentInfo)}componentDidMount(){this.updateAttachmentInfo()}componentWillUnmount(){this.detachListener()}render(){return(0,e.createElement)("div",{className:P()("insta-gallery-control-media-upload__attachment",this.props.value?.attachment_id&&this.props.value&&"is-active"),...this.props.attr||{}},(this.props.value?.attachment_id||this.props.value?.url)&&(0,e.createElement)("div",{className:"thumbnail thumbnail-image",onClick:()=>!this.props.allowPositionPicker&&this.openFrame()},!this.props.allowPositionPicker&&(0,e.createElement)("img",{className:"attachment-thumb",src:this.props.value?.url||"",draggable:"false",alt:""})),(0,e.createElement)("div",{className:"insta-gallery-control-media-upload__attachment__actions"},this.props.value?.attachment_id||this.props.value?.url?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(T.Button,{disabled:!(Number(this.props.value?.attachment_id)>1)&&"function"!=typeof this.props.onRemove,onClick:()=>{"function"!=typeof this.props.onRemove?this.props.onChange():this.props.onRemove()}},(0,r.__)("Remove","insta-gallery")),(0,e.createElement)(T.Button,{isBordered:!0,onClick:()=>this.openFrame()},this.props.filledLabel||(0,r.__)("Change","insta-gallery"))):(0,e.createElement)(T.Button,{className:P()("insta-gallery-control-media-upload__attachment__upload","upload_image_button button"),onClick:()=>this.openFrame(),style:{display:"inline-block"}},this.props.emptyLabel||(0,r.__)("Select image","insta-gallery"))))}}Gt.renderingConfig={hasRevertButton:!1},Gt.propTypes={value:Bt().object,onChange:Bt().func};const Ut=Gt;function Ht(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At();return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"qligg-premium-field",style:{display:"flex"}},(0,e.createElement)("div",{className:"options_group",style:{width:"70%"}},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Display","insta-gallery")),(0,e.createElement)("input",{type:"checkbox",checked:!!t.profile.display,onChange:e=>a({profile:{display:!!e.target.checked}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Display user profile or tag info","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),(0,e.createElement)("div",{className:P()(!t.profile.display&&"disabled-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Full name","insta-gallery")),(0,e.createElement)("input",{type:"text",onChange:e=>{a({profile:{nickname:e.target.value}})},value:t.profile.nickname}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Feed profile full name","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Follow text","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:"Instagram",value:t.profile.link_text,onChange:e=>a({profile:{link_text:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Follow text here","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Website","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:"",value:t.profile.website,onChange:e=>a({profile:{website:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Website url here","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Website link text","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:"Instagram",value:t.profile.website_text,onChange:e=>a({profile:{website_text:e.target.value}})}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Website link text here","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))),(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Biography","insta-gallery")),(0,e.createElement)("input",{type:"text",placeholder:(0,r.__)("Feed profile biography","insta-gallery"),onChange:e=>a({profile:{biography:e.target.value}}),value:t.profile.biography}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("Profile description here","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery")))))),(0,e.createElement)("div",{className:P()("attachment-info options_group",!t.profile.display&&"disabled-field"),style:{width:"30%"}},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("div",{className:"details"},(0,e.createElement)("div",{className:"filename"},(0,e.createElement)("strong",null,(0,r.__)("Feed","insta-gallery"),":"),t.account_id)),(0,e.createElement)("div",{className:"avatar-panel-info"},(0,e.createElement)("div",{className:"avatar-panel-info__settings"},(0,e.createElement)("img",{alt:"avatar",className:"avatar-panel-info__img",src:t.profile.avatar?t.profile.avatar:"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g",width:"150",height:"150"}),(0,e.createElement)("div",{className:"avatar-panel-info__buttons"},(0,e.createElement)(Ut,{onChange:e=>{a({profile:{avatar:e.url}})}}),(0,e.createElement)("button",{onClick:()=>a({profile:{avatar:""}}),className:"remove_image_button button",disabled:!t.profile.avatar},"×"))))))))}const zt=[{key:"desktop",label:(0,r.__)("Desktop","insta-gallery"),icon:"desktop"},{key:"tablet",label:(0,r.__)("Tablet","insta-gallery"),icon:"tablet"},{key:"mobile",label:(0,r.__)("Mobile","insta-gallery"),icon:"smartphone"}],Wt={desktop:{columns:3,spacing:10},tablet:{columns:2,spacing:8},mobile:{columns:1,spacing:6},breakpoints:{tablet:768,mobile:480}},Vt=({label:t,min:a,max:n,value:l,onChange:r,description:s,disabled:i})=>(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,t),(0,e.createElement)("input",{type:"number",min:a,max:n,value:l,onChange:r,disabled:i}),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,s)));function $t(){const{currentFeedFormData:t,setCurrentFeedFormData:a}=At(),n=t.responsive||Wt;t.responsive||a({responsive:Wt});const l=(e,t,l)=>{a({responsive:{...n,[e]:{...n[e],[t]:l}}})};return(0,e.createElement)("div",{className:"insta-gallery__modal__panel"},(0,e.createElement)("div",{className:"options_group"},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,r.__)("Responsive","insta-gallery")),(0,e.createElement)("span",{className:"description"},(0,e.createElement)("small",null,(0,r.__)("These responsive settings will override the main feed settings for different screen sizes.","insta-gallery"))),(0,e.createElement)("span",{className:"description hidden"},(0,e.createElement)("small",null,(0,r.__)("(This is a premium feature)","insta-gallery"))))),zt.map(({key:t,label:s,icon:i})=>(0,e.createElement)("div",{key:t,className:P()("options_group","desktop"!==t&&"qligg-premium-field")},(0,e.createElement)("p",{className:"form-field"},(0,e.createElement)("label",null,(0,e.createElement)("span",{className:`dashicons dashicons-${i}`})," ",s)),"desktop"!==t&&(0,e.createElement)(Vt,{label:(0,r.__)("Breakpoint (px)","insta-gallery"),min:320,max:"tablet"===t?1200:767,value:n.breakpoints?.[t]||Wt.breakpoints[t],onChange:e=>{return l=t,r=parseInt(e.target.value),void a({responsive:{...n,breakpoints:{...n.breakpoints,[l]:r}}});var l,r},description:(0,r.sprintf)((0,r.__)("Screen width at which %s layout starts","insta-gallery"),s)}),(0,e.createElement)(Vt,{label:(0,r.__)("Columns","insta-gallery"),min:1,max:"desktop"===t?10:"tablet"===t?8:6,value:n[t]?.columns||Wt[t].columns,onChange:e=>l(t,"columns",parseInt(e.target.value)),description:(0,r.sprintf)((0,r.__)("Number of columns for %s devices","insta-gallery"),s)}),(0,e.createElement)(Vt,{label:(0,r.__)("Spacing","insta-gallery"),min:0,max:50,value:n[t]?.spacing||Wt[t].spacing,onChange:e=>l(t,"spacing",parseInt(e.target.value)),description:(0,r.__)("Space between items in pixels","insta-gallery")}))))}function Jt(){const{currentTab:t}=At();switch(t){case"general":return(0,e.createElement)(Pt,null);case"profile":return(0,e.createElement)(Ht,null);case"box":return(0,e.createElement)(Ft,null);case"carousel":return(0,e.createElement)(Ot,null);case"image":return(0,e.createElement)(Rt,null);case"image-card":return(0,e.createElement)(Dt,null);case"image-modal":return(0,e.createElement)(qt,null);case"button":return(0,e.createElement)(Mt,null);case"button-load-more":return(0,e.createElement)(Lt,null);case"responsive":return(0,e.createElement)($t,null);default:return t}}function Yt(){const{setCurrentTab:t,currentTab:a}=At(),{currentFeedFormData:n}=At(),l=Et.filter(({name:e})=>!("carousel"===e&&!["carousel"].includes(n.layout)));return(0,e.createElement)("ul",{className:"insta-gallery-modal__tabs"},l.map(({name:n,label:l})=>(0,e.createElement)("li",{key:n,className:P()("media-modal-tab",n==a&&"active")},(0,e.createElement)("a",{href:"#",onClick:e=>{e.preventDefault(),t(n)}},(0,e.createElement)("span",null,l)))).filter(e=>!!e))}function Qt({isOpen:a,setIsOpen:n}){const{currentFeedIndex:l,currentFeedFormData:r,feeds:s,createFeed:i,editFeed:o}=At(),[c,m]=(0,t.useState)(!1),u=s?.[l]?.id,d=void 0===u;return(0,e.createElement)("div",null,(0,e.createElement)("form",{className:"media-modal-form",onSubmit:async e=>{let t;e.preventDefault(),m(!0),t=d?await i(r):await o(r),m(!1),t&&n(!1)}},(0,e.createElement)("div",{className:"media-modal-content"},(0,e.createElement)("div",{className:"edit-attachment-frame mode-select"},(0,e.createElement)(xt,{isOpen:a,setIsOpen:n,isNewFeed:d,currentFeedId:u}),(0,e.createElement)("div",{className:"media-frame-content",style:{bottom:61}},(0,e.createElement)("div",{className:"attachment-details",style:{overflow:"hidden"}},(0,e.createElement)("div",{className:"attachment-media-view landscape"},(0,e.createElement)("div",{style:{height:"100%"}},(0,e.createElement)(Yt,null),(0,e.createElement)("div",{style:{height:"100%",overflowX:"hidden"}},(0,e.createElement)(Jt,null)))))),(0,e.createElement)(St,{isOpen:a,setIsOpen:n,isLoading:c,setIsLoading:m})))))}function Zt({setIsOpen:a,setIsOpenPreview:n}){const[l,s]=(0,t.useState)({currentFeedId:null,isLoading:!1}),{createSuccessNotice:i,createErrorNotice:o}=(0,ot.useDispatch)(ct.store),{feeds:c,hasResolvedFeeds:m,deleteFeed:u}=(0,B.useFeedsEntities)(),{accounts:d,hasAccounts:p}=(0,B.useAccountsEntities)(),{setCurrentFeedIndex:g}=At();return m?(0,e.createElement)("div",{className:"welcome-tab wrap about-wrap full-width-layout"},(0,e.createElement)("div",null,p&&(0,e.createElement)("button",{disabled:!p,className:"button button-primary",onClick:()=>{g(),a(!0)}},(0,r.__)("+ Feed","insta-gallery")),!p&&(0,e.createElement)(ft,null),(0,e.createElement)(ut,null,(0,e.createElement)("thead",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Image","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Account","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Type","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Source","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Layout","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Shortcode","insta-gallery")),(0,e.createElement)("th",null,(0,r.__)("Actions","insta-gallery")))),(0,e.createElement)("tbody",null,c?.map((t,c)=>{const m=d.find(e=>e.id===t.account_id);return(0,e.createElement)("tr",{key:c},(0,e.createElement)("td",{width:"1%"},(0,e.createElement)("img",{className:"avatar",src:m?.avatar||"http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g",alt:m?.username||""})),(0,e.createElement)("td",{width:"1%"},m?.username),(0,e.createElement)("td",{width:"1%"},m?.access_token_type),(0,e.createElement)("td",{width:"1%"},t.source),(0,e.createElement)("td",null,t.layout),(0,e.createElement)("td",null,(0,e.createElement)("input",{type:"text",value:`[insta-gallery id="${t.id}"]`,readOnly:!0}),(0,e.createElement)("button",{className:"button button-secondary",onClick:async()=>{await k(`[insta-gallery id="${t.id}"]`)?i((0,r.__)("Feed shortcode copied to clipboard.","insta-gallery"),{id:1,type:"snackbar"}):o((0,r.__)("Can't copy the access token.","insta-gallery"),{id:2,type:"snackbar"})}},(0,e.createElement)("i",{className:"dashicons dashicons-admin-page"}))),(0,e.createElement)("td",null,(0,e.createElement)("button",{className:"button button-primary",title:(0,r.__)("Edit feed","insta-gallery"),onClick:()=>{g(c),a(!0)}},(0,r.__)("Edit")),(0,e.createElement)("button",{className:"button button-secondary",title:(0,r.__)("Clear feed cache","insta-gallery"),onClick:async()=>{confirm((0,r.__)("You are about to reset the cache of this feed.","insta-gallery"))&&(s({isloading:!0,currentFeedId:t.id}),await(0,B.clearFeedCache)({method:"POST",data:{feedSettings:t}}),s({isLoading:!1}))}},(0,e.createElement)("i",{className:"dashicons dashicons dashicons-update"}),(0,r.__)("Cache","insta-gallery")),(0,e.createElement)("button",{className:"button button-secondary",title:(0,r.__)("Delete feed","insta-gallery"),onClick:async()=>{confirm((0,r.__)("You are about to delele this feed.","insta-gallery"))&&(s({isloading:!0,currentFeedId:t.id}),await u(t),s({isLoading:!1}))}},(0,e.createElement)("i",{className:"dashicons dashicons-trash"})),(0,e.createElement)("button",{className:"button button-secondary",title:(0,r.__)("Preview feed","insta-gallery"),onClick:()=>{g(c),n(!0)}},(0,e.createElement)("i",{className:"dashicons dashicons-format-gallery"})),l&&l.currentFeedId===t.id&&(0,e.createElement)("span",{style:{visibility:"visible",position:"absolute"},className:"spinner"})))}))))):(0,e.createElement)(mt,null)}function Xt(){const{currentFeedIndex:a,feeds:n}=At(),l=n?.[a],r=(0,t.useRef)(null),[s,i]=(0,t.useState)(null);return(0,t.useEffect)(()=>{r?.current&&!s&&i(r.current)},[r]),(0,e.createElement)("div",{className:"instagram-gallery-feed",ref:r,id:`instagram-gallery-feed-${l.id}`},!!s&&(0,e.createElement)(W,null,(0,e.createElement)(st,{target:s,feedSettings:l})))}const Kt=()=>{const{Fill:a}=R(),[n,l]=(0,t.useState)(!1),[r,s]=(0,t.useState)(!1);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(a.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(a.Content,null,(0,e.createElement)(wt,null,(0,e.createElement)(Zt,{isOpen:n,setIsOpen:l,isOpenPreview:r,setIsOpenPreview:s}),(0,e.createElement)(G,{show:n,onClose:()=>l(!1),__experimentalHideHeader:!0},(0,e.createElement)(Qt,{isOpen:n,setIsOpen:l})),(0,e.createElement)(G,{show:r,onClose:()=>s(!1),__experimentalHideHeader:!0},(0,e.createElement)(Xt,null)))))},ea=()=>{const{Fill:t}=R();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(t.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(t.Content,null,(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)("div",{className:"has-2-columns is-wider-left"},(0,e.createElement)("div",{className:"column"},(0,e.createElement)("div",{className:"welcome-header"},(0,e.createElement)("h1",null,(0,r.__)("Premium","insta-gallery")),(0,e.createElement)("div",{className:"about-description"},(0,r.sprintf)((0,r.__)("Unlock the power of our premium %s plugin which allows you to choose between six beautiful layouts and tone of customizing options.","insta-gallery"),o)),(0,e.createElement)("br",null),(0,e.createElement)(M,{href:"https://quadlayers.com/products/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=premium_upgrade&utm_content=purchase_button",target:"_blank"},(0,r.__)("Purchase Now","insta-gallery")),(0,e.createElement)(M,{isSecondary:!0,href:"https://quadlayers.com/demo/instagram-feed-gallery/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=demo&utm_content=demo_button",target:"_blank"},(0,r.__)("View demo","insta-gallery"))),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Multiple account","insta-gallery")),(0,e.createElement)("p",null,(0,r.__)("Include unlimited user accounts and create feeds galleries for different users with their own layout and settings.","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Customize colors","insta-gallery")),(0,e.createElement)("p",null,(0,r.__)("Customize the colors of the Instagram Feed with a custom background, padding, and a rounded border. It also includes the user or tag profile info in the header of the box","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Load more button","insta-gallery")),(0,e.createElement)("p",null,(0,r.__)("Allow your users to load more images in the gallery providing an improved user experience.","insta-gallery")))),(0,e.createElement)("div",{className:"column"},(0,e.createElement)("img",{src:A("/assets/backend/img/instagram-feed.png")}))),(0,e.createElement)("div",{className:"has-2-columns is-wider-left"},(0,e.createElement)("div",{className:"column"},(0,e.createElement)("img",{src:A("/assets/backend/img/instagram-feed-popup-macbook.png")})),(0,e.createElement)("div",{className:"column"},(0,e.createElement)("br",null),(0,e.createElement)("div",{className:"welcome-header"},(0,e.createElement)("h2",null,(0,r.__)("More content","insta-gallery")),(0,e.createElement)("div",{className:"about-description"},(0,r.__)("Include some extra content for the images and the Image modal.","insta-gallery"))),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("p",null,(0,r.__)("Our premium version allows you to include a beautiful card around the video where you can display the number of comments, likes, and video descriptions.","insta-gallery"))))),(0,e.createElement)("div",{className:"has-2-columns is-wider-left"},(0,e.createElement)("div",{className:"column"},(0,e.createElement)("div",{className:"welcome-header"},(0,e.createElement)("h1",null,(0,r.__)("Layouts","insta-gallery")),(0,e.createElement)("div",{className:"about-description"},(0,r.__)("Unlock the power of the masonry and highlight layouts that allows you to display the Instagram Feeds in a grid that supports items of variable size.","insta-gallery"))),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Masonry layout","insta-gallery")),(0,e.createElement)("p",null,(0,r.__)("The masonry layout is a grid that displays the images with a fixed with and variable height size","insta-gallery"))),(0,e.createElement)("div",{className:"feature-section"},(0,e.createElement)("h3",null,(0,r.__)("Highlight layout","insta-gallery")),(0,e.createElement)("p",null,(0,r.__)("The highlight layout is a masonry grid that allows you to stand out some images with two or three columns width size.","insta-gallery")))),(0,e.createElement)("div",{className:"column"},(0,e.createElement)("img",{src:A("/assets/backend/img/instagram-feed-load-more.png")}))))))},ta=()=>{const{settings:a,hasResolvedSettings:n,saveSettings:l}=(0,B.useSettingsEntities)(),[s,o]=(0,t.useState)(!1),[c,m]=(0,t.useState)(v),u=e=>{const t=S(c,e);m(t)};return(0,t.useEffect)(()=>{n&&m(a)},[n,a]),n?(0,e.createElement)("div",{className:"wrap about-wrap full-width-layout"},(0,e.createElement)("form",{onSubmit:async e=>{e.preventDefault(),o(!0),await l(c),o(!1)}},(0,e.createElement)(ut,null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"100%"},(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Cache Expiration","insta-gallery")),(0,e.createElement)("td",null,(0,e.createElement)("input",{type:"number",min:"1",max:"168",onChange:e=>u({insta_reset:e.target.value}),value:0==c.insta_reset?"1":c.insta_reset}),(0,e.createElement)("span",{className:"description"},(0,r.__)("Reset your Instagram feeds cache every x hours.","insta-gallery")))),(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Notification Email","insta-gallery")),(0,e.createElement)("td",null,(0,e.createElement)("input",{type:"email",onChange:e=>u({mail_to_alert:e.target.value}),value:c.mail_to_alert}),(0,e.createElement)("span",{className:"description"},(0,r.__)("Add email to notify about account expiration.","insta-gallery")))),(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Replace Loader","insta-gallery")),(0,e.createElement)("td",null,(0,e.createElement)("input",{type:"hidden",name:"insta_spinner_image_id"}),(0,e.createElement)(Ut,{onChange:e=>{u({spinner_image_url:e.url})},onRemove:()=>{u({spinner_image_url:""})},value:{url:c.spinner_image_url}}),!c.spinner_image_url&&(0,e.createElement)("p",null,(0,e.createElement)("span",{className:"description"},(0,r.__)("Select an image from media library to replace the default loader icon.","insta-gallery"))))),(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,r.__)("Remove data","insta-gallery")),(0,e.createElement)("td",null,(0,e.createElement)("input",{type:"checkbox",checked:!!c.insta_flush,onChange:e=>u({insta_flush:!!e.target.checked})}),(0,e.createElement)("span",{className:"description"},(0,r.__)("Check this box to remove all data related to this plugin on uninstall.","insta-gallery"))))))))),(0,e.createElement)("tfoot",null,(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"2"},(0,e.createElement)("span",{className:"spinner"}),(0,e.createElement)("button",{disabled:(0,i.isEqual)(a,c),type:"submit",className:"button button-primary secondary"},(0,r.__)("Save","insta-gallery")),s&&(0,e.createElement)("span",{style:{visibility:"visible"},className:"spinner"})),(0,e.createElement)("td",{style:{textAlign:"right"},colSpan:"1"},(0,e.createElement)("a",{href:"https://quadlayers.com/documentation/instagram-feed-gallery/app-privacy/?utm_source=qligg_plugin&utm_medium=admin_tab&utm_campaign=documentation&utm_content=privacy_link",target:"__blank"},(0,r.__)("Privacy Policy","insta-gallery")))))))):(0,e.createElement)(mt,null)},aa=()=>{const{Fill:t}=R();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(t.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(t.Content,null,(0,e.createElement)(ta,null)))};var na=a(855);const la=()=>{const{Fill:t}=R();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Header,null,(0,e.createElement)(x,null)),(0,e.createElement)(t.Navigation,null,(0,e.createElement)(I,null)),(0,e.createElement)(t.Content,null,(0,e.createElement)(na.List,{authorName:"quadlayers",columns:"3"})))},{tabParam:ra,setBrowserTabParam:sa}=(()=>{const e=document.location.href,t=new URLSearchParams(e),a=new URL(window.location);return{tabParam:t.get("tab"),setBrowserTabParam:e=>{a.searchParams.set("tab",e),window.history.pushState(null,"",a.toString())}}})(),ia=(0,t.createContext)({}),oa=()=>(0,t.useContext)(ia),ca=(e,t)=>"SET_CURRENT_TAB"===t.type?{...e,...t.payload,prevTab:e.currentTab}:e,ma=({children:a})=>{const n=(0,s.applyFilters)("insta-gallery.app.tabs",[{label:(0,r.__)("Welcome","insta-gallery"),name:"welcome",content:j},{label:(0,r.__)("Accounts","insta-gallery"),name:"accounts",content:yt},{label:(0,r.__)("Feeds","insta-gallery"),name:"feeds",content:Kt},{label:(0,r.__)("Settings","insta-gallery"),name:"settings",href:"settings",content:aa},{label:(0,r.__)("Premium","insta-gallery"),name:"premium",content:ea},{label:(0,r.__)("Suggestions","insta-gallery"),name:"suggestions",content:la}]),[l,i]=(0,t.useReducer)(ca,(({defaultTab:e})=>({currentTab:ra||e,currentTabSection:"",prevTab:null,prevSubTab:null,user:!1}))({defaultTab:n[0].name}));return(0,t.useEffect)(()=>{const e=Array.from(document.querySelectorAll("#toplevel_page_qligg > ul > li")),t=l.currentTab[0].toUpperCase()+l.currentTab.slice(1).toLowerCase();e.map(e=>e.innerText===t?e?.classList.add("current"):e?.classList.remove("current"))},[l.currentTab]),(0,e.createElement)(ia.Provider,{value:{...l,setCurrentTab:e=>{l.currentTab!=e&&(sa(e),i({type:"SET_CURRENT_TAB",payload:{currentTab:e}}))},tabs:n}},a)},ua=(ia.Consumer,()=>{const{currentTab:t,tabs:a}=oa(),n=a.find(({name:e})=>e==t);if(!n)return(0,e.createElement)(e.Fragment,null,t);const l=n.content;return(0,e.createElement)(l,null)}),da=({children:t})=>(0,e.createElement)(D,null,(0,e.createElement)(q,null,({Slot:a,containerRef:n})=>(0,e.createElement)("div",{ref:n},(0,e.createElement)("header",null,(0,e.createElement)(a.Header,null),!1),(0,e.createElement)("section",null,(0,e.createElement)("nav",null,(0,e.createElement)(a.Navigation,null)),(0,e.createElement)("section",null,(0,e.createElement)("section",null,(0,e.createElement)(a.Content,null)),(0,e.createElement)("aside",null,(0,e.createElement)(a.Aside,null))),(0,e.createElement)("footer",null,(0,e.createElement)(a.Footer,null))),t))),pa=()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ma,null,(0,e.createElement)(da,null,(0,e.createElement)(ua,null))),l.EditorSnackbars?(0,e.createElement)(l.EditorSnackbars,null):(0,e.createElement)(l.EditorNotices,null));N(()=>{const a=document.getElementById("wpbody-content");(0,t.render)((0,e.createElement)(pa,null),a)})})(),(window.instagram=window.instagram||{}).backend=n})();